- case "done": // Admin and password are okay, so we log in now
- // Construct URL and redirect
- $URL = URL."/modules.php?module=admin&";
-
- // Rewrite overview module
- if ($GLOBALS['what'] == "overview") {
- $GLOBALS['action'] = GET_ACTION($GLOBALS['module'], $GLOBALS['what']);
- }
-
- // Add data to URL
- if (!empty($GLOBALS['what'])) $URL .= "what=".$GLOBALS['what'];
- elseif (!empty($GLOBALS['action'])) $URL .= "action=".$GLOBALS['action'];
- elseif (!empty($_GET['area'])) $URL .= "area=".$_GET['area'];
-
- // Load URL
- LOAD_URL($URL);
- break;
-
- case "404": // Administrator login not found
- $_POST['ok'] = $ret;
- $ret = ADMIN_NOT_FOUND;
- break;
+ 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 ($GLOBALS['what'] == 'overview') {
+ $GLOBALS['action'] = getModeAction($GLOBALS['module'], $GLOBALS['what']);
+ } // END - if
+
+ // Add data to URL
+ if (!empty($GLOBALS['what'])) $URL .= 'what='.$GLOBALS['what'];
+ elseif (!empty($GLOBALS['action'])) $URL .= 'action='.$GLOBALS['action'];
+ 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