Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2013 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5754997 to your computer and use it in GitHub Desktop.
Save anonymous/5754997 to your computer and use it in GitHub Desktop.
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