Mailer project continued:
[mailer.git] / inc / modules / admin / admin-inc.php
index 2e47837431641f431c3e483a6c55638377c51bde..10afaf399b09ca8333cbc5c74e11be439638d219 100644 (file)
@@ -52,7 +52,7 @@ function addAdminAccount ($adminLogin, $passHash, $adminEmail) {
        // Is the entry there?
        if (SQL_HASZERONUMS($result)) {
                // Ok, let's create the admin login
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins` (`login`,`password`,`email`) VALUES ('%s', '%s', '%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins` (`login`, `password`, `email`) VALUES ('%s', '%s', '%s')",
                        array(
                                $adminLogin,
                                $passHash,
@@ -512,7 +512,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
        $what = "`what` != '' AND `what` IS NOT NULL";
        if ($mode == 'action') $what = "(`what`='' OR `what` IS NULL) AND `action` != 'login'";
 
-       $result = SQL_QUERY_ESC("SELECT `%s` AS `menu`,`title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
+       $result = SQL_QUERY_ESC("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {
                // Load menu as selection
@@ -629,7 +629,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                } // END - foreach
 
                // Add both in one line
-               $keys   = implode('`,`', $keys);
+               $keys   = implode('`, `', $keys);
                $values = implode(', ' , $values);
 
                // Generate SQL string
@@ -1101,7 +1101,7 @@ function sendAdminPasswordResetLink ($email) {
        $OUT = '';
 
        // Look up administator login
-       $result = SQL_QUERY_ESC("SELECT `id`,`login`,`password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE '%s' REGEXP `email` LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id`, `login`, `password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE '%s' REGEXP `email` LIMIT 1",
                array($email), __FUNCTION__, __LINE__);
 
        // Is there an account?
@@ -1139,7 +1139,7 @@ function adminResetValidateHashLogin ($hash, $login) {
        $valid = false;
 
        // Then try to find that user
-       $result = SQL_QUERY_ESC("SELECT `id`,`password`,`email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
+       $result = SQL_QUERY_ESC("SELECT `id`, `password`, `email` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `login`='%s' LIMIT 1",
                array($login), __FUNCTION__, __LINE__);
 
        // Is an account here?
@@ -1312,9 +1312,6 @@ function doVerifyExpertSettings () {
 
                                                // Change it in the admin
                                                adminsChangeAdminAccount($postData, 'expert_warning');
-
-                                               // Clear form
-                                               unsetPostRequestElement('ok');
                                        } // END - if
 
                                        // All fine!
@@ -1330,6 +1327,13 @@ function doVerifyExpertSettings () {
                                // Do not display
                                $return = 'agreed';
                        }
+
+                       // Is a form sent?
+                       if ((isFormSent()) && (isPostRequestElementSet('expert_settings'))) {
+                               // Clear form
+                               unsetPostRequestElement('ok');
+                               unsetPostRequestElement('expert_settings');
+                       } // END - if
                } else {
                        // Forbidden
                        $return = 'forbidden';