Changeset 17943
- Timestamp:
- 10/06/08 10:02:59 (2 months ago)
- Files:
-
- trunk/midcom/midcom.core/midcom/services/auth.php (modified) (2 diffs)
- trunk/midcom/midcom.core/midcom/services/toolbars.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/services/auth.php
r17900 r17943 879 879 { 880 880 debug_push_class(__CLASS__, __FUNCTION__); 881 debug_add("Querying privilege {$privilege} for user {$user->id} to class {$class}", MIDCOM_LOG_DEBUG); 881 882 if (is_object($class)) 883 { 884 $classname = get_class($class); 885 } 886 else 887 { 888 $classname = $class; 889 } 890 891 debug_add("Querying privilege {$privilege} for user {$user->id} to class {$classname}", MIDCOM_LOG_DEBUG); 882 892 debug_pop(); 883 893 } … … 901 911 if ($class !== null) 902 912 { 903 if (!class_exists($class)) 904 { 905 if ( is_null($component) 906 || !$_MIDCOM->componentloader->load_graceful($component)) 913 if (!is_object($class)) 914 { 915 if (!class_exists($class)) 907 916 { 908 debug_push_class(__CLASS__, __FUNCTION__); 909 debug_add("can_user_do check to undefined class '{$class}'.", MIDCOM_LOG_ERROR); 910 debug_pop(); 911 return false; 917 if ( is_null($component) 918 || !$_MIDCOM->componentloader->load_graceful($component)) 919 { 920 debug_push_class(__CLASS__, __FUNCTION__); 921 debug_add("can_user_do check to undefined class '{$class}'.", MIDCOM_LOG_ERROR); 922 debug_pop(); 923 return false; 924 } 912 925 } 913 } 914 $tmp_object = new $class(); 926 927 $tmp_object = new $class(); 928 } 929 else 930 { 931 $tmp_object = $class; 932 } 915 933 $this->_load_class_magic_privileges($tmp_object); 916 934 } trunk/midcom/midcom.core/midcom/services/toolbars.php
r17753 r17943 91 91 parent::__construct(); 92 92 93 // FIXME: initialize() should be called by the callee, not here in constructor 93 94 $this->initialize(); 94 95 } … … 118 119 119 120 if ( !$GLOBALS['midcom_config']['toolbars_enable_centralized'] 120 || !$_MIDCOM->auth->can_user_do('midcom:centralized_toolbar', null, 'midcom_services_toolbars'))121 || !$_MIDCOM->auth->can_user_do('midcom:centralized_toolbar', null, $this)) 121 122 { 122 123 $still_initializing = false; … … 124 125 } 125 126 126 if ($_MIDCOM->auth->can_user_do('midcom:ajax', null, 'midcom_services_toolbars'))127 if ($_MIDCOM->auth->can_user_do('midcom:ajax', null, $this)) 127 128 { 128 129 $_MIDCOM->enable_jquery();
