'required|array_db usrgrp.usrgrpid' ]; $ret = $this->validateInput($fields); if (!$ret) { $this->setResponse(new CControllerResponseFatal()); } return $ret; } protected function checkPermissions() { return $this->checkAccess(CRoleHelper::UI_ADMINISTRATION_USER_GROUPS); } protected function doAction() { $usrgrpids = $this->getInput('usrgrpids'); $result = (bool) API::UserGroup()->delete($usrgrpids); $deleted = count($usrgrpids); $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) ->setArgument('action', 'usergroup.list') ->setArgument('page', CPagerHelper::loadPage('usergroup.list', null)) ); if ($result) { $response->setFormData(['uncheck' => '1']); CMessageHelper::setSuccessTitle(_n('User group deleted', 'User groups deleted', $deleted)); } else { CMessageHelper::setErrorTitle(_n('Cannot delete user group', 'Cannot delete user groups', $deleted)); } $this->setResponse($response); } }