+ if ((isFormSent()) && (REQUEST_POST('ok') != '***')) {
+ // All required data was entered so we check his account
+ $ret = CHECK_ADMIN_LOGIN(REQUEST_POST('login'), REQUEST_POST('pass'));
+
+ // Which status do we have?
+ switch ($ret) {
+ case 'done': // Admin and password are okay, so we log in now
+ // Construct URL and redirect
+ $URL = 'modules.php?module=admin&';
+
+ // Rewrite overview module
+ if (getWhat() == 'overview') {
+ setAction(getModeAction(getModule(), getWhat()));
+ } // END - if
+
+ // Add data to URL
+ if (isWhatSet()) $URL .= 'what='.getWhat();
+ elseif (isActionSet()) $URL .= 'action='.getAction();
+ elseif (REQUEST_ISSET_GET('area')) $URL .= 'area='.REQUEST_GET('area');
+
+ // Load URL
+ redirectToUrl($URL);
+ break;
+
+ case '404': // Administrator login not found
+ REQUEST_SET_POST('ok', $ret);
+ $ret = getMessage('ADMIN_NOT_FOUND');
+ destroyAdminSession();
+ break;
+
+ case 'pass': // Wrong password
+ REQUEST_SET_POST('ok', $ret);
+ $ret = '{--WRONG_PASS--} [<a href="{!URL!}/modules.php?module=admin&reset_pass=1">{--ADMIN_RESET_PASS--}</a>]';
+ destroyAdminSession();
+ break;
+
+ default: // Others will be logged
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown return code %s from CHECK_ADMIN_LOGIN()", $ret));
+ break;
+ } // END - switch
+ } // END - if