Changeset 1166 in ExiteCMS for trunk/administration/modules.php


Ignore:
Timestamp:
12/10/07 00:04:23 (4 years ago)
Author:
hverton
Message:

fixed modules.php, when upgrading a module the admin icon in the module directory wasn't checked
groupnames array in user_groups.php now uses getusergroups()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/modules.php

    r1158 r1166  
    290290    $data = dbarray($result); 
    291291 
    292     // load the module installer to start deinstallation 
     292    // load the module installer to start the upgrade 
    293293    include PATH_MODULES.$data['mod_folder']."/module_installer.php"; 
    294294 
     
    303303 
    304304        // check if an icon for the admin panel is defined, If not, use the modules and plugins default icon 
    305         if ($mod_admin_image == "" || !file_exists(PATH_ADMIN."images/".$mod_admin_image)) $mod_admin_image = "modules_panel.gif"; 
     305        if ($mod_admin_image == "" || (!file_exists(PATH_MODULES.$mod_folder."/images/".$mod_admin_image) && !file_exists(PATH_ADMIN."images/".$mod_admin_image))) $mod_admin_image = "modules_panel.gif"; 
    306306 
    307307        // check if the admin panel is already defined 
     
    314314            $result = dbquery("UPDATE ".$db_prefix."admin SET admin_rights = '".$mod_admin_rights."', admin_image = '$mod_admin_image', admin_title = '$mod_title', admin_page = '".$mod_admin_page."' WHERE admin_link = '".MODULES."$mod_folder/$mod_admin_panel'"); 
    315315        } 
     316        // make sure superadmins have rights to all defined admin modules 
     317        $result2 = dbquery("SELECT admin_rights FROM ".$db_prefix."admin"); 
     318        $adminrights = ""; 
     319        while ($data2 = dbarray($result2)) { 
     320            $adminrights .= ($adminrights == "" ? "" : ".") . $data2['admin_rights']; 
     321        } 
     322        $result2 = dbquery("UPDATE ".$db_prefix."users SET user_rights = '".$adminrights."' WHERE user_level = 103"); 
    316323    } 
    317324 
Note: See TracChangeset for help on using the changeset viewer.