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
f3105f73
Commit
f3105f73
authored
Aug 26, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #3283: Added `$checkAjax` to `yii\web\User::loginRequired()`
parent
88843ea2
Hide 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 @
f3105f73
...
...
@@ -118,6 +118,7 @@ Yii Framework 2 Change Log
-
Enh #3244: Allow logging complex data such as arrays and object via the log system (cebe)
-
Enh #3252: Added support for case insensitive matching using ILIKE to PostgreSQL QueryBuilder (cebe)
-
Enh #3280: Support dynamically attaching anonymous behaviors (qiangxue)
-
Enh #3283: Added
`$checkAjax`
to
`yii\web\User::loginRequired()`
(qiangxue)
-
Enh #3284: Added support for checking multiple ETags by
`yii\filters\HttpCache`
(qiangxue)
-
Enh #3298: Supported configuring
`View::theme`
using a class name (netyum, qiangxue)
-
Enh #3328:
`BaseMailer`
generates better text body from html body (armab)
...
...
framework/web/User.php
View file @
f3105f73
...
...
@@ -408,13 +408,15 @@ class User extends Component
*
* Note that when [[loginUrl]] is set, calling this method will NOT terminate the application execution.
*
* @param boolean $checkAjax whether to check if the request is an AJAX request. When this is true and the request
* is an AJAX request, the current URL (for AJAX request) will NOT be set as the return URL.
* @return Response the redirection response if [[loginUrl]] is set
* @throws ForbiddenHttpException the "Access Denied" HTTP exception if [[loginUrl]] is not set
*/
public
function
loginRequired
()
public
function
loginRequired
(
$checkAjax
=
true
)
{
$request
=
Yii
::
$app
->
getRequest
();
if
(
$this
->
enableSession
&&
!
$request
->
getIsAjax
(
))
{
if
(
$this
->
enableSession
&&
(
!
$checkAjax
||
!
$request
->
getIsAjax
()
))
{
$this
->
setReturnUrl
(
$request
->
getUrl
());
}
if
(
$this
->
loginUrl
!==
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