1
0

BxBaseModGroupsPageEntry.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  4. * CC-BY License - http://creativecommons.org/licenses/by/3.0/
  5. *
  6. * @defgroup BaseGroups Base classes for groups modules
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Profile create/edit/delete pages.
  13. */
  14. class BxBaseModGroupsPageEntry extends BxBaseModProfilePageEntry
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. parent::__construct($aObject, $oTemplate);
  19. }
  20. protected function _processPermissionsCheck ()
  21. {
  22. $CNF = &$this->_oModule->_oConfig->CNF;
  23. $oPrivacy = BxDolPrivacy::getObjectInstance($CNF['OBJECT_PRIVACY_VIEW']);
  24. $mixedAllowView = $this->_oModule->checkAllowedView($this->_aContentInfo);
  25. if (!$oPrivacy->isPartiallyVisible($this->_aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]) && CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $mixedAllowView)) {
  26. $this->_oTemplate->displayAccessDenied($sMsg);
  27. exit;
  28. }
  29. elseif ($oPrivacy->isPartiallyVisible($this->_aContentInfo[$CNF['FIELD_ALLOW_VIEW_TO']]) && $CNF['OBJECT_PAGE_VIEW_ENTRY'] == $this->_sObject && CHECK_ACTION_RESULT_ALLOWED !== $mixedAllowView) {
  30. // replace current page with different set of blocks
  31. $aObject = BxDolPageQuery::getPageObject($CNF['OBJECT_PAGE_VIEW_ENTRY_CLOSED']);
  32. $this->_sObject = $aObject['object'];
  33. $this->_aObject = $aObject;
  34. $this->_oQuery = new BxDolPageQuery($this->_aObject);
  35. }
  36. $this->_oModule->checkAllowedView($this->_aContentInfo, true);
  37. }
  38. }
  39. /** @} */