Ticket #1630: admin_access.patch

File admin_access.patch, 1.9 KB (added by Alexander Papst, 7 years ago)

Fehlerbehebung zum Ticket#1630

  • admin/includes/column_left.php

     
    1717   --------------------------------------------------------------*/
    1818defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' );
    1919
     20// Some plugins such as magnalister render the admin html inside of a function.
     21// So variables that are expected to have a global scope will have a local scope instead,
     22// if the file is included inside of a function.
     23// Annotate variables that are required to have a global scope as global even if they're
     24// usually included in a procedual fashion. This has no effect if the file is included
     25// in a global scope but fixes missing initialisations if the file is included inside
     26// of a function.
     27global $admin_access;
    2028$admin_access = array();
    2129if (($_SESSION['customers_status']['customers_status_id'] == '0')) {
    2230  $admin_access_query = xtc_db_query("SELECT * FROM " . TABLE_ADMIN_ACCESS . " WHERE customers_id = ".(int)$_SESSION['customer_id']);
  • admin/includes/extra_menu.php

     
    2525    function subMenue($admin_access_name = '', $filename = '', $linktext= '', $parameters = '', $ssl = 'NONSSL'){
    2626        global $admin_access;
    2727
    28         ## magnalister
    29         if (!is_array($admin_access) || count($admin_access) < 1) {
    30           $admin_access = array();
    31           if (($_SESSION['customers_status']['customers_status_id'] == '0')) {
    32             $admin_access_query = xtc_db_query("SELECT * FROM " . TABLE_ADMIN_ACCESS . " WHERE customers_id = ".(int)$_SESSION['customer_id']);
    33             $admin_access = xtc_db_fetch_array($admin_access_query);
    34           }
    35         }
    36         ## magnalister
    37 
    3828        $html = '';
    3929        if (isset($admin_access[$admin_access_name]) && $admin_access[$admin_access_name] == '1') {
    4030