_oConfig->init($this->_oDb); } public function serviceGetSafeServices() { return array (); } /** * @page service Service Calls * @section bx_accounts Accounts * @subsection bx_accounts-other Other * @subsubsection bx_accounts-get_menu_addon_manage_tools get_menu_addon_manage_tools * * @code bx_srv('bx_accounts', 'get_menu_addon_manage_tools', [...]); @endcode * * Get number of 'unconfirmed' accounts for User End -> Dasboard page -> Manage block. * * @return integer number of 'unconfirmed' accounts * * @see BxAccntModule::serviceGetMenuAddonManageTools */ /** * @ref bx_accounts-get_menu_addon_manage_tools "get_menu_addon_manage_tools" */ public function serviceGetMenuAddonManageTools() { bx_import('SearchResult', $this->_aModule); $sClass = $this->_aModule['class_prefix'] . 'SearchResult'; $o = new $sClass(); $o->unsetPaginate(); $iNumTotal = $o->getNum(); $o->fillFilters(array( 'unconfirmed' => 1 )); return array('counter1_value' => $o->getNum(),'counter3_value' => $iNumTotal, 'counter1_caption' => _t('_bx_accnt_menu_dashboard_manage_tools_addon_counter1_caption')); } public function checkAllowedConfirm(&$aDataEntry, $isPerformAction = false) { $bAdmin = isAdmin(); if(!$bAdmin || BxDolAccount::getInstance($aDataEntry['id'])->isConfirmed()) return _t('_sys_txt_access_denied'); return CHECK_ACTION_RESULT_ALLOWED; } public function checkAllowedDelete(&$aDataEntry, $isPerformAction = false) { if(isAdmin() && (int)$aDataEntry['id'] == getLoggedId()) return _t('_sys_txt_access_denied'); // check ACL $aCheck = checkActionModule($this->_iProfileId, 'delete account', 'system', $isPerformAction); if($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) return $aCheck[CHECK_ACTION_MESSAGE]; return CHECK_ACTION_RESULT_ALLOWED; } public function checkAllowedSetOperatorRole(&$aDataEntry, $isPerformAction = false) { $bAdmin = isAdmin(); $iAccountId = getLoggedId(); if(!$bAdmin || !BxDolStudioRolesUtils::getInstance()->isActionAllowed(BX_SRA_MANAGE_ROLES, $iAccountId) || (int)$aDataEntry['id'] == $iAccountId) return _t('_sys_txt_access_denied'); return CHECK_ACTION_RESULT_ALLOWED; } public function checkAllowedMakeOperator(&$aDataEntry, $isPerformAction = false) { $bAdmin = isAdmin(); $iAccountId = getLoggedId(); if(!$bAdmin || !BxDolStudioRolesUtils::getInstance()->isActionAllowed(BX_SRA_MANAGE_ROLES, $iAccountId) || (int)$aDataEntry['id'] == $iAccountId || (int)$aDataEntry['role'] == 3) return _t('_sys_txt_access_denied'); return CHECK_ACTION_RESULT_ALLOWED; } public function checkAllowedUnmakeOperator(&$aDataEntry, $isPerformAction = false) { $bAdmin = isAdmin(); $iAccountId = getLoggedId(); if(!$bAdmin || !BxDolStudioRolesUtils::getInstance()->isActionAllowed(BX_SRA_MANAGE_ROLES, $iAccountId) || (int)$aDataEntry['id'] == $iAccountId || (int)$aDataEntry['role'] != 3) return _t('_sys_txt_access_denied'); return CHECK_ACTION_RESULT_ALLOWED; } public function checkAllowedUnlockAccount(&$aDataEntry, $isPerformAction = false) { if((int)$aDataEntry['locked'] != 1) return _t('_sys_txt_access_denied'); return CHECK_ACTION_RESULT_ALLOWED; } } /** @} */