Changeset 11931
- Timestamp:
- 08/31/07 00:14:50 (1 year ago)
- Files:
-
- trunk/midcom/midcom.core/midcom.php (modified) (1 diff)
- trunk/midcom/midcom.core/midcom/helper/_componentloader.php (modified) (2 diffs)
- trunk/midcom/midcom.core/midcom/services/auth.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom.php
r11916 r11931 112 112 require('midcom/baseclasses/components/purecode.php'); 113 113 require('midcom/baseclasses/components/request.php'); 114 //require('midcom/baseclasses/components/request_admin.php');115 114 116 115 // Note, that the legacy MidCOM base classes are loaded at the end of this file, trunk/midcom/midcom.core/midcom/helper/_componentloader.php
r11900 r11931 691 691 function load_all_manifests() 692 692 { 693 debug_push_class(__CLASS__, __FUNCTION__);694 695 693 $cache_identifier = $_MIDCOM->cache->phpscripts->create_identifier('midcom.componentloader', 'manifests'); 696 694 … … 706 704 if (! $cache_hit) 707 705 { 708 debug_add('We generate the class manifest cache now.'); 706 debug_push_class(__CLASS__, __FUNCTION__); 707 debug_add('Cache miss, generating component manifest cache now.'); 709 708 $this->_generate_class_manifest_cache($cache_identifier); 710 } 711 else 712 { 713 debug_add('We could load the manifests from the cache, so we are fine now.'); 714 } 715 716 debug_pop(); 709 debug_pop(); 710 } 717 711 } 718 712 trunk/midcom/midcom.core/midcom/services/auth.php
r11903 r11931 585 585 if (! $this->_auth_backend->read_login_session()) 586 586 { 587 debug_push_class(__CLASS__, __FUNCTION__);588 debug_add('The backend did not detect a running session, continuing in the previous authentication state.');589 debug_pop();590 587 return; 591 588 } … … 768 765 if (is_null($for_user)) 769 766 { 770 $privilege_key = "{$object_guid}-{$privilege}"; 767 $cache_key = "{$object_guid}"; 768 $privilege_key = "{$cache_key}-{$privilege}"; 771 769 } 772 770 else … … 774 772 if (is_string($for_user)) 775 773 { 776 $privilege_key = "{$for_user}-{$object_guid}-{$privilege}"; 774 $cache_key = "{$for_user}-{$object_guid}"; 775 $privilege_key = "{$cache_key}-{$privilege}"; 777 776 } 778 777 else 779 778 { 780 $privilege_key = "{$for_user->id}-{$object_guid}-{$privilege}"; 781 } 782 } 783 784 if (!array_key_exists($privilege_key, $cached_privileges)) 779 $cache_key = "{$for_user->id}-{$object_guid}"; 780 $privilege_key = "{$cache_key}-{$privilege}"; 781 } 782 } 783 784 if (!isset($cached_privileges[$privilege_key])) 785 785 { 786 786 debug_push_class(__CLASS__, __FUNCTION__); 787 debug_add("Cache miss, fetching privileges for {$object_guid}");787 debug_add("Cache {$privilege_key} miss, fetching privileges for {$object_guid}"); 788 788 debug_pop(); 789 789 $full_privileges = $this->get_privileges_byguid($object_guid, $object_class, $user); 790 790 foreach ($full_privileges as $priv => $value) 791 { 792 if ($value == MIDCOM_PRIVILEGE_ALLOW) 793 { 794 $cached_privileges["{$cache_key}-{$priv}"] = true; 795 } 796 else 797 { 798 $cached_privileges["{$cache_key}-{$priv}"] = false; 799 } 800 } 801 791 802 if (! array_key_exists($privilege, $full_privileges)) 792 803 { … … 796 807 return false; 797 808 } 798 799 if ($full_privileges[$privilege] == MIDCOM_PRIVILEGE_ALLOW) 800 { 801 $cached_privileges[$privilege_key] = true; 802 } 803 else 804 { 805 $cached_privileges[$privilege_key] = false; 806 } 807 } 808 debug_pop(); 809 } 810 809 811 return $cached_privileges[$privilege_key]; 810 812 } … … 993 995 if (empty($user)) 994 996 { 995 $cache_user_id = null;997 $cache_user_id = 'anonymous'; 996 998 } 997 999 else … … 1041 1043 debug_push_class(__CLASS__, __FUNCTION__); 1042 1044 debug_add('Failed to convert an object, falling back to an empty privilege set for the object in question. See debug level log for details.'); 1043 debug_print_r('Content object was:', $dummy_object_init);1044 1045 debug_pop(); 1045 1046 return Array(); … … 1060 1061 { 1061 1062 debug_push_class(__CLASS__, __FUNCTION__); 1062 debug_add(" cache miss for {$cache_id}");1063 debug_pop(); 1063 debug_add("Cache miss for {$cache_id}"); 1064 debug_pop(); 1064 1065 if ( is_object($user) 1065 1066 && method_exists($user, 'get_privileges')
