X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin.php;h=d1b8d627b8a9658f705baa27c7ded25ccb2669ad;hb=c819b98b236c15ad0b46fc296d9a0e2c1617fee9;hp=43df3fa8de2b1ba35f439d1ad969b5ab0ebf5196;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 43df3fa8de..d1b8d627b8 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -1,7 +1,7 @@ SQL_ESCAPE(postRequestElement('hash')), - 'login' => SQL_ESCAPE(postRequestElement('login')) + 'hash' => secureString(postRequestElement('hash')), + 'login' => secureString(postRequestElement('login')) ); // Validation okay so display form for final password change @@ -186,9 +186,9 @@ if (!isAdminRegistered()) { // Output reset password form loadTemplate('admin_send_reset_link'); } -} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last')) || (!isSessionVariableSet('admin_to')) || ((getSession('admin_last') + bigintval(getSession('admin_to')) * 3600 * 24) < time())) { +} elseif ((!isSessionVariableSet('admin_login')) || (!isSessionVariableSet('admin_md5')) || (!isSessionVariableSet('admin_last'))) { // At leat one administrator account was created - if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) { + if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last'))) { // Timeout for last login, we have to logout first! redirectToUrl('modules.php?module=admin&logout=1'); } // END - if @@ -229,7 +229,7 @@ if (!isAdminRegistered()) { case '404': // Administrator login not found setRequestPostElement('ok', $ret); - $ret = getMessage('ADMIN_404'); + $ret = sprintf(getMessage('ADMIN_404'), postRequestElement('login')); destroyAdminSession(); break; @@ -278,10 +278,6 @@ if (!isAdminRegistered()) { // Load message template $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage); $content['pass_message'] = loadTemplate('admin_login_msg', true, $passwdMessage); - - // Reset variables - unset($loginMessage); - unset($passwdMessage); } // END - if // Load login form @@ -337,11 +333,12 @@ if (!isAdminRegistered()) { } else { // Maybe an Admin want's to login? $ret = ifAdminCookiesAreValid(getSession('admin_login'), getSession('admin_md5')); - switch ($ret) - { + + // Check status + switch ($ret) { case 'done': // Check for access control line of current menu entry - $GLOBALS['acl_allow'] = runFilterChain('check_admin_acl'); + runFilterChain('check_admin_acl'); // When type of admin menu is not set fallback to old menu system if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', 'OLD'); @@ -358,30 +355,30 @@ if (!isAdminRegistered()) { loadIncludeOnce('inc/modules/admin/lasys-inc.php'); // Create new-style menu system will logical areas - ADMIN_LOGICAL_AREA_SYSTEM($area, $action, getWhat()); + doAdminLogicalArea($area, $action, getWhat()); } else { // This little call constructs the whole default old and lacky menu system // on left side. It also renders the content on right side - doAdminAction(getWhat()); + doAdminAction(); } break; case '404': // Administrator login not found setRequestPostElement('ok', $ret); + loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_404'), getSession('admin_login'))); destroyAdminSession(); - addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_404')); break; case 'pass': // Wrong password setRequestPostElement('ok', $ret); + loadTemplate('admin_settings_saved', false, getMessage('WRONG_PASS')); destroyAdminSession(); - addFatalMessage(__FILE__, __LINE__, getMessage('WRONG_PASS')); break; default: // Others will be logged logDebugMessage(__FILE__, __LINE__, sprintf("Unknown return code %s from ifAdminCookiesAreValid()", $ret)); break; - } + } // END - switch } // [EOF]