Changeset 27038
- Timestamp:
- Jan 29, 2014, 4:17:51 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/community/main.inc.php
r26592 r27038 207 207 208 208 209 add_event_handler('ws_ invoke_allowed', 'community_switch_user_to_admin', EVENT_HANDLER_PRIORITY_NEUTRAL, 3);210 function community_switch_user_to_admin($ res, $methodName, $params)209 add_event_handler('ws_add_methods', 'community_switch_user_to_admin', EVENT_HANDLER_PRIORITY_NEUTRAL+5); 210 function community_switch_user_to_admin($arr) 211 211 { 212 212 global $user, $community; 213 213 214 $service = &$arr[0]; 215 214 216 if (is_admin()) 215 217 { 216 return $res;217 } 218 219 $community = array('method' => $ methodName);218 return; 219 } 220 221 $community = array('method' => $_REQUEST['method']); 220 222 221 223 if ('pwg.images.addSimple' == $community['method']) 222 224 { 223 $community['category'] = $ params['category'];225 $community['category'] = $_REQUEST['category']; 224 226 } 225 227 elseif ('pwg.images.add' == $community['method']) 226 228 { 227 $community['category'] = $ params['categories'];228 $community['md5sum'] = $ params['original_sum'];229 $community['category'] = $_REQUEST['categories']; 230 $community['md5sum'] = $_REQUEST['original_sum']; 229 231 } 230 232 … … 239 241 if (count($user_permissions['upload_categories']) == 0 and !$user_permissions ['create_whole_gallery']) 240 242 { 241 return $res;243 return; 242 244 } 243 245 … … 254 256 $methods[] = 'pwg.images.setInfo'; 255 257 256 if (in_array($ methodName, $methods))258 if (in_array($community['method'], $methods)) 257 259 { 258 260 $user['status'] = 'admin'; 259 261 } 260 262 261 if ('pwg.categories.add' == $ methodName)262 { 263 if (in_array($ params['parent'], $user_permissions['create_categories'])263 if ('pwg.categories.add' == $community['method']) 264 { 265 if (in_array($_REQUEST['parent'], $user_permissions['create_categories']) 264 266 or $user_permissions['create_whole_gallery']) 265 267 { … … 268 270 } 269 271 270 return $res;272 return; 271 273 } 272 274
Note: See TracChangeset
for help on using the changeset viewer.