Add ability to generate passwords for new mailboxes

master
andryyy 2017-06-16 08:52:41 +02:00
parent 09a6d432f1
commit 03d4ea5a35
3 changed files with 12 additions and 1 deletions

View File

@ -29,4 +29,5 @@ table.footable>tbody>tr.footable-empty>td {
}
.inputMissingAttr {
border-color: #FF4136;
}
}

View File

@ -20,6 +20,15 @@ $(document).ready(function() {
auto_fill_quota($('#addSelectDomain').val());
});
auto_fill_quota($('#addSelectDomain').val());
$(".generate_password").click(function( event ) {
event.preventDefault();
var random_passwd = Math.random().toString(36).slice(-8)
$('#password').prop('type', 'text');
$('#password').val(random_passwd);
$('#password2').prop('type', 'text');
$('#password2').val(random_passwd);
});
});
jQuery(function($){

View File

@ -50,6 +50,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {
<label class="control-label col-sm-2" for="password"><?=$lang['add']['password'];?></label>
<div class="col-sm-10">
<input type="password" class="form-control" name="password" id="password" placeholder="" required>
(<a href="#" class="generate_password">Generate</a>)
</div>
</div>
<div class="form-group">