mirror of
https://github.com/getgrav/grav.git
synced 2026-02-21 22:18:03 +01:00
Implemented new state check for accounts. If an account state is set to disabled no actions will be allowed
This commit is contained in:
@@ -40,6 +40,9 @@ class User extends Data
|
||||
if (!isset($content['username'])) {
|
||||
$content['username'] = $username;
|
||||
}
|
||||
if (!isset($content['state'])) {
|
||||
$content['state'] = 'enabled';
|
||||
}
|
||||
$user = new User($content, $blueprint);
|
||||
$user->file($file);
|
||||
|
||||
@@ -139,6 +142,10 @@ class User extends Data
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->state !== 'enabled') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Utils::isPositive($this->get("access.{$action}"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user