From 0c8d9ff15451e8080d7db1a26212211a048f04e8 Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 7 Dec 2019 21:55:37 +0100 Subject: [PATCH] [Web] Generate longer passwords for app passwords --- data/web/js/build/014-mailcow.js | 7 ++++++- data/web/modals/user.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/data/web/js/build/014-mailcow.js b/data/web/js/build/014-mailcow.js index b8992f59..26602714 100644 --- a/data/web/js/build/014-mailcow.js +++ b/data/web/js/build/014-mailcow.js @@ -15,7 +15,12 @@ $(document).ready(function() { $(".generate_password").click(function( event ) { event.preventDefault(); $('[data-hibp]').trigger('input'); - var random_passwd = GPW.pronounceable(8) + if (typeof($(this).closest("form").data('pwgen-length')) == "number") { + var random_passwd = GPW.pronounceable($(this).closest("form").data('pwgen-length')) + } + else { + var random_passwd = GPW.pronounceable(8) + } $(this).closest("form").find('[data-pwgen-field]').attr('type', 'text'); $(this).closest("form").find('[data-pwgen-field]').val(random_passwd); }); diff --git a/data/web/modals/user.php b/data/web/modals/user.php index d32a2560..90e50a68 100644 --- a/data/web/modals/user.php +++ b/data/web/modals/user.php @@ -171,7 +171,7 @@ if (!isset($_SESSION['mailcow_cc_role'])) {