]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_admins.php
Rewrites/fixes for handling config entries in SQLs
[mailer.git] / inc / modules / admin / what-config_admins.php
index 6040a1f3addf9ae893b2ee5b8a27db7933bd82ff..99d8f8a3ad6e7bea8f65356c53c02ad1071b3081 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -44,7 +45,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
 
-if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (countPostSelection() > 0)) {
        // Edit ACLs
        $OUT = ''; $SW = 2;
        foreach (postRequestParameter('sel') as $id => $selected) {
@@ -79,7 +80,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
 
        // Load main template
        loadTemplate('admin_config_admins_edit', false, $OUT);
-} elseif ((isPostRequestParameterSet('change')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('change')) && (countPostSelection() > 0)) {
        // Change entries
        foreach (postRequestParameter('sel') as $id => $selected) {
                // Secure id
@@ -103,7 +104,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
 
        // Entries changed
        loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_CHANGED'));
-} elseif ((isPostRequestParameterSet('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
        // Delete ACLs
        $OUT = ''; $SW = 2;
        foreach (postRequestParameter('sel') as $id => $selected) {
@@ -140,7 +141,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
 
        // Load main template
        loadTemplate('admin_config_admins_del', false, $OUT);
-} elseif ((isPostRequestParameterSet('remove')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('remove')) && (countPostSelection() > 0)) {
        // Remove entries
        // @TODO Rewrite this to filter 'run_sqls'
        foreach (postRequestParameter('sel') as $id => $selected) {
@@ -155,7 +156,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
 
        // Entries deleted
        loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ADMINS_ENTRIES_DELETED'));
-} elseif (isPostRequestParameterSet('add')) {
+} elseif (isFormSent('add')) {
        // Check if everything is fine...
        $mode = getAdminDefaultAcl(bigintval(postRequestParameter('admin_id')));
 
@@ -173,7 +174,7 @@ if ((isPostRequestParameterSet('edit')) && (countPostSelection() > 0)) {
                        // Main or sub menu selected
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE admin_id=%s AND action_menu='%s' AND what_menu='%s' LIMIT 1",
                                array(bigintval(postRequestParameter('admin_id')), postRequestParameter('action_menu'), postRequestParameter('what_menu')), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == '0') {
+                       if (SQL_HASZERONUMS($result)) {
                                // Finally add the new ACL
                                SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (admin_id, action_menu, what_menu, access_mode)
 VALUES ('%s','%s','%s','%s')",