diff options
Diffstat (limited to 'modules/user/models/user.php')
-rw-r--r-- | modules/user/models/user.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/user/models/user.php b/modules/user/models/user.php index 0cd634ea..baac9315 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -148,7 +148,8 @@ class User_Model extends ORM implements User_Definition { * Validate the admin bit. */ public function valid_admin(Validation $v, $field) { - if ($this->id == identity::active_user()->id && !$this->admin) { + $active = identity::active_user(); + if ($this->id == $active->id && $active->admin && !$this->admin) { $v->add_error("admin", "locked"); } } |