Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/getgrav/grav into 1.5
Browse files Browse the repository at this point in the history
# Conflicts:
#	system/defines.php
  • Loading branch information
mahagr committed May 14, 2018
2 parents 5ab956a + afe72d0 commit dab595f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@
* Fixed `Route::withQueryParam()` to accept array values

# v1.4.4
## 04/12/2018
## 05/11/2018

1. [](#new)
* Added support for `Uri::post()` and `Uri::getConentType()`
* Added a new `Medium:thumbnailExists()` function [#1966](https://github.com/getgrav/grav/issues/1966)
* Added `authorized` support for 2FA
1. [](#improved)
* Added default configuration for images [#1979](https://github.com/getgrav/grav/pull/1979)
* Added dedicated PHPUnit assertions [#1990](https://github.com/getgrav/grav/pull/1990)
1. [](#bugfix)
* Use `array_key_exists` instead of `in_array + array_keys` [#1991](https://github.com/getgrav/grav/pull/1991)
* Fixed an issue with `custom_base_url` always causing 404 errors
* Improve support for regex redirects with query and params [#1983](https://github.com/getgrav/grav/issues/1983)
* Changed collection-based date sorting to `SORT_REGULAR` for better server compatibility [#1910](https://github.com/getgrav/grav/issues/1910)
* Fix hardcoded string in modular blueprint [#1933](https://github.com/getgrav/grav/pull/1993)

# v1.4.3
## 04/12/2018
Expand Down
52 changes: 52 additions & 0 deletions system/src/Grav/Common/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

class User extends Data
{
protected $authenticated;
protected $authorized;

/**
* Load user account.
*
Expand Down Expand Up @@ -102,6 +105,55 @@ public static function remove($username)
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.
*
Expand Down

0 comments on commit dab595f

Please sign in to comment.