Access level extension inclusions only for active extensions.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 28 Sep 2009 14:52:43 +0000 (14:52 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 28 Sep 2009 14:52:43 +0000 (14:52 +0000)
includes/access_levels.inc

index 3c60a0922a83a308498896ac2fc63b4cf2314ded..a61d4b3b8ab58e8677db2c8eb819502d2a02a8ac 100644 (file)
@@ -246,10 +246,10 @@ function add_access_extensions()
        global $path_to_root, $security_areas, $security_sections;
        
        // Add extension private access levels
-       include($path_to_root.'/installed_extensions.php');
+       include($path_to_root.'/company/'.user_company().'/installed_extensions.php');
        foreach($installed_extensions as $ext) {
-               if (isset($ext['acc_file']))
-                       include_once($path_to_root.($ext['type'] == 'plugin' ? '/modules/':'/').$ext['path'].'/'.$ext['acc_file']);
+               if (@$ext['active'] && isset($ext['acc_file']))
+                       include($path_to_root.($ext['type'] == 'plugin' ? '/modules/':'/').$ext['path'].'/'.$ext['acc_file']);
        }
 }
 ?>
\ No newline at end of file