Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / admin.php
index 518ed798387313497f067cb986f463ccfa188ae1..b9578683dd45dc676848432c5aade2730492d51e 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -37,7 +37,7 @@
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       die();
+       exit();
 } // END - if
 
 // Load include file
@@ -234,10 +234,10 @@ if (!isAdminRegistered()) {
 
        // Check if the admin has submitted data or not
        if ((isFormSent()) && ((!isPostRequestElementSet('admin_login')) || (!isPostRequestElementSet('admin_password')) || (strlen(postRequestElement('admin_password')) < getConfig('minium_admin_pass_length')))) {
-               setPostRequestElement('ok', '***');
+               setPostRequestElement('login', '***');
        } // END - if
 
-       if ((isFormSent()) && (postRequestElement('ok') != '***')) {
+       if ((isFormSent('login')) && (postRequestElement('login') != '***')) {
                // All required data was entered so we check his account
                $ret = ifAdminLoginDataIsValid(postRequestElement('admin_login'), postRequestElement('admin_password'));
 
@@ -249,13 +249,13 @@ if (!isAdminRegistered()) {
                                break;
 
                        case '404': // Administrator login not found
-                               setPostRequestElement('ok', $ret);
+                               setPostRequestElement('login', $ret);
                                $ret = '{%message,ADMIN_ACCOUNT_404=' . postRequestElement('admin_login') . '%}';
                                destroyAdminSession();
                                break;
 
                        case 'password': // Wrong password
-                               setPostRequestElement('ok', $ret);
+                               setPostRequestElement('login', $ret);
                                $ret = '{--WRONG_PASS--} [<a href="{%url=modules.php?module=admin&amp;reset_pass=1%}">{--ADMIN_RESET_PASS--}</a>]';
                                destroyAdminSession();
                                break;
@@ -277,7 +277,7 @@ if (!isAdminRegistered()) {
                $content['login_message'] = '';
                $content['pass_message']  = '';
 
-               if (isFormSent()) {
+               if (isFormSent('login')) {
                        // Set messages to zero
                        $loginMessage = '';
                        $passwdMessage = '';
@@ -286,7 +286,7 @@ if (!isAdminRegistered()) {
                        if (!isPostRequestElementSet('admin_login')) {
                                // No login entered?
                                $loginMessage = '{--ADMIN_NO_LOGIN--}';
-                       } elseif ((!empty($ret)) && (postRequestElement('ok') == '404')) {
+                       } elseif ((!empty($ret)) && (postRequestElement('login') == '404')) {
                                // An error comes back from login?
                                $loginMessage = $ret;
                        }
@@ -298,7 +298,7 @@ if (!isAdminRegistered()) {
                        } elseif (strlen(postRequestElement('admin_password')) < getConfig('minium_admin_pass_length')) {
                                // Or password too short?
                                $passwdMessage = '{--ADMIN_SHORT_PASS--}';
-                       } elseif ((!empty($ret)) && (postRequestElement('ok') == 'password')) {
+                       } elseif ((!empty($ret)) && (postRequestElement('login') == 'password')) {
                                // An error comes back from login?
                                $passwdMessage = $ret;
                        }
@@ -356,33 +356,29 @@ if (!isAdminRegistered()) {
                        runFilterChain('check_admin_acl');
 
                        // 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
-                               $area = 'entrance';
-
-                               // Check for similar URL variable
-                               if (isGetRequestElementSet('area')) $area = getRequestElement('area');
-
-                               // Load logical-area menu-system file
-                               loadIncludeOnce('inc/modules/admin/lasys-inc.php');
+                       if (adminGetMenuMode() == 'NEW') {
+                               // Load include for admin AJAX
+                               loadIncludeOnce('inc/ajax/ajax_admin.php');
 
-                               // Create new-style menu system will logical areas
-                               doAdminLogicalArea($area, $action, getWhat());
+                               // Load main template
+                               loadTemplate('admin_ajax_main');
                        } else {
-                               // This little call constructs the whole default old and lacky menu system
-                               // on left side. It also renders the content on right side
+                               /*
+                                * This little call constructs the whole default old and lacky menu system
+                                * on left side. It also renders the content on right side
+                                */
                                doAdminAction();
                        }
                        break;
 
                case '404': // Administrator login not found
-                       setPostRequestElement('ok', $ret);
+                       setPostRequestElement('login', $ret);
                        displayMessage('{%message,ADMIN_ACCOUNT_404=' . getCurrentAdminId() . '%}');
                        destroyAdminSession();
                        break;
 
                case 'password': // Wrong password
-                       setPostRequestElement('ok', $ret);
+                       setPostRequestElement('login', $ret);
                        displayMessage('{--WRONG_PASS--}');
                        destroyAdminSession();
                        break;