Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
RWebUser Class Reference

Public Member Functions

 afterLogin ($fromCookie)
 checkAccess ($operation, $params=array(), $allowCaching=true)
 setIsSuperuser ($value)
 getIsSuperuser ()
 setRightsReturnUrl ($value)
 getRightsReturnUrl ($defaultUrl=null)
 getEmail ()

Detailed Description

Rights web user class file.

Author
Christoffer Niska cnisk.nosp@m.a@li.nosp@m.ve.co.nosp@m.m
Since
0.5

Definition at line 9 of file RWebUser.php.

Member Function Documentation

RWebUser::afterLogin (   $fromCookie)

Actions to be taken after logging in. Overloads the parent method in order to mark superusers.

Parameters
boolean$fromCookiewhether the login is based on cookie.

Definition at line 16 of file RWebUser.php.

References Rights\getAuthorizer().

{
parent::afterLogin($fromCookie);
// Mark the user as a superuser if necessary.
if( Rights::getAuthorizer()->isSuperuser($this->getId())===true )
$this->isSuperuser = true;
}
RWebUser::checkAccess (   $operation,
  $params = array(),
  $allowCaching = true 
)

Performs access check for this user. Overloads the parent method in order to allow superusers access implicitly.

Parameters
string$operationthe name of the operation that need access check.
array$paramsname-value pairs that would be passed to business rules associated with the tasks and roles assigned to the user.
boolean$allowCachingwhether to allow caching the result of access checki. This parameter has been available since version 1.0.5. 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 CAuthManager::checkAccess to obtain the up-to-date access result. Note that this caching is effective only within the same request.
Returns
boolean whether the operations can be performed by this user.

Definition at line 40 of file RWebUser.php.

{
// Allow superusers access implicitly and do CWebUser::checkAccess for others.
return $this->isSuperuser===true ? true : parent::checkAccess($operation, $params, $allowCaching);
}
RWebUser::getIsSuperuser ( )
Returns
boolean whether the user is a superuser.

Definition at line 57 of file RWebUser.php.

{
return $this->getState('Rights_isSuperuser');
}
RWebUser::getRightsReturnUrl (   $defaultUrl = null)

Returns the URL that the user should be redirected to after updating an authorization item.

Parameters
string$defaultUrlthe default return URL in case it was not set previously. If this is null, the application entry URL will be considered as the default return URL.
Returns
string the URL that the user should be redirected to after updating an authorization item.

Definition at line 78 of file RWebUser.php.

{
if( ($returnUrl = $this->getState('Rights_returnUrl'))!==null )
$this->returnUrl = null;
return $returnUrl!==null ? CHtml::normalizeUrl($returnUrl) : CHtml::normalizeUrl($defaultUrl);
}
RWebUser::setIsSuperuser (   $value)
Parameters
boolean$valuewhether the user is a superuser.

Definition at line 49 of file RWebUser.php.

{
$this->setState('Rights_isSuperuser', $value);
}
RWebUser::setRightsReturnUrl (   $value)
Parameters
array$valuereturn url.

Definition at line 65 of file RWebUser.php.

{
$this->setState('Rights_returnUrl', $value);
}

The documentation for this class was generated from the following file: