- $MSG1 = ""; $MSG2 = "";
- // No login entered?
- if (empty($_POST['login'])) $MSG1 = ADMIN_NO_LOGIN;
-
- // An error comes back from login?
- if ((!empty($ret)) && ($_POST['ok'] == "404")) $MSG1 = $ret;
-
- // No password entered?
- if (empty($_POST['pass'])) $MSG2 = ADMIN_NO_PASS;
-
- // Or password too short?
- if (strlen($_POST['pass']) < 4) $MSG2 = ADMIN_SHORT_PASS;
-
- // An error comes back from login?
- if ((!empty($ret)) && ($_POST['ok'] == "pass")) $MSG2 = $ret;
-
- // Load message template
- define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1));
- define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $MSG2));
+ // Check for password
+ if (!isPostRequestParameterSet('password')) {
+ // No password entered?
+ $passwdMessage = '{--ADMIN_NO_PASS--}';
+ } elseif (strlen(postRequestParameter('password')) < getConfig('minium_admin_pass_length')) {
+ // Or password too short?
+ $passwdMessage = '{--ADMIN_SHORT_PASS--}';
+ } elseif ((!empty($ret)) && (postRequestParameter('ok') == 'password')) {
+ // An error comes back from login?
+ $passwdMessage = $ret;
+ }