Add form to create remote user

This commit is contained in:
Frederic Guillot
2015-07-18 10:02:29 -04:00
parent 536c6964aa
commit 5369c74ec0
23 changed files with 106 additions and 4 deletions

View File

@@ -377,6 +377,7 @@ class User extends Base
new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), self::TABLE, 'id'),
new Validators\Email('email', t('Email address invalid')),
new Validators\Integer('is_admin', t('This value must be an integer')),
new Validators\Integer('is_ldap_user', t('This value must be an integer')),
);
}
@@ -409,7 +410,12 @@ class User extends Base
new Validators\Required('username', t('The username is required')),
);
$v = new Validator($values, array_merge($rules, $this->commonValidationRules(), $this->commonPasswordValidationRules()));
if (isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1) {
$v = new Validator($values, array_merge($rules, $this->commonValidationRules()));
}
else {
$v = new Validator($values, array_merge($rules, $this->commonValidationRules(), $this->commonPasswordValidationRules()));
}
return array(
$v->execute(),