Skip to content

Commit b4dc9bb

Browse files
authored
Fix "generate password" on Add/Edit Mail Account (hestiacp#3142)
1 parent 25b39e0 commit b4dc9bb

File tree

12 files changed

+20
-20
lines changed

12 files changed

+20
-20
lines changed

web/js/pages/add_db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ App.Listeners.DB.keypress_v_password();
102102
App.Listeners.DB.keypress_db_username();
103103
App.Listeners.DB.keypress_db_databasename();
104104

105-
applyRandomString = function (min_length = 16) {
105+
applyRandomPassword = function (min_length = 16) {
106106
$('input[name=v_password]').val(randomString(min_length));
107107
App.Actions.DB.update_password_meter();
108108
};

web/js/pages/add_mail_acc.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ App.Listeners.MAIL_ACC.keypress_v_password = function () {
109109

110110
App.Listeners.MAIL_ACC.keypress_v_password();
111111

112-
applyRandomString = function (min_length = 16) {
113-
var randomString = randomString(min_length);
114-
$('input[name=v_password]').val(randomString);
112+
applyRandomPassword = function (min_length = 16) {
113+
var randomPassword = randomString(min_length);
114+
$('input[name=v_password]').val(randomPassword);
115115
if ($('input[name=v_password]').attr('type') == 'text')
116-
$('.js-password-output').text(randomString);
117-
else $('.js-password-output').text(Array(randomString.length + 1).join('*'));
116+
$('.js-password-output').text(randomPassword);
117+
else $('.js-password-output').text(Array(randomPassword.length + 1).join('*'));
118118
App.Actions.MAIL_ACC.update_password_meter();
119119
generate_mail_credentials();
120120
};

web/js/pages/add_user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $(function () {
1313
});
1414
});
1515

16-
applyRandomString = function (min_length = 16) {
16+
applyRandomPassword = function (min_length = 16) {
1717
$('input[name=v_password]').val(randomString(min_length));
1818
App.Actions.WEB.update_password_meter();
1919
};

web/js/pages/edit_db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ App.Listeners.DB.keypress_v_password();
109109
App.Listeners.DB.keypress_db_username();
110110
App.Listeners.DB.keypress_db_databasename();
111111

112-
applyRandomString = function (min_length = 16) {
112+
applyRandomPassword = function (min_length = 16) {
113113
$('input[name=v_password]').val(randomString(min_length));
114114
App.Actions.DB.update_password_meter();
115115
};

web/js/pages/edit_mail_acc.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ $('#v_blackhole').on('click', function (evt) {
100100

101101
App.Listeners.MAIL_ACC.keypress_v_password();
102102

103-
applyRandomString = function (min_length = 16) {
104-
var randomString = randomString(min_length);
105-
$('input[name=v_password]').val(randomString);
103+
applyRandomPassword = function (min_length = 16) {
104+
var randomPassword = randomString(min_length);
105+
$('input[name=v_password]').val(randomPassword);
106106
if ($('input[name=v_password]').attr('type') == 'text')
107-
$('.js-password-output').text(randomString);
108-
else $('.js-password-output').text(Array(randomString.length + 1).join('*'));
107+
$('.js-password-output').text(randomPassword);
108+
else $('.js-password-output').text(Array(randomPassword.length + 1).join('*'));
109109
App.Actions.MAIL_ACC.update_password_meter();
110110
generate_mail_credentials();
111111
};

web/js/pages/edit_user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function applyRandomString(min_length = 16) {
1+
function applyRandomPassword(min_length = 16) {
22
document.querySelector('input[name=v_password]').value = randomString(min_length);
33
App.Actions.WEB.update_password_meter();
44
}

web/templates/pages/add_db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<div class="u-mb10">
7676
<label for="v_password" class="form-label">
7777
<?= _("Password") ?>
78-
<a href="javascript:applyRandomString();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
78+
<a href="javascript:applyRandomPassword();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
7979
</label>
8080
<div class="u-pos-relative u-mb10">
8181
<input type="text" class="form-control js-password-input" name="v_password" id="v_password">

web/templates/pages/add_mail_acc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<div class="u-mb10">
4646
<label for="v_password" class="form-label">
4747
<?= _("Password") ?>
48-
<a href="javascript:applyRandomString();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
48+
<a href="javascript:applyRandomPassword();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
4949
</label>
5050
<div class="u-pos-relative u-mb10">
5151
<input type="text" class="form-control js-password-input" name="v_password" id="v_password">

web/templates/pages/add_user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<div class="u-mb10">
4747
<label for="v_password" class="form-label">
4848
<?= _("Password") ?>
49-
<a href="javascript:applyRandomString();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
49+
<a href="javascript:applyRandomPassword();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
5050
</label>
5151
<div class="u-pos-relative u-mb10">
5252
<input type="text" class="form-control js-password-input" name="v_password" id="v_password" value="<?= htmlentities(trim($v_password, "'")) ?>" tabindex="4">

web/templates/pages/edit_db.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<div class="u-mb10">
4141
<label for="v_password" class="form-label">
4242
<?= _("Password") ?>
43-
<a href="javascript:applyRandomString();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
43+
<a href="javascript:applyRandomPassword();" title="<?= _("generate") ?>" class="u-ml5"><i class="fas fa-arrows-rotate status-icon green icon-large"></i></a>
4444
</label>
4545
<div class="u-pos-relative u-mb10">
4646
<input type="text" class="form-control js-password-input" name="v_password" id="v_password" value="<?= htmlentities(trim($v_password, "'")) ?>">

0 commit comments

Comments
 (0)