BxGroupsPageEntry.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 Groups Groups
  7. * @ingroup TridentModules
  8. *
  9. * @{
  10. */
  11. /**
  12. * Profile create/edit/delete pages.
  13. */
  14. class BxGroupsPageEntry extends BxBaseModProfilePageEntry
  15. {
  16. public function __construct($aObject, $oTemplate = false)
  17. {
  18. $this->MODULE = 'bx_groups';
  19. parent::__construct($aObject, $oTemplate);
  20. }
  21. protected function _processPermissionsCheck ()
  22. {
  23. $CNF = &$this->_oModule->_oConfig->CNF;
  24. $mixedAllowView = $this->_oModule->checkAllowedView($this->_aContentInfo);
  25. if ('c' != $this->_aContentInfo['allow_view_to'] && CHECK_ACTION_RESULT_ALLOWED !== ($sMsg = $mixedAllowView)) {
  26. $this->_oTemplate->displayAccessDenied($sMsg);
  27. exit;
  28. }
  29. elseif ('c' == $this->_aContentInfo['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. /** @} */