X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin.php;h=37f234633d8af064788daffe78fbde4d9ecea63a;hb=0dd42320430efb55daf522aec91d312b6d2fbc80;hp=84c86d8c028c89a9271f1e876938ed9558085309;hpb=414570c5081d337bb6c28dcf521bd8bca02f69e7;p=mailer.git diff --git a/inc/modules/admin.php b/inc/modules/admin.php index 84c86d8c02..37f234633d 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -10,10 +10,10 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Administrationsmodul * * -------------------------------------------------------------------- * - * $Revision:: 856 $ * - * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009) $ * + * $Revision:: $ * + * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * - * $Author:: stelzi $ * + * $Author:: $ * * Needs to be in all Files and every File needs "svn propset * * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * @@ -119,29 +119,32 @@ if (!isAdminRegistered()) { // Yet-another "Notice" fix if ((IS_FORM_SENT()) && (REQUEST_POST('ok') == "***")) { // No login entered? - if (!REQUEST_ISSET_POST(('login'))) $MSG1 = getMessage('ADMIN_NO_LOGIN'); + if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN'); // An error comes back from registration? - if (!empty($ret)) $MSG1 = $ret; + if (!empty($ret)) $loginMessage = $ret; // No password entered? - if (!REQUEST_ISSET_POST(('pass'))) $MSG2 = getMessage('ADMIN_NO_PASS'); + if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS'); // Or password too short? - if (strlen(REQUEST_POST('pass')) < 4) $MSG2 = getMessage('ADMIN_SHORT_PASS'); + if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS'); // Output error messages - define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1)); - define('__MSG_PASS', LOAD_TEMPLATE("admin_login_msg", true, $MSG2)); + define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage)); + define('__MSG_PASS', LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage)); // Reset variables - $MSG1 = ""; $MSG2 = ""; - } else { + $loginMessage = ""; $passwdMessage = ""; + } else { // Reset values to nothing define('__MSG_LOGIN', ""); define('__MSG_PASS' , ""); } + // Output message in seperate template + LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_NOT_REGISTERED')); + // Load register template LOAD_TEMPLATE("admin_reg_form"); } @@ -226,7 +229,7 @@ if (!isAdminRegistered()) { // 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'); + elseif (REQUEST_ISSET_GET('area')) $URL .= "area=".REQUEST_GET('area'); // Load URL LOAD_URL($URL); @@ -251,6 +254,7 @@ if (!isAdminRegistered()) { } // END - if // Error detected? + // @TODO Rewrite all these constants if ($ret != "done") { if (REQUEST_ISSET_POST(('login'))) { define('__LOGIN_VALUE', REQUEST_POST('login')); @@ -260,30 +264,31 @@ if (!isAdminRegistered()) { if (IS_FORM_SENT()) { // Set messages to zero - $MSG1 = ""; $MSG2 = ""; + $loginMessage = ""; $passwdMessage = ""; // No login entered? - if (!REQUEST_ISSET_POST(('login'))) $MSG1 = getMessage('ADMIN_NO_LOGIN'); + if (!REQUEST_ISSET_POST(('login'))) $loginMessage = getMessage('ADMIN_NO_LOGIN'); // An error comes back from login? - if ((!empty($ret)) && (REQUEST_POST('ok') == "404")) $MSG1 = $ret; + if ((!empty($ret)) && (REQUEST_POST('ok') == "404")) $loginMessage = $ret; // No password entered? - if (!REQUEST_ISSET_POST(('pass'))) $MSG2 = getMessage('ADMIN_NO_PASS'); + if (!REQUEST_ISSET_POST(('pass'))) $passwdMessage = getMessage('ADMIN_NO_PASS'); // Or password too short? - if (strlen(REQUEST_POST('pass')) < 4) $MSG2 = getMessage('ADMIN_SHORT_PASS'); + if (strlen(REQUEST_POST('pass')) < 4) $passwdMessage = getMessage('ADMIN_SHORT_PASS'); // An error comes back from login? - if ((!empty($ret)) && (REQUEST_POST('ok') == "pass")) $MSG2 = $ret; + if ((!empty($ret)) && (REQUEST_POST('ok') == "pass")) $passwdMessage = $ret; // Load message template - define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $MSG1)); - define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $MSG2)); + define('__MSG_LOGIN', LOAD_TEMPLATE("admin_login_msg", true, $loginMessage)); + define('__MSG_PASS' , LOAD_TEMPLATE("admin_login_msg", true, $passwdMessage)); // Reset variables - $MSG1 = ""; $MSG2 = ""; - } else { + unset($loginMessage); + unset($passwdMessage); + } else { // Set constants to empty for hiding them define('__MSG_LOGIN', ""); define('__MSG_PASS' , ""); @@ -301,7 +306,7 @@ if (!isAdminRegistered()) { // Set default values $content = array('target' => "action", 'value' => "login"); } - } elseif (REQUEST_ISSET_GET(('area'))) { + } elseif (REQUEST_ISSET_GET('area')) { // Restore old area value $content = array('target' => "area", 'value' => REQUEST_GET('area')); } else { @@ -322,9 +327,9 @@ if (!isAdminRegistered()) { // Special logout redirect for installation of given extension LOAD_TEMPLATE(sprintf("admin_logout_%s_install", $register)); - } elseif (REQUEST_ISSET_GET(('remove'))) { + } elseif (REQUEST_ISSET_GET('remove')) { // Secure input - $remove = REQUEST_GET(('remove')); + $remove = REQUEST_GET('remove'); // Special logout redirect for removal of given extension LOAD_TEMPLATE(sprintf("admin_logout_%s_remove", $remove)); @@ -357,7 +362,7 @@ if (!isAdminRegistered()) { $area = "entrance"; // Check for similar URL variable - if (REQUEST_ISSET_GET(('area'))) $area = REQUEST_GET(('area')); + if (REQUEST_ISSET_GET('area')) $area = REQUEST_GET('area'); // Load "logical-area menu-system" file LOAD_INC_ONCE("inc/modules/admin/lasys-inc.php"); @@ -366,7 +371,7 @@ if (!isAdminRegistered()) { ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']); } else { // This little call constructs the whole default old and lacky menu system - // on left side + // on left side. It also renders the content on right side ADMIN_DO_ACTION($GLOBALS['what']); } break;