summaryrefslogtreecommitdiff
path: root/app/Model/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/User.php')
-rw-r--r--app/Model/User.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/app/Model/User.php b/app/Model/User.php
index 138b77b2..c4d26c9c 100644
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -280,11 +280,9 @@ class User extends Base
public function prepare(array &$values)
{
if (isset($values['password'])) {
-
if (! empty($values['password'])) {
$values['password'] = \password_hash($values['password'], PASSWORD_BCRYPT);
- }
- else {
+ } else {
unset($values['password']);
}
}
@@ -516,8 +514,7 @@ class User extends Base
if (isset($values['is_ldap_user']) && $values['is_ldap_user'] == 1) {
$v = new Validator($values, array_merge($rules, $this->commonValidationRules()));
- }
- else {
+ } else {
$v = new Validator($values, array_merge($rules, $this->commonValidationRules(), $this->commonPasswordValidationRules()));
}
@@ -591,8 +588,7 @@ class User extends Base
// Check password
if ($this->authentication->authenticate($this->session['user']['username'], $values['current_password'])) {
return array(true, array());
- }
- else {
+ } else {
return array(false, array('current_password' => array(t('Wrong password'))));
}
}