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

Public Member Functions

 __construct ($service)
 authenticate ()
 getId ()
 getName ()

Public Attributes

const ERROR_NOT_AUTHENTICATED = 3

Protected Attributes

 $service
 $id
 $name

Detailed Description

Definition at line 14 of file EAuthUserIdentity.php.

Constructor & Destructor Documentation

EAuthUserIdentity::__construct (   $service)

Constructor.

Parameters
EAuthServiceBase$servicethe authorization service instance.

Definition at line 36 of file EAuthUserIdentity.php.

{
$this->service = $service;
}

Member Function Documentation

EAuthUserIdentity::authenticate ( )

Authenticates a user based on service. This method is required by IUserIdentity.

Returns
boolean whether authentication succeeds.

Definition at line 45 of file EAuthUserIdentity.php.

{
if ($this->service->isAuthenticated) {
$this->id = $this->service->id;
$this->name = $this->service->getAttribute('name');
$this->setState('id', $this->id);
$this->setState('name', $this->name);
$this->setState('service', $this->service->serviceName);
$this->errorCode = self::ERROR_NONE;
}
else {
$this->errorCode = self::ERROR_NOT_AUTHENTICATED;
}
return !$this->errorCode;
}
EAuthUserIdentity::getId ( )

Returns the unique identifier for the identity. This method is required by IUserIdentity.

Returns
string the unique identifier for the identity.

Definition at line 67 of file EAuthUserIdentity.php.

{
return $this->id;
}
EAuthUserIdentity::getName ( )

Returns the display name for the identity. This method is required by IUserIdentity.

Returns
string the display name for the identity.

Definition at line 76 of file EAuthUserIdentity.php.

{
return $this->name;
}

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