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
fb0c43b3
Commit
fb0c43b3
authored
Jan 01, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`yii\web\User::loginRequired()` now returns the `Response` object instead of…
`yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application
parent
35373b14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
User.php
framework/yii/web/User.php
+3
-2
No files found.
framework/CHANGELOG.md
View file @
fb0c43b3
...
@@ -53,6 +53,7 @@ Yii Framework 2 Change Log
...
@@ -53,6 +53,7 @@ Yii Framework 2 Change Log
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Support for file aliases in console command 'message' (omnilight)
-
Enh: Support for file aliases in console command 'message' (omnilight)
-
Enh: Sort and Pagination can now create absolute URLs (cebe)
-
Enh: Sort and Pagination can now create absolute URLs (cebe)
-
Chg #1519:
`yii\web\User::loginRequired()`
now returns the
`Response`
object instead of exiting the application (qiangxue)
-
Chg #1586:
`QueryBuilder::buildLikeCondition()`
will now escape special characters and use percentage characters by default (qiangxue)
-
Chg #1586:
`QueryBuilder::buildLikeCondition()`
will now escape special characters and use percentage characters by default (qiangxue)
-
Chg #1610:
`Html::activeCheckboxList()`
and
`Html::activeRadioList()`
will submit an empty string if no checkbox/radio is selected (qiangxue)
-
Chg #1610:
`Html::activeCheckboxList()`
and
`Html::activeRadioList()`
will submit an empty string if no checkbox/radio is selected (qiangxue)
-
Chg #1643: Added default value for
`Captcha::options`
(qiangxue)
-
Chg #1643: Added default value for
`Captcha::options`
(qiangxue)
...
...
framework/yii/web/User.php
View file @
fb0c43b3
...
@@ -320,6 +320,8 @@ class User extends Component
...
@@ -320,6 +320,8 @@ class User extends Component
* so that the user browser can be redirected to the specified login URL after
* so that the user browser can be redirected to the specified login URL after
* calling this method.
* calling this method.
* After calling this method, the current request processing will be terminated.
* After calling this method, the current request processing will be terminated.
* @return Response the redirection response if [[loginUrl]] is set
* @throws AccessDeniedHttpException the "Access Denied" HTTP exception if [[loginUrl]] is not set
*/
*/
public
function
loginRequired
()
public
function
loginRequired
()
{
{
...
@@ -328,8 +330,7 @@ class User extends Component
...
@@ -328,8 +330,7 @@ class User extends Component
$this
->
setReturnUrl
(
$request
->
getUrl
());
$this
->
setReturnUrl
(
$request
->
getUrl
());
}
}
if
(
$this
->
loginUrl
!==
null
)
{
if
(
$this
->
loginUrl
!==
null
)
{
Yii
::
$app
->
getResponse
()
->
redirect
(
$this
->
loginUrl
)
->
send
();
return
Yii
::
$app
->
getResponse
()
->
redirect
(
$this
->
loginUrl
);
exit
();
}
else
{
}
else
{
throw
new
AccessDeniedHttpException
(
Yii
::
t
(
'yii'
,
'Login Required'
));
throw
new
AccessDeniedHttpException
(
Yii
::
t
(
'yii'
,
'Login Required'
));
}
}
...
...
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