mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
fixes #2441 add password fields for generic users in user creation
Introduces password and password confirmation fields when creating a user with 'generic' status. The password fields are shown or hidden based on the selected user status, and validation is added to ensure passwords are entered and match. Also adds a button to generate random passwords for new generic users.
This commit is contained in:
@@ -25,6 +25,8 @@ const cancel_msg = '{'No, I have changed my mind'|@translate|@escape}';
|
||||
const str_and_others_tags = '{'and %s others'|@translate|escape:javascript}';
|
||||
const missingConfirm = "{'You need to confirm deletion'|translate|escape:javascript}";
|
||||
const missingUsername = "{'Please, enter a login'|translate|escape:javascript}";
|
||||
const missingPassword = "{'Password is missing. Please enter the password.'|translate|escape:javascript}";
|
||||
const missingConfPassword = "{'Password confirmation is missing. Please confirm the chosen password.'|translate|escape:javascript}";
|
||||
const fieldNotEmpty = "{'Name field must not be empty'|@translate|escape:javascript}"
|
||||
const noMatchPassword = "{'The passwords do not match'|@translate|escape:javascript}";
|
||||
const missingField = "{'Please complete all fields'|@translate|escape:javascript}";
|
||||
@@ -1184,12 +1186,30 @@ $(document).ready(function() {
|
||||
<option value="admin">{'user_status_admin'|@translate}</option>
|
||||
<option value="normal">{'user_status_normal'|@translate}</option>
|
||||
<option value="generic">{'user_status_generic'|@translate}</option>
|
||||
<option value="guest">{'user_status_guest'|@translate} ({'Deactivated'|@translate})</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="add_user_password" style="display: none;">
|
||||
<div class="AddUserGenPassword">
|
||||
<label for="add_user_pass" class="user-property-label AddUserLabelPassword">{'Password'|@translate}</label>
|
||||
<span class="icon-dice-solid"> {'Generate random password'|@translate}</span>
|
||||
</div>
|
||||
<div class="user-property-input-icon" style="margin-bottom: 5px;">
|
||||
<input id="add_user_pass" class="user-property-input user-property-input-password" value=""
|
||||
placeholder="{'Password'|@translate}" type="password" />
|
||||
<span class="icon-eye icon-show-password"></span>
|
||||
</div>
|
||||
|
||||
<label for="add_user_confpass" class="user-property-label AddUserLabelPasswordConf">{'Confirm Password'|@translate}</label>
|
||||
<div class="user-property-input-icon" style="margin-bottom: 5px;">
|
||||
<input id="add_user_confpass" class="user-property-input user-property-input-password-conf" value=""
|
||||
placeholder="{'Confirm Password'|@translate}" type="password" />
|
||||
<span class="icon-eye icon-show-password"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="AddUserInputContainer">
|
||||
<div class="user-property-level">
|
||||
<p class="user-property-label">{'Privacy level'|@translate}</p>
|
||||
@@ -2196,19 +2216,26 @@ $(document).ready(function() {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.EditUserGenPassword {
|
||||
.EditUserGenPassword,
|
||||
.AddUserGenPassword {
|
||||
margin-top: 15px;
|
||||
font-size: 1.1em;
|
||||
cursor:pointer;
|
||||
}
|
||||
.EditUserGenPassword:hover, .EditUserGenPassword:active {
|
||||
.EditUserGenPassword:hover, .EditUserGenPassword:active,
|
||||
.AddUserGenPassword span:hover {
|
||||
color:#ffa646;
|
||||
}
|
||||
|
||||
.EditUserGenPassword span {
|
||||
.EditUserGenPassword span,
|
||||
.AddUserGenPassword span {
|
||||
margin-right:10px;
|
||||
}
|
||||
|
||||
.AddUserGenPassword span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.EditUserErrors {
|
||||
opacity: 0;
|
||||
padding: 7px 0;
|
||||
@@ -2608,6 +2635,10 @@ $(document).ready(function() {
|
||||
display:none;
|
||||
}
|
||||
|
||||
.hide-user-property-password {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.AddUserPopInContainer{
|
||||
display:flex;
|
||||
position:absolute;
|
||||
|
||||
Reference in New Issue
Block a user