PluginProbe
User Access Manager / 1.2.3
User Access Manager v1.2.3
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / class / UamAccessHandler.class.php

UamAccessHandler.class.php in User Access Manager 1.2.3, at class/UamAccessHandler.class.php

775 lines 22.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * UamAccessHandler.class.php
4 *
5 * The UamUserGroup class file.
6 *
7 * PHP versions 5
8 *
9 * @category UserAccessManager
10 * @package UserAccessManager
11 * @author Alexander Schneider <alexanderschneider85@googlemail.com>
12 * @copyright 2008-2010 Alexander Schneider
13 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
14 * @version SVN: $Id$
15 * @link http://wordpress.org/extend/plugins/user-access-manager/
16 */
17
18 /**
19 * The access handler class.
20 *
21 * @category UserAccessManager
22 * @package UserAccessManager
23 * @author Alexander Schneider <alexanderschneider85@gmail.com>
24 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
25 * @link http://wordpress.org/extend/plugins/user-access-manager/
26 */
27
28 class UamAccessHandler
29 {
30 protected $_oUserAccessManager = null;
31 protected $_aObjectUserGroups = array();
32 protected $_aObjectAccess = array();
33 protected $_aUserGroups = array(
34 'filtered' => array(),
35 'noneFiltered' => array(),
36 );
37 protected $_aPlObjects = array();
38 protected $_aObjectTypes = array(
39 'category',
40 'user',
41 'role',
42 );
43 protected $_aPostableTypes = array(
44 'post',
45 'page',
46 'attachment',
47 );
48 protected $_aAllObjectTypes = null;
49 protected $_aSqlResults = array();
50
51 /**
52 * The constructor
53 *
54 * @param UserAccessManager $oUserAccessManager The user access manager object.
55 */
56 public function __construct(UserAccessManager $oUserAccessManager)
57 {
58 $this->_oUserAccessManager = $oUserAccessManager;
59
60 $aPostTypes = get_post_types(array(), 'objects');
61
62 foreach ($aPostTypes as $oPostType) {
63 if ($oPostType->publicly_queryable) {
64 $this->_aPostableTypes[] = $oPostType->name;
65 }
66 }
67
68 $this->_aObjectTypes = array_merge($this->_aPostableTypes, $this->_aObjectTypes);
69 }
70
71 /**
72 * Returns the user access manager object.
73 *
74 * @return UserAccessManager
75 */
76 public function &getUserAccessManager()
77 {
78 return $this->_oUserAccessManager;
79 }
80
81 /**
82 * Returns the predefined object types.
83 *
84 * @return array
85 */
86 public function getObjectTypes()
87 {
88 return $this->_aObjectTypes;
89 }
90
91 /**
92 * Returns the predefined object types.
93 *
94 * @return array;
95 */
96 public function getPostableTypes()
97 {
98 return $this->_aPostableTypes;
99 }
100
101 /**
102 * Returns all _aObjects types.
103 *
104 * @return array
105 */
106 public function getAllObjectTypes()
107 {
108 if (isset($this->_aAllObjectTypes)) {
109 return $this->_aAllObjectTypes;
110 }
111
112 $aPlObjects = $this->getPlObjects();
113
114 $this->_aAllObjectTypes = array_merge(
115 $this->_aObjectTypes,
116 array_keys($aPlObjects)
117 );
118
119 return $this->_aAllObjectTypes;
120 }
121
122 /**
123 * Magic method getter.
124 *
125 * @param string $sName The name of the function
126 * @param array $aArguments The arguments for the function
127 *
128 * @return mixed
129 */
130 public function __call($sName, $aArguments)
131 {
132 $oUserAccessManager = $this->getUserAccessManager();
133
134 if ($oUserAccessManager->startsWith($sName, 'getUserGroupsFor')) {
135 $sPrefix = 'getUserGroupsFor';
136 } elseif ($oUserAccessManager->startsWith($sName, 'checkAccessFor')) {
137 $sPrefix = 'checkAccessFor';
138 }
139
140 if (isset($sPrefix)) {
141 $sObjectType = str_replace($sPrefix, '', $sName);
142 $sObjectType = strtolower($sObjectType);
143
144 $iObjectId = $aArguments[0];
145
146 if ($sPrefix == 'getUserGroupsFor') {
147 return $this->getUserGroupsForObject($sObjectType, $iObjectId);
148 } elseif ($sPrefix == 'checkAccessFor') {
149 return $this->checkObjectAccess($sObjectType, $iObjectId);
150 }
151 }
152
153 return null;
154 }
155
156 /**
157 * Filter the user groups of an object if authors_can_add_posts_to_groups
158 * option is enabled
159 *
160 * @param UamUserGroup[] $aUserGroups The user groups.
161 *
162 * @return array
163 */
164 protected function _filterUserGroups($aUserGroups)
165 {
166 $aUamOptions = $this->getUserAccessManager()->getAdminOptions();
167
168 if ($aUamOptions['authors_can_add_posts_to_groups'] == 'true'
169 && !$this->checkUserAccess('manage_user_groups')
170 && $this->getUserAccessManager()->atAdminPanel()
171 ) {
172 global $current_user;
173 //Force user info
174 wp_get_current_user();
175
176 $aUserGroupsForUser = $this->getUserGroupsForObject('user', $current_user->ID);
177
178 foreach ($aUserGroups as $sKey => $oUamUserGroup) {
179 if (!array_key_exists($oUamUserGroup->getId(), $aUserGroupsForUser)) {
180 unset($aUserGroups[$sKey]);
181 }
182 }
183 }
184
185 return $aUserGroups;
186 }
187
188 /**
189 * Returns all user groups or one requested by the user group _iId.
190 *
191 * @param integer $iUserGroupId The _iId of the single user group which should be returned.
192 * @param boolean $blFilter Filter the groups.
193 *
194 * @return UamUserGroup[]|UamUserGroup
195 */
196 public function getUserGroups($iUserGroupId = null, $blFilter = true)
197 {
198 if ($blFilter) {
199 $sFilterAttr = 'filtered';
200 } else {
201 $sFilterAttr = 'noneFiltered';
202 }
203
204 if ($iUserGroupId === null
205 && $this->_aUserGroups[$sFilterAttr] != array()
206 ) {
207 return $this->_aUserGroups[$sFilterAttr];
208 } elseif ($iUserGroupId !== null
209 && $this->_aUserGroups[$sFilterAttr] != array()
210 ) {
211 if (isset($this->_aUserGroups[$sFilterAttr][$iUserGroupId])) {
212 return $this->_aUserGroups[$sFilterAttr][$iUserGroupId];
213 } else {
214 return null;
215 }
216 }
217
218 $this->_aUserGroups[$sFilterAttr] = array();
219
220 /**
221 * @var wpdb $wpdb
222 */
223 global $wpdb;
224
225 $aUserGroupsDb = $wpdb->get_results(
226 "SELECT ID
227 FROM " . DB_ACCESSGROUP . "
228 ORDER BY ID", ARRAY_A
229 );
230
231 if (isset($aUserGroupsDb)) {
232 foreach ($aUserGroupsDb as $aUserGroupDb) {
233 $this->_aUserGroups[$sFilterAttr][$aUserGroupDb['ID']] = new UamUserGroup($this, $aUserGroupDb['ID']);
234 }
235 }
236
237 //Filter the user groups
238 if ($blFilter) {
239 $this->_aUserGroups[$sFilterAttr] = $this->_filterUserGroups($this->_aUserGroups[$sFilterAttr]);
240 }
241
242 if ($iUserGroupId == null) {
243 return $this->_aUserGroups[$sFilterAttr];
244 } else {
245 if (isset($this->_aUserGroups[$sFilterAttr][$iUserGroupId])) {
246 return $this->_aUserGroups[$sFilterAttr][$iUserGroupId];
247 } else {
248 return null;
249 }
250 }
251 }
252
253 /**
254 * Adds a user group.
255 *
256 * @param UamUserGroup $oUserGroup The user group which we want to add.
257 *
258 * @return null
259 */
260 public function addUserGroup($oUserGroup)
261 {
262 $this->getUserGroups();
263 $this->_aUserGroups['noneFiltered'][$oUserGroup->getId()] = $oUserGroup;
264 $this->_aUserGroups['filtered'] = array();
265 }
266
267 /**
268 * Deletes a user group.
269 *
270 * @param integer $iUserGroupId The user group _iId which we want to delete.
271 *
272 * @return null
273 */
274 public function deleteUserGroup($iUserGroupId)
275 {
276 if ($this->getUserGroups($iUserGroupId) != null) {
277 $this->getUserGroups($iUserGroupId)->delete();
278 unset($this->_aUserGroups['noneFiltered'][$iUserGroupId]);
279 $this->_aUserGroups['filtered'] = array();
280 }
281 }
282
283 /**
284 * Returns the user groups for the given object.
285 *
286 * @param string $sObjectType The object type.
287 * @param integer $iObjectId The _iId of the object.
288 * @param boolean $blFilter Filter the groups.
289 *
290 * @return UamUserGroup[]
291 */
292 public function getUserGroupsForObject($sObjectType, $iObjectId, $blFilter = true)
293 {
294 if (!in_array($sObjectType, $this->getAllObjectTypes())) {
295 return array();
296 }
297
298 if ($sObjectType == 'user') {
299 $blFilter = false;
300 }
301
302 if ($blFilter) {
303 $sFilterAttr = 'filtered';
304 } else {
305 $sFilterAttr = 'noneFiltered';
306 }
307
308 if (isset($this->_aObjectUserGroups[$sObjectType][$sFilterAttr][$iObjectId])) {
309 return $this->_aObjectUserGroups[$sObjectType][$sFilterAttr][$iObjectId];
310 }
311
312 $aObjectUserGroups = array();
313 $aUserGroups = $this->getUserGroups(null, $blFilter);
314
315 /*$blPlObject = false;
316 $aPostableTypes = $this->getPostableTypes();
317
318 if (!in_array($sObjectType, $aPostableTypes)) {
319 $blPlObject = true;
320 }*/
321
322 $aCurIp = explode(".", $_SERVER['REMOTE_ADDR']);
323
324 if (isset($aUserGroups)) {
325 foreach ($aUserGroups as $oUserGroup) {
326 $mObjectMembership = $oUserGroup->objectIsMember($sObjectType, $iObjectId, true);
327
328 if ($mObjectMembership !== false
329 || $sObjectType == 'user'
330 && $this->checkUserIp($aCurIp, $oUserGroup->getIpRange())
331 ) {
332 if (is_array($mObjectMembership)) {
333 $oUserGroup->aSetRecursive[$sObjectType][$iObjectId] = $mObjectMembership;
334 }
335
336 $aObjectUserGroups[$oUserGroup->getId()] = $oUserGroup;
337 }
338 }
339 }
340
341 //Filter the user groups
342 if ($blFilter) {
343 $aObjectUserGroups = $this->_filterUserGroups($aObjectUserGroups);
344 }
345
346 $this->_aObjectUserGroups[$sObjectType][$sFilterAttr][$iObjectId] = $aObjectUserGroups;
347 return $this->_aObjectUserGroups[$sObjectType][$sFilterAttr][$iObjectId];
348 }
349
350 /**
351 * Unset the user groups for _aObjects.
352 *
353 * @return null
354 */
355 public function unsetUserGroupsForObject()
356 {
357 $this->_aObjectUserGroups = array();
358 }
359
360 /**
361 * Checks if the current_user has access to the given post.
362 *
363 * @param string $sObjectType The object type which should be checked.
364 * @param integer $iObjectId The _iId of the object.
365 *
366 * @return boolean
367 */
368 public function checkObjectAccess($sObjectType, $iObjectId)
369 {
370 if (!in_array($sObjectType, $this->getAllObjectTypes())) {
371 return true;
372 }
373
374 if (isset($this->_aObjectAccess[$sObjectType][$iObjectId])) {
375 return $this->_aObjectAccess[$sObjectType][$iObjectId];
376 }
377
378 global $current_user;
379 //Force user info
380 wp_get_current_user();
381
382 $aPostableTypes = $this->getPostableTypes();
383
384 if (in_array($sObjectType, $aPostableTypes)) {
385 $oPost = get_post($iObjectId);
386 $sAuthorId = $oPost->post_author;
387 } else {
388 $sAuthorId = -1;
389 }
390
391 $aUamOptions = $this->getUserAccessManager()->getAdminOptions();
392 $aMembership = $this->getUserGroupsForObject($sObjectType, $iObjectId, false);
393
394 if ($aMembership == array()
395 || $this->checkUserAccess('manage_user_groups')
396 || $current_user->ID == $sAuthorId
397 && $aUamOptions['authors_has_access_to_own'] == 'true'
398 ) {
399 return $this->_aObjectAccess[$sObjectType][$iObjectId] = true;
400 }
401
402 $aCurIp = explode(".", $_SERVER['REMOTE_ADDR']);
403
404 foreach ($aMembership as $sKey => $oUserGroup) {
405 if ($this->checkUserIp($aCurIp, $oUserGroup->getIpRange())
406 || $oUserGroup->objectIsMember('user', $current_user->ID)
407 ) {
408 return $this->_aObjectAccess[$sObjectType][$iObjectId] = true;
409 break;
410 }
411
412 if ($this->getUserAccessManager()->atAdminPanel() && $oUserGroup->getWriteAccess() == 'all'
413 || !$this->getUserAccessManager()->atAdminPanel() && $oUserGroup->getReadAccess() == 'all'
414 ) {
415 unset($aMembership[$sKey]);
416 }
417 }
418
419 if ($aMembership == array()) {
420 return $this->_aObjectAccess[$sObjectType][$iObjectId] = true;
421 }
422
423 return $this->_aObjectAccess[$sObjectType][$iObjectId] = false;
424 }
425
426
427 /*
428 * SQL functions.
429 */
430
431 /**
432 * Returns the user groups for the current user as sql string.
433 *
434 * @return string
435 */
436 protected function _getUserGroupsForUserAsSqlString()
437 {
438 if (isset($this->_aSqlResults['groupsForUser'])) {
439 return $this->_aSqlResults['groupsForUser'];
440 }
441
442 global $current_user;
443 //Force user info
444 wp_get_current_user();
445
446 $aUserUserGroups = $this->getUserGroupsForObject('user', $current_user->ID, false);
447 $aUserUserGroupIds = array();
448
449 foreach ($aUserUserGroups as $oUserUserGroup) {
450 $aUserUserGroupIds[] = $oUserUserGroup->getId();
451 }
452
453 if ($aUserUserGroupIds !== array()) {
454 $sUserUserGroups = implode(', ', $aUserUserGroupIds);
455 } else {
456 $sUserUserGroups = "''";
457 }
458
459 $this->_aSqlResults['groupsForUser'] = $sUserUserGroups;
460 return $this->_aSqlResults['groupsForUser'];
461 }
462
463 /**
464 * Returns the categories assigned to the user.
465 *
466 * @return array
467 */
468 public function getCategoriesForUser()
469 {
470 /**
471 * @var wpdb $wpdb
472 */
473 global $wpdb;
474
475 if (isset($this->_aSqlResults['categoriesAssignedToUser'])) {
476 return $this->_aSqlResults['categoriesAssignedToUser'];
477 }
478
479 $sUserUserGroups = $this->_getUserGroupsForUserAsSqlString();
480
481 $sCategoriesAssignedToUserSql = "
482 SELECT igc.object_id
483 FROM ".DB_ACCESSGROUP_TO_OBJECT." AS igc
484 WHERE igc.object_type = 'category'
485 AND igc.group_id IN (".$sUserUserGroups.")";
486
487 $this->_aSqlResults['categoriesAssignedToUser'] = $wpdb->get_col($sCategoriesAssignedToUserSql);
488 return $this->_aSqlResults['categoriesAssignedToUser'];
489 }
490
491 /**
492 * Returns the posts assigned to the user.
493 *
494 * @return array
495 */
496 public function getPostsForUser()
497 {
498 /**
499 * @var wpdb $wpdb
500 */
501 global $wpdb;
502
503 if (isset($this->_aSqlResults['postsAssignedToUser'])) {
504 return $this->_aSqlResults['postsAssignedToUser'];
505 }
506
507 $sUserUserGroup = $this->_getUserGroupsForUserAsSqlString();
508
509 $sPostAssignedToUserSql = "
510 SELECT igp.object_id
511 FROM ".DB_ACCESSGROUP_TO_OBJECT." AS igp
512 WHERE igp.object_type = 'post'
513 AND igp.group_id IN (".$sUserUserGroup.")";
514
515 $this->_aSqlResults['postsAssignedToUser'] = $wpdb->get_col($sPostAssignedToUserSql);
516 return $this->_aSqlResults['postsAssignedToUser'];
517 }
518
519 /**
520 * Returns the excluded posts.
521 *
522 * @return array
523 */
524 public function getExcludedPosts()
525 {
526 /**
527 * @var wpdb $wpdb
528 */
529 global $wpdb;
530
531 if ($this->checkUserAccess('manage_user_groups')) {
532 $this->_aSqlResults['excludedPosts'] = array();
533 }
534
535 if (isset($this->_aSqlResults['excludedPosts'])) {
536 return $this->_aSqlResults['excludedPosts'];
537 }
538
539 if ($this->getUserAccessManager()->atAdminPanel()) {
540 $sAccessType = "write";
541 } else {
542 $sAccessType = "read";
543 }
544
545 $aCategoriesAssignedToUser = $this->getCategoriesForUser();
546
547 if ($aCategoriesAssignedToUser !== array()) {
548 $sCategoriesAssignedToUser = implode(', ', $aCategoriesAssignedToUser);
549 } else {
550 $sCategoriesAssignedToUser = "''";
551 }
552
553 $aPostAssignedToUser = $this->getPostsForUser();
554
555 if ($aPostAssignedToUser !== array()) {
556 $sPostAssignedToUser = implode(', ', $aPostAssignedToUser);
557 } else {
558 $sPostAssignedToUser = "''";
559 }
560
561 $sPostSql = "SELECT DISTINCT p.ID
562 FROM $wpdb->posts AS p
563 INNER JOIN $wpdb->term_relationships AS tr
564 ON p.ID = tr.object_id
565 INNER JOIN $wpdb->term_taxonomy tt
566 ON tr.term_taxonomy_id = tt.term_taxonomy_id
567 WHERE tt.taxonomy = 'category'
568 AND tt.term_id IN (
569 SELECT gc.object_id
570 FROM ".DB_ACCESSGROUP." iag
571 INNER JOIN ".DB_ACCESSGROUP_TO_OBJECT." AS gc
572 ON iag.id = gc.group_id
573 WHERE gc.object_type = 'category'
574 AND iag.".$sAccessType."_access != 'all'
575 AND gc.object_id NOT IN (".$sCategoriesAssignedToUser.")
576 ) AND p.ID NOT IN (".$sPostAssignedToUser.")
577 UNION
578 SELECT DISTINCT gp.object_id
579 FROM ".DB_ACCESSGROUP." AS ag
580 INNER JOIN ".DB_ACCESSGROUP_TO_OBJECT." AS gp
581 ON ag.id = gp.group_id
582 INNER JOIN $wpdb->term_relationships AS tr
583 ON gp.object_id = tr.object_id
584 INNER JOIN $wpdb->term_taxonomy tt
585 ON tr.term_taxonomy_id = tt.term_taxonomy_id
586 WHERE gp.object_type = 'post'
587 AND ag.".$sAccessType."_access != 'all'
588 AND gp.object_id NOT IN (".$sPostAssignedToUser.")
589 AND tt.term_id NOT IN (".$sCategoriesAssignedToUser.")";
590
591 $this->_aSqlResults['excludedPosts'] = $wpdb->get_col($sPostSql);
592 return $this->_aSqlResults['excludedPosts'];
593 }
594
595
596 /*
597 * Other functions
598 */
599
600 /**
601 * Checks if the given ip matches with the range.
602 *
603 * @param array $aCurIp The ip of the current user.
604 * @param array $aIpRanges The ip ranges.
605 *
606 * @return boolean
607 */
608 public function checkUserIp($aCurIp, $aIpRanges)
609 {
610 if (isset($aIpRanges)) {
611 foreach ($aIpRanges as $aIpRange) {
612 $aIpRange = explode("-", $aIpRange);
613 $aRangeBegin = explode(".", $aIpRange[0]);
614
615 if (isset($aIpRange[1])) {
616 $aRangeEnd = explode(".", $aIpRange[1]);
617 } else {
618 $aRangeEnd = explode(".", $aIpRange[0]);
619 }
620
621 if ($aRangeBegin[0] <= $aCurIp[0] && $aCurIp[0] <= $aRangeEnd[0]
622 && $aRangeBegin[1] <= $aCurIp[1] && $aCurIp[1] <= $aRangeEnd[1]
623 && $aRangeBegin[2] <= $aCurIp[2] && $aCurIp[2] <= $aRangeEnd[2]
624 && $aRangeBegin[3] <= $aCurIp[3] && $aCurIp[3] <= $aRangeEnd[3]
625 ) {
626 return true;
627 }
628 }
629 }
630
631 return false;
632 }
633
634 /**
635 * Return the role of the user.
636 *
637 * @param integer $iUserId The user _iId.
638 *
639 * @return string|null
640 */
641 protected function _getUserRole($iUserId)
642 {
643 /**
644 * @var wpdb $wpdb
645 */
646 global $wpdb;
647
648 $oUserData = get_userdata($iUserId);
649
650 if (!isset($oUserData->user_level)) {
651 $oUserData->user_level = null;
652 }
653
654 if (isset($oUserData->{$wpdb->prefix . "capabilities"})) {
655 $aCapabilities = $oUserData->{$wpdb->prefix . "capabilities"};
656 } else {
657 $aCapabilities = array();
658 }
659
660 $aRole = (count($aCapabilities) > 0) ? array_keys($aCapabilities) : array('norole');
661 return trim($aRole[0]);
662 }
663
664 /**
665 * Checks if the user is an admin user
666 *
667 * @param integer $iUserId The user _iId.
668 *
669 * @return boolean
670 */
671 public function userIsAdmin($iUserId)
672 {
673 $sRole = $this->_getUserRole($iUserId);
674
675 if ($sRole == 'administrator' || is_super_admin($iUserId)) {
676 return true;
677 }
678
679 return false;
680 }
681
682 /**
683 * Checks the user access by user level.
684 *
685 * @param boolean $blAllowedCapability If true check also for the capability.
686 *
687 * @return boolean
688 */
689 public function checkUserAccess($blAllowedCapability = false)
690 {
691 global $current_user;
692 //Force user info
693 wp_get_current_user();
694
695 $aUamOptions = $this->getUserAccessManager()->getAdminOptions();
696
697 $sRole = $this->_getUserRole($current_user->ID);
698 $aOrderedRoles = $this->getRolesOrdered();
699
700 if (isset($aOrderedRoles[$sRole])
701 && $aOrderedRoles[$sRole] >= $aOrderedRoles[$aUamOptions['full_access_role']]
702 || $sRole == 'administrator' || is_super_admin($current_user->ID)
703 || ($blAllowedCapability && $current_user->has_cap($blAllowedCapability))
704 ) {
705 return true;
706 }
707
708 return false;
709 }
710
711 /**
712 * Returns the roles as associative array.
713 *
714 * @return array
715 */
716 public function getRolesOrdered()
717 {
718 $aOrderedRoles = array(
719 'norole' => 0,
720 'subscriber' => 1,
721 'contributor' => 2,
722 'author' => 3,
723 'editor' => 4,
724 'administrator' => 5
725 );
726
727 return $aOrderedRoles;
728 }
729
730 /**
731 * Registers object that should be handelt by the user access manager.
732 *
733 * @param array $oObject The object which you want to register.
734 *
735 * @return boolean
736 */
737 public function registerPlObject($oObject)
738 {
739 if (!isset($oObject['name']) || !isset($oObject['reference'])
740 || !isset($oObject['getFull']) || !isset($oObject['getFullObjects'])
741 ) {
742 return false;
743 }
744
745 $this->_aPlObjects[$oObject['name']] = $oObject;
746
747 return true;
748 }
749
750 /**
751 * Returns a registered pluggable object.
752 *
753 * @param string $sObjectName The name of the object which should be returned.
754 *
755 * @return array
756 */
757 public function getPlObject($sObjectName)
758 {
759 if (isset($this->_aPlObjects[$sObjectName])) {
760 return $this->_aPlObjects[$sObjectName];
761 }
762
763 return array();
764 }
765
766 /**
767 * Returns all registered pluggable _aObjects.
768 *
769 * @return array
770 */
771 public function getPlObjects()
772 {
773 return $this->_aPlObjects;
774 }
775 }