X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmodules%2Fadmin.php;h=13f64f1146c8cbad1b3e97e067f7adef79d546d1;hb=d6ac286748ae6d1f5165f7dd5e124f2b7c6325e4;hp=01facaab06f0026c69e97acdb88e1f24108ad377;hpb=88011a1b5523b5e5ba9bc6495c3e361fc4a3dc8a;p=mailer.git diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 01facaab06..13f64f1146 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -14,11 +14,9 @@ * $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 - 2009 by Roland Haeder * - * Copyright (c) 2009, 2010 by Mailer Developer Team * + * Copyright (c) 2009 - 2011 by Mailer Developer Team * * For more information visit: http://www.mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -74,7 +72,7 @@ if (!isAdminRegistered()) { // Check if registration wents fine switch ($ret) { case 'done': - $done = changeDataInFile(getConfig('CACHE_PATH') . 'config-local.php', 'ADMIN-SETUP', "setConfigEntry('ADMIN_REGISTERED', '", "');", 'Y', 0); + $done = changeDataInInclude(getCachePath() . 'config-local.php', 'ADMIN-SETUP', "setConfigEntry('ADMIN_REGISTERED', '", "');", 'Y', 0); if ($done === true) { // Registering is done redirectToUrl('modules.php?module=admin&register=done'); @@ -186,7 +184,7 @@ if (!isAdminRegistered()) { ); // Validation okay so display form for final password change - loadTemplate('admin_reset_password_form', false, $content); + loadTemplate('form_reset_password_form', false, $content); } else { // Cannot validate the login data and hash loadTemplate('admin_settings_saved', false, '{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED--}'); @@ -195,7 +193,7 @@ if (!isAdminRegistered()) { // Okay, we shall the admin password here. So first revalidate the hash if (adminResetValidateHashLogin(postRequestParameter('hash'), postRequestParameter('login'))) { // Output result - loadTemplate('admin_reset_pass_done', false, doResetAdminPassword(postRequestParameter('login'), postRequestParameter('pass1'))); + loadTemplate('form_reset_pass_done', false, doResetAdminPassword(postRequestParameter('login'), postRequestParameter('pass1'))); } else { // Validation failed loadTemplate('admin_settings_saved', false, '{--ADMIN_VALIDATION_RESET_LOGIN_HASH_FAILED2--}'); @@ -217,13 +215,13 @@ if (!isAdminRegistered()) { } // END - if // Check if the admin has submitted data or not - if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('pass')) || (strlen(postRequestParameter('pass')) < 4))) { + if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('password')) || (strlen(postRequestParameter('password')) < 4))) { setPostRequestParameter('ok', '***'); } // END - if if ((isFormSent()) && (postRequestParameter('ok') != '***')) { // All required data was entered so we check his account - $ret = ifAdminLoginDataIsValid(postRequestParameter('login'), postRequestParameter('pass')); + $ret = ifAdminLoginDataIsValid(postRequestParameter('login'), postRequestParameter('password')); // Which status do we have? switch ($ret) { @@ -251,7 +249,7 @@ if (!isAdminRegistered()) { destroyAdminSession(); break; - case 'pass': // Wrong password + case 'password': // Wrong password setPostRequestParameter('ok', $ret); $ret = '{--WRONG_PASS--} [{--ADMIN_RESET_PASS--}]'; destroyAdminSession(); @@ -285,13 +283,13 @@ if (!isAdminRegistered()) { if ((!empty($ret)) && (postRequestParameter('ok') == '404')) $loginMessage = $ret; // No password entered? - if (!isPostRequestParameterSet('pass')) $passwdMessage = '{--ADMIN_NO_PASS--}'; + if (!isPostRequestParameterSet('password')) $passwdMessage = '{--ADMIN_NO_PASS--}'; // Or password too short? - if (strlen(postRequestParameter('pass')) < 4) $passwdMessage = '{--ADMIN_SHORT_PASS--}'; + if (strlen(postRequestParameter('password')) < 4) $passwdMessage = '{--ADMIN_SHORT_PASS--}'; // An error comes back from login? - if ((!empty($ret)) && (postRequestParameter('ok') == 'pass')) $passwdMessage = $ret; + if ((!empty($ret)) && (postRequestParameter('ok') == 'password')) $passwdMessage = $ret; // Load message template $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage); @@ -349,14 +347,14 @@ if (!isAdminRegistered()) { } } else { // Something went wrong here... - loadTemplate('admin_settings_saved', false, '
{--ADMIN_LOGOUT_FAILED--}
'); + loadTemplate('admin_settings_unsaved', false, '{--ADMIN_LOGOUT_FAILED--}'); // Add fatal message addFatalMessage(__FILE__, __LINE__, '{--CANNOT_UNREG_SESS--}'); } } else { // Maybe an Admin want's to login? - $ret = ifAdminCookiesAreValid(getSession('admin_id'), getSession('admin_md5')); + $ret = ifAdminCookiesAreValid(getCurrentAdminId(), getAdminMd5()); // Check status switch ($ret) { @@ -364,9 +362,6 @@ if (!isAdminRegistered()) { // Check for access control line of current menu entry 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'); - // Check for version and switch between old menu system and new intelligent menu system if ((adminGetMenuMode() == 'NEW') && (isIncludeReadable('inc/modules/admin/lasys-inc.php'))) { // Default area is the entrance, of course @@ -389,11 +384,11 @@ if (!isAdminRegistered()) { case '404': // Administrator login not found setPostRequestParameter('ok', $ret); - loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_ACCOUNT_404', getSession('admin_id'))); + loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_ACCOUNT_404', getCurrentAdminId())); destroyAdminSession(); break; - case 'pass': // Wrong password + case 'password': // Wrong password setPostRequestParameter('ok', $ret); loadTemplate('admin_settings_saved', false, '{--WRONG_PASS--}'); destroyAdminSession();