v0.11.3 - Fixed roles

Added pattern to passwords
This commit is contained in:
Anders 2020-09-07 08:33:46 +02:00
parent 84f5c51c48
commit 5f234d95dc
5 changed files with 33 additions and 16 deletions

View File

@ -70,9 +70,9 @@
<tr> <tr>
<td>Aktiviteter</td> <td>Aktiviteter</td>
<td><p>Empty</p></td> <td><p>Empty</p></td>
<td><input id="EventCAccount" type="checkbox" name="value[]" value="userevent.create"></td> <td><input id="EventParticipateAccount" type="checkbox" name="value[]" value="userevent.create"></td>
<td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show"></td> <td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show"></td>
<td><input id="EventDAccount" type="checkbox" name="value[]" value="userevent.delete"></td> <td><input id="EventStopParticipatingAccount" type="checkbox" name="value[]" value="userevent.delete"></td>
</tr> </tr>
<tr> <tr>
<td>Reservationer</td> <td>Reservationer</td>
@ -195,7 +195,7 @@
<td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show"></td> <td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show"></td>
<td></td> <td></td>
<td><input id="ReservationD" onclick="if ($('#ReservationCAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td> <td><input id="ReservationD" onclick="if ($('#ReservationCAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete"></td>
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>Kontakter</td> <td>Kontakter</td>
@ -222,7 +222,7 @@
<td><input id="FeedbackR" type="checkbox" name="value[]" value="feedback.show"></td> <td><input id="FeedbackR" type="checkbox" name="value[]" value="feedback.show"></td>
<td></td> <td></td>
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete"></td> <td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete"></td>
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td> <td></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -332,11 +332,21 @@
$('#' + Read).prop('checked', false); $('#' + Read).prop('checked', false);
$('#' + Update).prop('checked', false); $('#' + Update).prop('checked', false);
$('#' + Delete).prop('checked', false); $('#' + Delete).prop('checked', false);
// If there is a button in the app side too - Then check off
$('#' + Create + 'Account').prop('checked', false);
$('#' + Read + 'Account').prop('checked', false);
$('#' + Delete + 'Account').prop('checked', false);
} else { } else {
$('#' + Create).prop('checked', true); $('#' + Create).prop('checked', true);
$('#' + Read).prop('checked', true); $('#' + Read).prop('checked', true);
$('#' + Update).prop('checked', true); $('#' + Update).prop('checked', true);
$('#' + Delete).prop('checked', true); $('#' + Delete).prop('checked', true);
// If there is a button in the app side too - Then check on
$('#' + Create + 'Account').prop('checked', true);
$('#' + Read + 'Account').prop('checked', true);
$('#' + Delete + 'Account').prop('checked', true);
} }
} }
</script> </script>

View File

@ -70,9 +70,9 @@
<tr> <tr>
<td>Aktiviteter</td> <td>Aktiviteter</td>
<td><p>Empty</p></td> <td><p>Empty</p></td>
<td><input id="EventRAccount" type="checkbox" name="value[]" value="userevent.create" @if ($role->hasPermissionTo("userevent.create")) checked @endif></td> <td><input id="EventParticipateAccount" type="checkbox" name="value[]" value="userevent.create" @if ($role->hasPermissionTo("userevent.create")) checked @endif></td>
<td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show" @if ($role->hasPermissionTo("event.show")) checked @endif></td> <td><input id="EventRAccount" onclick="if ($('#EventR').prop('checked') == false) $('#EventR').prop('checked', true); else $('#EventR').prop('checked', false);" type="checkbox" name="value[]" value="event.show" @if ($role->hasPermissionTo("event.show")) checked @endif></td>
<td><input id="EventRAccount" type="checkbox" name="value[]" value="userevent.delete" @if ($role->hasPermissionTo("userevent.delete")) checked @endif></td> <td><input id="EventStopParticipatingAccount" type="checkbox" name="value[]" value="userevent.delete" @if ($role->hasPermissionTo("userevent.delete")) checked @endif></td>
</tr> </tr>
<tr> <tr>
<td>Reservationer</td> <td>Reservationer</td>
@ -195,7 +195,7 @@
<td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show" @if ($role->hasPermissionTo("washing.machine.reservation.show")) checked @endif></td> <td><input id="ReservationR" onclick="if ($('#ReservationRAccount').prop('checked') == false) $('#ReservationRAccount').prop('checked', true); else $('#ReservationRAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.show" @if ($role->hasPermissionTo("washing.machine.reservation.show")) checked @endif></td>
<td></td> <td></td>
<td><input id="ReservationD" onclick="if ($('#ReservationDAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete" @if ($role->hasPermissionTo("washing.machine.reservation.delete")) checked @endif></td> <td><input id="ReservationD" onclick="if ($('#ReservationDAccount').prop('checked') == false) $('#ReservationDAccount').prop('checked', true); else $('#ReservationDAccount').prop('checked', false);" type="checkbox" name="value[]" value="washing.machine.reservation.delete" @if ($role->hasPermissionTo("washing.machine.reservation.delete")) checked @endif></td>
<td><input id="Reservation" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit--> <td></td>
</tr> </tr>
<tr> <tr>
<td>Kontakter</td> <td>Kontakter</td>
@ -222,7 +222,7 @@
<td><input id="FeedbackR" onclick="if ($('#FeedbackRAccount').prop('checked') == false) $('#FeedbackRAccount').prop('checked', true); else $('#FeedbackRAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show" @if ($role->hasPermissionTo("feedback.show")) checked @endif></td> <td><input id="FeedbackR" onclick="if ($('#FeedbackRAccount').prop('checked') == false) $('#FeedbackRAccount').prop('checked', true); else $('#FeedbackRAccount').prop('checked', false);" type="checkbox" name="value[]" value="feedback.show" @if ($role->hasPermissionTo("feedback.show")) checked @endif></td>
<td></td> <td></td>
<td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete" @if ($role->hasPermissionTo("feedback.delete")) checked @endif></td> <td><input id="FeedbackD" type="checkbox" name="value[]" value="feedback.delete" @if ($role->hasPermissionTo("feedback.delete")) checked @endif></td>
<td><input id="Feedback" type="checkbox" onclick="FullControl(this)"></td><!--Lave en rolle som give fuld adgang ligesom ownuser.edit--> <td></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -334,11 +334,21 @@
$('#' + Read).prop('checked', false); $('#' + Read).prop('checked', false);
$('#' + Update).prop('checked', false); $('#' + Update).prop('checked', false);
$('#' + Delete).prop('checked', false); $('#' + Delete).prop('checked', false);
// If there is a button in the app side too - Then check off
$('#' + Create + 'Account').prop('checked', false);
$('#' + Read + 'Account').prop('checked', false);
$('#' + Delete + 'Account').prop('checked', false);
} else { } else {
$('#' + Create).prop('checked', true); $('#' + Create).prop('checked', true);
$('#' + Read).prop('checked', true); $('#' + Read).prop('checked', true);
$('#' + Update).prop('checked', true); $('#' + Update).prop('checked', true);
$('#' + Delete).prop('checked', true); $('#' + Delete).prop('checked', true);
// If there is a button in the app side too - Then check on
$('#' + Create + 'Account').prop('checked', true);
$('#' + Read + 'Account').prop('checked', true);
$('#' + Delete + 'Account').prop('checked', true);
} }
} }
@ -348,9 +358,6 @@
for (i = 0; i < arr.length; i++) { for (i = 0; i < arr.length; i++) {
if ($('#'+arr[i]+'C').prop('checked') == true && $('#'+arr[i]+'R').prop('checked') == true && $('#'+arr[i]+'U').prop('checked') == true && $('#'+arr[i]+'D').prop('checked') == true) if ($('#'+arr[i]+'C').prop('checked') == true && $('#'+arr[i]+'R').prop('checked') == true && $('#'+arr[i]+'U').prop('checked') == true && $('#'+arr[i]+'D').prop('checked') == true)
$('#'+arr[i]).prop('checked', true); $('#'+arr[i]).prop('checked', true);
else if(arr[i] == 'Feedback' || arr[i] == 'Reservation')
if($('#'+arr[i]+'R').prop('checked') == true && $('#'+arr[i]+'D').prop('checked') == true)
$('#'+arr[i]).prop('checked', true);
} }
}); });
</script> </script>

View File

@ -20,10 +20,10 @@
<label for="email">Email:</label> <label for="email">Email:</label>
<label hidden id="erroremail">Der findes allerede en bruger med denne email!</label> <label hidden id="erroremail">Der findes allerede en bruger med denne email!</label>
<input type="email" name="email" id="email" placeholder="x@y.z" required> <input type="email" name="email" id="email" placeholder="x@y.z" required>
<label for="password1">Adgangskode:</label> <!--Tilføj dette til passwords: pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters"--> <label for="password1">Adgangskode:</label>
<label hidden id="errornotsamepass" for="errormesseages" >Der stod ikke det samme i `Adgangskode` & `Bekræft Adgangskode`!</label> <label hidden id="errornotsamepass" for="errormesseages" >Der stod ikke det samme i `Adgangskode` & `Bekræft Adgangskode`!</label>
<div class="input-group text-left"> <div class="input-group text-left">
<input type="password" class="form-control" name="password" id="password1" placeholder="******" required> <input type="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Adgangskoden skal indeholde mindst et tal, et lille bogstav, et stort bogstav og have en minimumslængde på 8 karakterer" class="form-control" name="password" id="password1" placeholder="******" required>
<span class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('password1', 'fa-new')"></span> <span class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('password1', 'fa-new')"></span>
</div> </div>
<label for="password2">Bekræft Adgangskode:</label> <label for="password2">Bekræft Adgangskode:</label>

View File

@ -24,7 +24,7 @@
<label for="password1">Password: (Forblives blank, hvis password ikke skal ændres)</label> <label for="password1">Password: (Forblives blank, hvis password ikke skal ændres)</label>
<label hidden id="errornotsamepass" for="errormesseages">Der stod ikke det samme i `Adgangskode` & `Bekræft Adgangskode`!</label> <label hidden id="errornotsamepass" for="errormesseages">Der stod ikke det samme i `Adgangskode` & `Bekræft Adgangskode`!</label>
<div class="input-group text-left"> <div class="input-group text-left">
<input type="password" class="form-control" name="password" id="password1" value="" placeholder="******"> <input type="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Adgangskoden skal indeholde mindst et tal, et lille bogstav, et stort bogstav og have en minimumslængde på 8 karakterer" class="form-control" name="password" id="password1" value="" placeholder="******">
<span class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('password1', 'fa-new')"></span> <span class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('password1', 'fa-new')"></span>
</div> </div>
<label for="password2">Confirm Password: (Forblives blank, hvis password ikke skal ændres)</label> <label for="password2">Confirm Password: (Forblives blank, hvis password ikke skal ændres)</label>

View File

@ -17,7 +17,7 @@
</div> </div>
<span>{{__('msg.nytpassword')}}:</span> <span>{{__('msg.nytpassword')}}:</span>
<div class="input-group text-left"> <div class="input-group text-left">
<input type="password" class="form-control" name="password" id="new" placeholder="******" required> <input type="password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" title="Adgangskoden skal indeholde mindst et tal, et lille bogstav, et stort bogstav og have en minimumslængde på 8 karakterer" class="form-control" name="password" id="new" placeholder="******" required>
<span class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('new', 'fa-new')"></span> <span class="fa fa-fw fa-eye field-icon toggle-password" id="fa-new" onclick="show('new', 'fa-new')"></span>
</div> </div>
<span>{{__('msg.confirmpassword')}}:</span> <span>{{__('msg.confirmpassword')}}:</span>