summaryrefslogtreecommitdiff
path: root/app/Model/User.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-07-18 10:02:29 -0400
committerFrederic Guillot <fred@kanboard.net>2015-07-18 10:02:29 -0400
commit5369c74ec0df35aa072a6067837c1d748836b96e (patch)
tree0739b5ed6c1329782f46b7a625cfae274ff14382 /app/Model/User.php
parent536c6964aad9c0b4f7cca60163a889657ccb15e2 (diff)
Add form to create remote user
Diffstat (limited to 'app/Model/User.php')
-rw-r--r--app/Model/User.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/Model/User.php b/app/Model/User.php
index 36b7194c..b6804abc 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -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(),