mirror of
https://github.com/getgrav/grav.git
synced 2026-02-03 21:30:24 +01:00
Revert "Add special handling for User authenticated and authorized properties"
This reverts commit 8e0e3e8718.
This commit is contained in:
@@ -17,9 +17,6 @@ use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
|
||||
|
||||
class User extends Data
|
||||
{
|
||||
protected $authenticated;
|
||||
protected $authorized;
|
||||
|
||||
/**
|
||||
* Load user account.
|
||||
*
|
||||
@@ -105,55 +102,6 @@ class User extends Data
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
if ($offset === 'authenticated') {
|
||||
return null !== $this->authenticated;
|
||||
}
|
||||
if ($offset === 'authorized') {
|
||||
return null !== $this->authorized;
|
||||
}
|
||||
|
||||
return parent::offsetExists($offset);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
if ($offset === 'authenticated') {
|
||||
return null !== $this->authenticated ? $this->authenticated : false;
|
||||
}
|
||||
if ($offset === 'authorized') {
|
||||
return null !== $this->authorized ? $this->authorized : $this->authenticated;
|
||||
}
|
||||
|
||||
return parent::offsetGet($offset);
|
||||
}
|
||||
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if ($offset === 'authenticated') {
|
||||
$this->authenticated = (bool)$value;
|
||||
}
|
||||
if ($offset === 'authorized') {
|
||||
$this->authorized = (bool)$value;
|
||||
}
|
||||
|
||||
parent::offsetSet($offset, $value);
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
if ($offset === 'authenticated') {
|
||||
$this->authenticated = null;
|
||||
}
|
||||
if ($offset === 'authorized') {
|
||||
$this->authorized = null;
|
||||
}
|
||||
|
||||
parent::offsetUnset($offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate user.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user