system system.base system.caching system.caching.dependencies system.collections system.console system.db system.db.ar system.db.schema system.db.schema.cubrid system.db.schema.mssql system.db.schema.mysql system.db.schema.oci system.db.schema.pgsql system.db.schema.sqlite system.gii system.i18n system.i18n.gettext system.logging system.test system.utils system.validators system.web system.web.actions system.web.auth system.web.filters system.web.form system.web.helpers system.web.renderers system.web.services system.web.widgets system.web.widgets.captcha system.web.widgets.pagers zii.behaviors zii.widgets zii.widgets.grid zii.widgets.jui

IWebUser

system.base
继承 interface IWebUser
子类 CWebUser
可用自 1.0
源码 framework/base/interfaces.php
IWebUser interface is implemented by a user application component.

A user application component represents the identity information for the current user.

公共方法

隐藏继承的方法

方法描述被定义在
checkAccess() Performs access check for this user. IWebUser
getId() Returns a value that uniquely represents the identity. IWebUser
getIsGuest() Returns a value indicating whether the user is a guest (not authenticated). IWebUser
getName() Returns the display name for the identity (e.g. username). IWebUser
loginRequired() Redirects the user browser to the login page. IWebUser

方法详情

checkAccess() 方法
abstract public boolean checkAccess(string $operation, array $params=array ( ))
$operation string the name of the operation that need access check.
$params array name-value pairs that would be passed to business rules associated with the tasks and roles assigned to the user.
{return} boolean whether the operations can be performed by this user.
源码: framework/base/interfaces.php#313 (显示)
public function checkAccess($operation,$params=array());

Performs access check for this user.

getId() 方法
abstract public mixed getId()
{return} mixed a value that uniquely represents the identity (e.g. primary key value).
源码: framework/base/interfaces.php#295 (显示)
public function getId();

Returns a value that uniquely represents the identity.

getIsGuest() 方法
abstract public boolean getIsGuest()
{return} boolean whether the user is a guest (not authenticated)
源码: framework/base/interfaces.php#305 (显示)
public function getIsGuest();

Returns a value indicating whether the user is a guest (not authenticated).

getName() 方法
abstract public string getName()
{return} string the display name for the identity.
源码: framework/base/interfaces.php#300 (显示)
public function getName();

Returns the display name for the identity (e.g. username).

loginRequired() 方法
abstract public void loginRequired()
源码: framework/base/interfaces.php#323 (显示)
public function loginRequired();

Redirects the user browser to the login page. Before the redirection, the current URL (if it's not an AJAX url) will be kept in returnUrl so that the user browser may be redirected back to the current page after successful login. Make sure you set loginUrl so that the user browser can be redirected to the specified login URL after calling this method. After calling this method, the current request processing will be terminated.