X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_admins_acls.php;h=d0c7b35197eff5830ea6ec39c536049cd5144ff4;hp=69c9b1a67cd8fdbc74fd64c79765335bd2521a29;hb=61621983cc6d7195fcc7eab29b5f6080ff283b34;hpb=6c18a7bf8866b5ebdcb219891efaad99989a2cd5 diff --git a/inc/modules/admin/what-list_admins_acls.php b/inc/modules/admin/what-list_admins_acls.php index 69c9b1a67c..d0c7b35197 100644 --- a/inc/modules/admin/what-list_admins_acls.php +++ b/inc/modules/admin/what-list_admins_acls.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 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( @@ -66,11 +66,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections())) { ); // Load row template - $OUT .= loadTemplate('admin_edit_admins_acls_row', true, $content); + $OUT .= loadTemplate('admin_edit_admins_acls_row', TRUE, $content); } // END - foreach // Load main template - loadTemplate('admin_edit_admins_acls', false, $OUT); + loadTemplate('admin_edit_admins_acls', FALSE, $OUT); } elseif ((isFormSent('do_edit')) && (ifPostContainsSelections())) { // Change entries foreach (postRequestElement('sel') as $id => $selected) { @@ -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,25 +107,25 @@ 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']) . '--}'; // Load row template and switch colors - $OUT .= loadTemplate('admin_delete_admins_acls_row', true, $content); + $OUT .= loadTemplate('admin_delete_admins_acls_row', TRUE, $content); } // END - foreach // Load main template - loadTemplate('admin_delete_admins_acls', false, $OUT); + loadTemplate('admin_delete_admins_acls', FALSE, $OUT); } elseif ((isFormSent('do_delete')) && (ifPostContainsSelections())) { // 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 @@ -139,28 +139,28 @@ LIMIT 1", $mode = getAdminDefaultAcl(bigintval(postRequestElement('admin_id'))); // Default ACL is false - $ACL = false; + $ACL = FALSE; if (isPostRequestElementSet('what_menu')) { // Check parent ACL $ACL = isAdminsAllowedByAcl(getActionFromModuleWhat('admin', postRequestElement('what_menu')), ''); } // END - if - if (($mode != postRequestElement('do')) || (($ACL === true) && (postRequestElement('do') == 'deny'))) { + if (($mode != postRequestElement('do')) || (($ACL === TRUE) && (postRequestElement('do') == 'deny'))) { // Mode is fine $BOTH = ((isPostRequestElementSet('action_menu')) && (isPostRequestElementSet('what_menu')) && (postRequestElement('action_menu') != '') && (postRequestElement('what_menu') != '')); // Check if one has been selected - if ((((isPostRequestElementSet('action_menu')) && (postRequestElement('action_menu') != '')) || ((isPostRequestElementSet('what_menu')) && (postRequestElement('what_menu') != ''))) && ($BOTH === false)) { + 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,22 +214,22 @@ 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']) . '--}'; // Load row template and switch colors - $OUT .= loadTemplate('admin_list_admins_acls_row', true, $content); + $OUT .= loadTemplate('admin_list_admins_acls_row', TRUE, $content); } // END - while // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Load main template - loadTemplate('admin_list_admins_acls', false, $OUT); + loadTemplate('admin_list_admins_acls', FALSE, $OUT); } // END - if // Prepare some constants for the template @@ -238,7 +238,7 @@ ORDER BY $content['what_selection'] = adminMenuSelectionBox_DEPRECATED('what'); // Load template for adding new ACL - loadTemplate('admin_add_admins_acl', false, $content); + loadTemplate('admin_add_admins_acl', FALSE, $content); } // [EOF]