mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-31 12:10:51 -04:00
Fix the valid_admin code -- it was considering all non-admins invalid.
Fixes ticket #997 (highest prime under 1000!)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user