BxAccntModule.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 Accounts Accounts
  7. * @ingroup DolphinModules
  8. *
  9. * @{
  10. */
  11. bx_import('BxBaseModGeneralModule');
  12. class BxAccntModule extends BxBaseModGeneralModule
  13. {
  14. /**
  15. * Constructor
  16. */
  17. function __construct($aModule)
  18. {
  19. parent::__construct($aModule);
  20. $this->_oConfig->init($this->_oDb);
  21. }
  22. public function serviceGetMenuAddonManageTools()
  23. {
  24. bx_import('SearchResult', $this->_aModule);
  25. $sClass = $this->_aModule['class_prefix'] . 'SearchResult';
  26. $o = new $sClass();
  27. $o->fillFilters(array(
  28. 'unconfirmed' => 1
  29. ));
  30. $o->unsetPaginate();
  31. return $o->getNum();
  32. }
  33. public function checkAllowedDelete(&$aDataEntry, $isPerformAction = false)
  34. {
  35. // check ACL
  36. $aCheck = checkActionModule($this->_iProfileId, 'delete account', 'system', $isPerformAction);
  37. if($aCheck[CHECK_ACTION_RESULT] === CHECK_ACTION_RESULT_ALLOWED)
  38. return CHECK_ACTION_RESULT_ALLOWED;
  39. return _t('_sys_txt_access_denied');
  40. }
  41. }
  42. /** @} */