Fixed modules/plugins security extensions inclusion.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 28 Sep 2009 20:29:04 +0000 (20:29 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 28 Sep 2009 20:29:04 +0000 (20:29 +0000)
includes/access_levels.inc
includes/session.inc

index a61d4b3b8ab58e8677db2c8eb819502d2a02a8ac..7eccf93d43356b59dc478f2c2002a81000854e9e 100644 (file)
@@ -235,21 +235,15 @@ $security_areas =array(
        'SA_BANKREP' => array(SS_GL_A|3, _("Bank reports and inquiries")),
        'SA_GLREP' => array(SS_GL_A|4, _("GL reports and inquiries")),
 );
-/*
-       This function should be called whenever we want to extend core access level system
-       with new security areas and/or sections i.e.: 
-       . on any page with non-standard security areas
-       . in security roles editor
-*/
+
 function add_access_extensions()
 {
-       global $path_to_root, $security_areas, $security_sections;
-       
-       // Add extension private access levels
-       include($path_to_root.'/company/'.user_company().'/installed_extensions.php');
+       global $path_to_root, $security_areas, $security_sections, $installed_extensions;
+
        foreach($installed_extensions as $ext) {
                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
index 19a0e4a66335a27edd064dd42ff969d7ba1d5c4f..89d8c333a25ace6ed4b18dae83da0a6c0b4cb59f 100644 (file)
@@ -236,7 +236,13 @@ if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){
                $_SESSION["App"]->init();
        }
 
-//----------------------------------------------------------------------------------------
+       /*
+       This call is necessary only at:
+       . on any page with non-standard security areas
+       . in security roles editor
+       To be optmized  after.
+       */
+       add_access_extensions();
 
        check_page_security($page_security);
 }