Restore of the 4 include files in types.inc
[fa-stable.git] / includes / current_user.inc
index 77e8dc3e471707e139509000211a9548ccc27017..5430b1104c2eb1d59b1ae31df94f364a0901bf1b 100644 (file)
@@ -64,8 +64,9 @@ class current_user
                if (db_num_rows($Auth_Result) > 0)
                {
                        $myrow = db_fetch($Auth_Result);
+                       $this->old_db = isset($myrow["full_access"]);
                        if (! @$myrow["inactive"]) {
-                               if (isset($myrow["full_access"])) { 
+                               if ($this->old_db) { 
                                        // Transition code:
                                        // db was not yet upgraded after source update to v.2.2
                                        // give enough access for admin user to continue upgrade
@@ -115,15 +116,14 @@ class current_user
        function check_user_access()
        {
                global $security_groups;
-               if (isset($security_groups)) {
+               if ($this->old_db) {
                        // notification after upgrade from pre-2.2 version
-//                     display_notification(_("After database upgrade don't forget to remove \$security_groups and \$security_headings from config.php file!"));
-                       return is_array(@$security_groups[$this->access]);
+                       return isset($security_groups) && is_array(@$security_groups[$this->access]);
                } else
-                       return is_array($this->role_set);
+                       return !isset($security_groups) && is_array($this->role_set);
        }
 
-       function can_access_page($page_level)
+       function can_access($page_level)
        {
                global $security_groups, $security_areas;
 
@@ -140,6 +140,11 @@ class current_user
                        && ($this->company == 0 || ($code&~0xff != SS_SADMIN));
        }
 
+       function can_access_page($page_level)
+       {
+               return $this->can_access($page_level);
+       }
+
        function get_db_connection()
        {
        global $db_connections;