X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmodules%2Fadmin.php;h=98fdb7947e1d5b68df5854c9e08b35afa0ed437f;hb=508228c85fba8448d00865b1639cb8cd7a69e457;hp=198995ae10a5686dee2201ef647306850404e2f1;hpb=f74581eca45c393033acfd9d7798b958031bc625;p=mailer.git diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 198995ae10..98fdb7947e 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Administrationsmodul * * -------------------------------------------------------------------- * - * * + * $Revision:: 856 $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -37,12 +42,6 @@ if (!defined('__SECURITY')) { require($INC); } -// Login is default -if ((empty($GLOBALS['action'])) && (CHECK_MODULE($GLOBALS['module']) == "admin_only")) { - // Redirect to right URL - LOAD_URL("modules.php?module=admin&action=login"); -} // END - if - // Load include file LOAD_INC_ONCE("inc/modules/admin/admin-inc.php"); @@ -67,14 +66,14 @@ if (!isAdminRegistered()) { destroyAdminSession(false); // Do registration - $ret = REGISTER_ADMIN(REQUEST_POST('login'), $hashedPass); + $ret = REGISTER_ADMIN(REQUEST_POST('login'), $hashedPass, constant('WEBMASTER')); switch ($ret) { case "done": - changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0); - if (!constant('_FATAL')) { + $done = changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0); + if ($done === true) { // Registering is done - LOAD_URL("modules.php?module=admin&action=login®ister=done"); + LOAD_URL("modules.php?module=admin&register=done"); } else { $ret = getMessage('ADMIN_CANNOT_COMPLETE'); } @@ -91,7 +90,7 @@ if (!isAdminRegistered()) { $ret = getMessage('ADMIN_LOGIN_ALREADY_REG'); } else { // Any other kind will be logged and interpreted as 'done' - DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown return code %s from CHECK_ADMIN_LOGIN()", $ret)); + DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown return code %s from CHECK_ADMIN_LOGIN() and interpreted as 'done'!", $ret)); // @TODO Why is this set to 'done'? $ret = "done"; } @@ -102,7 +101,7 @@ if (!isAdminRegistered()) { changeDataInFile(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0); // Load URL for login - LOAD_URL("modules.php?module=admin&action=login"); + LOAD_URL("modules.php?module=admin"); } // END - if break; } @@ -195,7 +194,7 @@ if (!isAdminRegistered()) { // At leat one administrator account was created if ((isSessionVariableSet('admin_login')) && (isSessionVariableSet('admin_md5')) && (isSessionVariableSet('admin_last')) && (isSessionVariableSet('admin_to'))) { // Timeout for last login, we have to logout first! - LOAD_URL("modules.php?module=admin&action=login&logout=1"); + LOAD_URL("modules.php?module=admin&logout=1"); } // END - if if (REQUEST_ISSET_GET(('register'))) { @@ -338,7 +337,7 @@ if (!isAdminRegistered()) { LOAD_TEMPLATE("admin_settings_saved", false, "
{--ADMIN_LOGOUT_FAILED--}
"); // Add fatal message - addFatalMessage(getMessage('CANNOT_UNREG_SESS')); + addFatalMessage(__FILE__, __LINE__, getMessage('CANNOT_UNREG_SESS')); } } else { // Maybe an Admin want's to login? @@ -347,7 +346,7 @@ if (!isAdminRegistered()) { { case "done": // Check for access control line of current menu entry - define('__ACL_ALLOW', RUN_FILTER('check_admin_acl')); + $GLOBALS['acl_allow'] = 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"); @@ -375,13 +374,13 @@ if (!isAdminRegistered()) { case "404": // Administrator login not found REQUEST_SET_POST('ok', $ret); destroyAdminSession(); - addFatalMessage(getMessage('ADMIN_NOT_FOUND')); + addFatalMessage(__FILE__, __LINE__, getMessage('ADMIN_NOT_FOUND')); break; case "pass": // Wrong password REQUEST_SET_POST('ok', $ret); destroyAdminSession(); - addFatalMessage(getMessage('WRONG_PASS')); + addFatalMessage(__FILE__, __LINE__, getMessage('WRONG_PASS')); break; default: // Others will be logged