Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
diff --git create-mailbox.php create-mailbox.php
index c8ec29a..66d6147 100644
--- create-mailbox.php
+++ create-mailbox.php
@@ -131,6 +131,16 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
}
}
+ $min_length = $CONF['min_password_length'];
+ if($min_length > 0 && strlen($fPassword) < $min_length) {
+ $error = 1;
+ $tUsername = escape_string ($_POST['fUsername']);
+ $tName = $fName;
+ $tQuota = $fQuota;
+ $tDomain = $fDomain;
+ $pCreate_mailbox_password_text = '<span class="error_msg">' . sprintf($PALANG['pPasswordTooShort'], $min_length) . '</span>';
+ }
+
if ($CONF['quota'] == "YES")
{
if (!check_quota ($fQuota, $fDomain))
diff --git functions.inc.php functions.inc.php
index 654dfd2..56b5afb 100644
--- functions.inc.php
+++ functions.inc.php
@@ -2336,6 +2336,12 @@ function create_admin($fUsername, $fPassword, $fPassword2, $fDomains, $no_genera
}
}
+ $min_length = $CONF['min_password_length'];
+ if($min_length > 0 && strlen($fPassword) < $min_length) {
+ $error = 1;
+ $pAdminCreate_admin_password_text = '<span class="error_msg">' . sprintf($PALANG['pPasswordTooShort'], $min_length) . '</span>';
+ }
+
if ($error != 1)
{
$password = pacrypt($fPassword);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment