X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Fadmins_functions.php;h=663c0ab399cf58ad406ec3804edd61eb1eecceee;hb=f2edf32502b2774dc17ef419a2e6a1c60e361c0a;hp=f60eeac5f258035601441275eddc9240140c907b;hpb=a36ec5d82756cd4db92ce27b6acc42b8a01920ce;p=mailer.git diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index f60eeac5f2..663c0ab399 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -47,14 +47,14 @@ function isAdminsAllowedByAcl ($action, $what) { if (($action == 'login') || ($action == 'logout')) { // If action is login or logout allow allways! - return true; + return TRUE; } elseif (isset($GLOBALS[__FUNCTION__][$adminId][$action][$what])) { // If we have cache, use it return $GLOBALS[__FUNCTION__][$adminId][$action][$what]; } // But default result is failed - $GLOBALS[__FUNCTION__][$action][$what] = false; + $GLOBALS[__FUNCTION__][$action][$what] = FALSE; // Get admin's defult access right $default = getAdminDefaultAcl($adminId); @@ -68,7 +68,7 @@ function isAdminsAllowedByAcl ($action, $what) { $parent = isAdminsAllowedByAcl($parent_action, ''); } else { // Anything else is true! - $parent = false; + $parent = FALSE; } // Shall I test for a main or sub menu? (action or what?) @@ -102,7 +102,7 @@ function isAdminsAllowedByAcl ($action, $what) { } } elseif (!isExtensionActive('cache')) { // Extension ext-cache is absent, so load it from database - $result = false; + $result = FALSE; if (!empty($action)) { // Main menu $result = SQL_QUERY_ESC("SELECT `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `admin_id`=%s AND `action_menu`='%s' LIMIT 1", @@ -125,9 +125,9 @@ function isAdminsAllowedByAcl ($action, $what) { // Check ACL and (maybe) allow //* DEBUG: */ debugOutput('default='.$default.',acl_mode='.$aclMode.',parent='.intval($parent)); - if ((($default == 'allow') && ($aclMode != 'deny')) || (($default == 'deny') && ($aclMode == 'allow')) || ($parent === true) || (($default == 'NO-ACL') && ($aclMode == 'failed') && ($parent === false))) { + if ((($default == 'allow') && ($aclMode != 'deny')) || (($default == 'deny') && ($aclMode == 'allow')) || ($parent === TRUE) || (($default == 'NO-ACL') && ($aclMode == 'failed') && ($parent === FALSE))) { // Access is granted - $GLOBALS[__FUNCTION__][$adminId][$action][$what] = true; + $GLOBALS[__FUNCTION__][$adminId][$action][$what] = TRUE; } // END - if // Return value @@ -172,7 +172,7 @@ LIMIT 1", } // Change a lot admin account -function adminsChangeAdminAccount ($postData, $element = '', $displayMessage = true) { +function adminsChangeAdminAccount ($postData, $element = '', $displayMessage = TRUE) { // Begin the update $cache_update = '0'; $message = ''; @@ -298,7 +298,7 @@ LIMIT 1", } // END - foreach // Display message if not empty and allowed - if ((!empty($message)) && ($displayMessage === true)) { + if ((!empty($message)) && ($displayMessage === TRUE)) { // Display it displayMessage($message); } // END - if @@ -341,7 +341,7 @@ function adminsEditAdminAccount ($postData) { } // Load row template and switch color - $OUT .= loadTemplate('admin_edit_admins_row', true, $content); + $OUT .= loadTemplate('admin_edit_admins_row', TRUE, $content); } // END - if // Free result @@ -349,7 +349,7 @@ function adminsEditAdminAccount ($postData) { } // END - foreach // Load template - loadTemplate('admin_edit_admins', false, $OUT); + loadTemplate('admin_edit_admins', FALSE, $OUT); } // Generate access mode selection box for given admin id @@ -407,7 +407,7 @@ function generateAdminMenuModeSelectionBox ($adminId = NULL) { // Delete given admin accounts function adminsDeleteAdminAccount ($postData) { // Check if this account is the last one which cannot be deleted... - if (countSumTotalData('', 'admins', 'id', '', true) > 1) { + if (countSumTotalData('', 'admins', 'id', '', TRUE) > 1) { // Delete accounts $OUT = ''; foreach ($postData['sel'] as $id => $selected) { @@ -429,7 +429,7 @@ function adminsDeleteAdminAccount ($postData) { $content['id'] = $id; // Load row template and switch color - $OUT .= loadTemplate('admin_delete_admins_row', true, $content); + $OUT .= loadTemplate('admin_delete_admins_row', TRUE, $content); } // END - if // Free result @@ -437,7 +437,7 @@ function adminsDeleteAdminAccount ($postData) { } // END - foreach // Load template - loadTemplate('admin_delete_admins', false, $OUT); + loadTemplate('admin_delete_admins', FALSE, $OUT); } else { // Cannot delete last account! displayMessage('{--ADMIN_ADMINS_CANNOT_DELETE_LAST--}'); @@ -488,14 +488,14 @@ ORDER BY $content['la_mode'] = '{--ADMIN_ADMINS_LA_MODE_' . strtoupper($content['la_mode']) . '--}'; // Load row template and switch color - $OUT .= loadTemplate('admin_list_admins_row', true, $content); + $OUT .= loadTemplate('admin_list_admins_row', TRUE, $content); } // END - while // Free memory SQL_FREERESULT($result); // Load template - loadTemplate('admin_list_admins', false, $OUT); + loadTemplate('admin_list_admins', FALSE, $OUT); } // Sends out mail to all administrators @@ -532,7 +532,7 @@ function sendAdminsEmails ($subject, $template, $content, $userid) { SQL_FREERESULT($result); // Init result - $result = false; + $result = FALSE; // "implode" ids and query string $adminId = implode(',', $adminIds); @@ -735,5 +735,10 @@ function isAdminsExpertWarningEnabled () { return (getAminsExpertWarning() == 'Y'); } +// Wrapper function to check whether expert setting is enabled +function isAdminsExpertSettingEnabled () { + return (getAminsExpertSettings() == 'Y'); +} + // [EOF] ?>