"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/web/User.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

User.php  (yii2-2.0.35):User.php  (yii2-2.0.36)
skipping to change at line 14 skipping to change at line 14
* @copyright Copyright (c) 2008 Yii Software LLC * @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/ * @license http://www.yiiframework.com/license/
*/ */
namespace yii\web; namespace yii\web;
use Yii; use Yii;
use yii\base\Component; use yii\base\Component;
use yii\base\InvalidConfigException; use yii\base\InvalidConfigException;
use yii\base\InvalidValueException; use yii\base\InvalidValueException;
use yii\di\Instance;
use yii\rbac\CheckAccessInterface; use yii\rbac\CheckAccessInterface;
/** /**
* User is the class for the `user` application component that manages the user authentication status. * User is the class for the `user` application component that manages the user authentication status.
* *
* You may use [[isGuest]] to determine whether the current user is a guest or n ot. * You may use [[isGuest]] to determine whether the current user is a guest or n ot.
* If the user is a guest, the [[identity]] property would return `null`. Otherw ise, it would * If the user is a guest, the [[identity]] property would return `null`. Otherw ise, it would
* be an instance of [[IdentityInterface]]. * be an instance of [[IdentityInterface]].
* *
* You may call various methods to change the user authentication status: * You may call various methods to change the user authentication status:
skipping to change at line 108 skipping to change at line 109
*/ */
public $identityCookie = ['name' => '_identity', 'httpOnly' => true]; public $identityCookie = ['name' => '_identity', 'httpOnly' => true];
/** /**
* @var int the number of seconds in which the user will be logged out autom atically if he * @var int the number of seconds in which the user will be logged out autom atically if he
* remains inactive. If this property is not set, the user will be logged ou t after * remains inactive. If this property is not set, the user will be logged ou t after
* the current session expires (c.f. [[Session::timeout]]). * the current session expires (c.f. [[Session::timeout]]).
* Note that this will not work if [[enableAutoLogin]] is `true`. * Note that this will not work if [[enableAutoLogin]] is `true`.
*/ */
public $authTimeout; public $authTimeout;
/** /**
* @var CheckAccessInterface The access checker to use for checking access. * @var CheckAccessInterface|string|array The access checker object to use f
or checking access or the application
* component ID of the access checker.
* If not set the application auth manager will be used. * If not set the application auth manager will be used.
* @since 2.0.9 * @since 2.0.9
*/ */
public $accessChecker; public $accessChecker;
/** /**
* @var int the number of seconds in which the user will be logged out autom atically * @var int the number of seconds in which the user will be logged out autom atically
* regardless of activity. * regardless of activity.
* Note that this will not work if [[enableAutoLogin]] is `true`. * Note that this will not work if [[enableAutoLogin]] is `true`.
*/ */
public $absoluteAuthTimeout; public $absoluteAuthTimeout;
skipping to change at line 167 skipping to change at line 169
public function init() public function init()
{ {
parent::init(); parent::init();
if ($this->identityClass === null) { if ($this->identityClass === null) {
throw new InvalidConfigException('User::identityClass must be set.') ; throw new InvalidConfigException('User::identityClass must be set.') ;
} }
if ($this->enableAutoLogin && !isset($this->identityCookie['name'])) { if ($this->enableAutoLogin && !isset($this->identityCookie['name'])) {
throw new InvalidConfigException('User::identityCookie must contain the "name" element.'); throw new InvalidConfigException('User::identityCookie must contain the "name" element.');
} }
if (!empty($this->accessChecker) && is_string($this->accessChecker)) { if ($this->accessChecker !== null) {
$this->accessChecker = Yii::createObject($this->accessChecker); $this->accessChecker = Instance::ensure($this->accessChecker, '\yii\
rbac\CheckAccessInterface');
} }
} }
private $_identity = false; private $_identity = false;
/** /**
* Returns the identity object associated with the currently logged-in user. * Returns the identity object associated with the currently logged-in user.
* When [[enableSession]] is true, this method may attempt to read the user' s authentication data * When [[enableSession]] is true, this method may attempt to read the user' s authentication data
* stored in session and reconstruct the corresponding identity object, if i t has not done so before. * stored in session and reconstruct the corresponding identity object, if i t has not done so before.
* @param bool $autoRenew whether to automatically renew authentication stat us if it has not been done so before. * @param bool $autoRenew whether to automatically renew authentication stat us if it has not been done so before.
 End of changes. 3 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)