diff options
Diffstat (limited to 'app/Model/User.php')
-rw-r--r-- | app/Model/User.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/Model/User.php b/app/Model/User.php index ba1acb90..b5744c44 100644 --- a/app/Model/User.php +++ b/app/Model/User.php @@ -118,6 +118,14 @@ class User extends Base $values['password'] = \password_hash($values['password'], PASSWORD_BCRYPT); } + if (empty($values['is_admin'])) { + $values['is_admin'] = 0; + } + + if (empty($values['is_ldap_user'])) { + $values['is_ldap_user'] = 0; + } + return $this->db->table(self::TABLE)->save($values); } @@ -145,6 +153,14 @@ class User extends Base unset($values['current_password']); } + if (empty($values['is_admin'])) { + $values['is_admin'] = 0; + } + + if (empty($values['is_ldap_user'])) { + $values['is_ldap_user'] = 0; + } + $result = $this->db->table(self::TABLE)->eq('id', $values['id'])->update($values); if (session_id() !== '' && $_SESSION['user']['id'] == $values['id']) { |