$this->getInputs($user, ['username', 'name', 'surname', 'url', 'autologin', 'autologout', 'theme', 'refresh',
class CControllerUserCreate extends CControllerUserUpdateGeneral {
protected function checkInput() {
$locales = array_keys(getLocales());
$locales[] = LANG_DEFAULT;
$themes = array_keys(APP::getThemes());
$themes[] = THEME_DEFAULT;
'username' => 'required|db users.username|not_empty',
'name' => 'db users.name',
'surname' => 'db users.surname',
'password1' => 'required|string',
'password2' => 'required|string',
'user_groups' => 'array_id',
'lang' => 'db users.lang|in '.implode(',', $locales),
'timezone' => 'db users.timezone|in '.implode(',', $this->timezones),
'theme' => 'db users.theme|in '.implode(',', $themes),
'autologin' => 'db users.autologin|in 0,1',
'autologout' => 'db users.autologout|not_empty',
'refresh' => 'required|db users.refresh|not_empty',
'rows_per_page' => 'required|db users.rows_per_page',
'roleid' => 'required|id',
'form_refresh' => 'int32'
$ret = $this->validateInput($fields);
$error = $this->GetValidationError();
if ($ret && (!$this->validatePassword() || !$this->validateUserRole())) {
$error = self::VALIDATION_ERROR;
case self::VALIDATION_ERROR:
$response = new CControllerResponseRedirect(
(new CUrl('zabbix.php'))->setArgument('action', 'user.edit')
$response->setFormData($this->getInputAll());
CMessageHelper::setErrorTitle(_('Cannot add user'));
$this->setResponse($response);