]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin.php
Functions for handling INC_POOL moved to inc-functions.php, plus some extra functions...
[mailer.git] / inc / modules / admin.php
index 98fdb7947e1d5b68df5854c9e08b35afa0ed437f..37f234633d8af064788daffe78fbde4d9ecea63a 100644 (file)
@@ -10,7 +10,7 @@
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Administrationsmodul                             *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
+ * $Revision::                                                        $ *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
@@ -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;