Updated copyright year.
[mailer.git] / inc / modules / admin / what-list_admins_acls.php
index 1c1704a93a6b11c184f3c3c380209882e457e5e0..d0c7b35197eff5830ea6ec39c536049cd5144ff4 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -48,14 +48,14 @@ if ((isFormSent('edit')) && (ifPostContainsSelections())) {
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $selected) {
                // Load data for the id
-               $result = SQL_QUERY_ESC("SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
+               $result = sqlQueryEscaped("SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
 
                // Load all data
-               $content = SQL_FETCHARRAY($result);
+               $content = sqlFetchArray($result);
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Prepare data for the row template
                $content = array(
@@ -78,7 +78,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections())) {
                $id = bigintval($id);
 
                // Update entries
-               SQL_QUERY_ESC("UPDATE
+               sqlQueryEscaped("UPDATE
        `{?_MYSQL_PREFIX?}_admins_acls`
 SET
        `admin_id`=%s,
@@ -107,10 +107,10 @@ LIMIT 1",
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $selected) {
                // Load data for the id
-               $result = SQL_QUERY_ESC("SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
+               $result = sqlQueryEscaped("SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
-               $content = SQL_FETCHARRAY($result);
-               SQL_FREERESULT($result);
+               $content = sqlFetchArray($result);
+               sqlFreeResult($result);
 
                // Get admin mode
                $content['access_mode'] = '{--ADMIN_ADMINS_ACCESS_MODE_' . strtoupper($content['access_mode']) . '--}';
@@ -125,7 +125,7 @@ LIMIT 1",
        // Remove entries
        // @TODO Rewrite this to filter 'run_sqls'
        foreach (postRequestElement('sel') as $id => $selected) {
-               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
+               sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)),__FILE__, __LINE__);
        } // END - foreach
 
@@ -152,15 +152,15 @@ LIMIT 1",
                // Check if one has been selected
                if ((((isPostRequestElementSet('action_menu')) && (postRequestElement('action_menu') != '')) || ((isPostRequestElementSet('what_menu')) && (postRequestElement('what_menu') != ''))) && ($BOTH === FALSE)) {
                        // 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",
+                       $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `admin_id`=%s AND `action_menu`='%s' AND `what_menu`='%s' LIMIT 1",
                                array(
                                        bigintval(postRequestElement('admin_id')),
                                        postRequestElement('action_menu'),
                                        postRequestElement('what_menu')
                                ), __FILE__, __LINE__);
-                       if (SQL_HASZERONUMS($result)) {
+                       if (ifSqlHasZeroNumRows($result)) {
                                // Finally add the new ACL
-                               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (
+                               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (
        `admin_id`,
        `action_menu`,
        `what_menu`,
@@ -187,7 +187,7 @@ LIMIT 1",
                        }
 
                        // Free memory
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
                } else {
                        // No menu selected makes also no sence...
                        $content = '{--ADMIN_ADMINS_SELECT_ACTION_WHAT--}';
@@ -201,7 +201,7 @@ LIMIT 1",
        displayMessage($content);
 } else {
        // List all ACLs
-       $result = SQL_QUERY('SELECT
+       $result = sqlQuery('SELECT
        `id`,
        `admin_id`,
        `action_menu`,
@@ -214,10 +214,10 @@ ORDER BY
        `id` ASC', __FILE__, __LINE__);
 
        // Entries found?
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List ACLs
                $OUT = '';
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Generate mode string
                        $content['access_mode'] = '{--ADMIN_ADMINS_ACCESS_MODE_' . strtoupper($content['access_mode']) . '--}';
 
@@ -226,7 +226,7 @@ ORDER BY
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load main template
                loadTemplate('admin_list_admins_acls', FALSE, $OUT);