* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team *
* For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
$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(
);
// 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) {
$id = bigintval($id);
// Update entries
- SQL_QUERY_ESC("UPDATE
+ sqlQueryEscaped("UPDATE
`{?_MYSQL_PREFIX?}_admins_acls`
SET
`admin_id`=%s,
$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
$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 (ifSqlHasZeroNums($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`,
}
// Free memory
- SQL_FREERESULT($result);
+ sqlFreeResult($result);
} else {
// No menu selected makes also no sence...
$content = '{--ADMIN_ADMINS_SELECT_ACTION_WHAT--}';
displayMessage($content);
} else {
// List all ACLs
- $result = SQL_QUERY('SELECT
+ $result = sqlQuery('SELECT
`id`,
`admin_id`,
`action_menu`,
`id` ASC', __FILE__, __LINE__);
// Entries found?
- if (!SQL_HASZERONUMS($result)) {
+ if (!ifSqlHasZeroNums($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
$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]