Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
851d1538
Commit
851d1538
authored
Sep 22, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5131: Added `$autoRenew` parameter to `yii\web\User::getIdentity()`
parent
9c375d65
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
User.php
framework/web/User.php
+4
-2
No files found.
framework/CHANGELOG.md
View file @
851d1538
...
...
@@ -218,6 +218,7 @@ Yii Framework 2 Change Log
-
Enh #5089: Added asset debugger panel (arturf, qiangxue)
-
Enh #5117: Added
`beforeFilter`
and
`afterFilter`
JS events to
`GridView`
(kartik-v)
-
Enh #5124: Added support to prevent duplicated form submission when using
`ActiveForm`
(qiangxue)
-
Enh #5131: Added
`$autoRenew`
parameter to
`yii\web\User::getIdentity()`
(qiangxue)
-
Enh: Added support for using sub-queries when building a DB query with
`IN`
condition (qiangxue)
-
Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
-
Enh: Added
`yii\web\UrlManager::addRules()`
to simplify adding new URL rules (qiangxue)
...
...
framework/web/User.php
View file @
851d1538
...
...
@@ -161,15 +161,17 @@ class User extends Component
* 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
* stored in session and reconstruct the corresponding identity object, if it has not done so before.
* @param boolean $autoRenew whether to automatically renew authentication status if it has not been done so before.
* This is only useful when [[enableSession]] is true.
* @return IdentityInterface|null the identity object associated with the currently logged-in user.
* `null` is returned if the user is not logged in (not authenticated).
* @see login()
* @see logout()
*/
public
function
getIdentity
()
public
function
getIdentity
(
$autoRenew
=
true
)
{
if
(
$this
->
_identity
===
false
)
{
if
(
$this
->
enableSession
)
{
if
(
$this
->
enableSession
&&
$autoRenew
)
{
$this
->
renewAuthStatus
();
}
else
{
return
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment