'required|array_db users.userid' ]; $ret = $this->validateInput($fields); if (!$ret) { $this->setResponse(new CControllerResponseFatal()); } return $ret; } protected function checkPermissions(): bool { return $this->checkAccess(CRoleHelper::UI_ADMINISTRATION_USERS); } protected function doAction(): void { $userids = $this->getInput('userids'); $result = API::User()->provision($userids); $provisionedids = $result ? $result['userids'] : []; $response = new CControllerResponseRedirect( (new CUrl('zabbix.php')) ->setArgument('action', 'user.list') ->setArgument('page', CPagerHelper::loadPage('user.list', null)) ); if ($provisionedids) { $users = API::User()->get([ 'output' => ['username', 'name', 'surname'], 'userids' => $provisionedids ]); foreach ($users as $user) { info(_s('User "%1$s" provisioned.', getUserFullname($user))); } $response->setFormData(['uncheck' => '1']); CMessageHelper::setSuccessTitle(_('Provisioning successful.')); } else { CMessageHelper::setErrorTitle( _n('Cannot provision user', 'Cannot provision users', count($provisionedids)) ); } $this->setResponse($response); } }