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
2fd87fb6
Commit
2fd87fb6
authored
Mar 28, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User WIP
parent
74d4e04d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
60 deletions
+0
-60
Controller.php
framework/base/Controller.php
+0
-3
HttpCache.php
framework/web/HttpCache.php
+0
-2
User.php
framework/web/User.php
+0
-55
No files found.
framework/base/Controller.php
View file @
2fd87fb6
...
...
@@ -14,9 +14,6 @@ use yii\helpers\StringHelper;
/**
* Controller is the base class for classes containing controller logic.
*
* @property string $route the route (module ID, controller ID and action ID) of the current request.
* @property string $uniqueId the controller ID that is prefixed with the module ID (if any).
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
...
...
framework/web/HttpCache.php
View file @
2fd87fb6
...
...
@@ -112,10 +112,8 @@ class HttpCache extends ActionFilter
*/
protected
function
sendCacheControlHeader
()
{
if
(
Yii
::
$app
->
session
->
isActive
)
{
session_cache_limiter
(
'public'
);
header
(
'Pragma:'
,
true
);
}
header
(
'Cache-Control: '
.
$this
->
cacheControl
,
true
);
}
...
...
framework/web/User.php
View file @
2fd87fb6
...
...
@@ -223,30 +223,6 @@ class User extends Component
}
/**
* Returns the unique identifier for the user (e.g. username).
* This is the unique identifier that is mainly used for display purpose.
* @return string the user name. If the user is not logged in, this will be {@link guestName}.
*/
public
function
getName
()
{
if
((
$name
=
$this
->
getState
(
'__name'
))
!==
null
)
{
return
$name
;
}
else
{
return
$this
->
guestName
;
}
}
/**
* Sets the unique identifier for the user (e.g. username).
* @param string $value the user name.
* @see getName
*/
public
function
setName
(
$value
)
{
$this
->
setState
(
'__name'
,
$value
);
}
/**
* Returns the URL that the user should be redirected to after successful login.
* This property is usually used by the login action. If the login is successful,
* the action should read this property and use it to redirect the user browser.
...
...
@@ -587,7 +563,6 @@ class User extends Component
* Updates the authentication status according to {@link authTimeout}.
* If the user has been inactive for {@link authTimeout} seconds,
* he will be automatically logged out.
* @since 1.1.7
*/
protected
function
updateAuthStatus
()
{
...
...
@@ -600,34 +575,4 @@ class User extends Component
}
}
}
/**
* Performs access check for this user.
* @param string $operation the name of the operation that need access check.
* @param array $params name-value pairs that would be passed to business rules associated
* with the tasks and roles assigned to the user.
* Since version 1.1.11 a param with name 'userId' is added to this array, which holds the value of
* {@link getId()} when {@link CDbAuthManager} or {@link CPhpAuthManager} is used.
* @param boolean $allowCaching whether to allow caching the result of access check.
* When this parameter
* is true (default), if the access check of an operation was performed before,
* its result will be directly returned when calling this method to check the same operation.
* If this parameter is false, this method will always call {@link CAuthManager::checkAccess}
* to obtain the up-to-date access result. Note that this caching is effective
* only within the same request and only works when <code>$params=array()</code>.
* @return boolean whether the operations can be performed by this user.
*/
public
function
checkAccess
(
$operation
,
$params
=
array
(),
$allowCaching
=
true
)
{
if
(
$allowCaching
&&
$params
===
array
()
&&
isset
(
$this
->
_access
[
$operation
]))
{
return
$this
->
_access
[
$operation
];
}
$access
=
Yii
::
app
()
->
getAuthManager
()
->
checkAccess
(
$operation
,
$this
->
getId
(),
$params
);
if
(
$allowCaching
&&
$params
===
array
())
{
$this
->
_access
[
$operation
]
=
$access
;
}
return
$access
;
}
}
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