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

Public Member Functions

 startRequest ()
 getProfileAttr ($attributename="")
 printBackendPath ()

Public Attributes

 $authUrl = ''
 $salt_secretkey = ''
 $username_sessionattr = ''
 $cmsBackendUrl = ''
 $crypt_secretkey = ''

Detailed Description

module for cms user authentication

Definition at line 5 of file CmsuserauthenticationModule.php.

Member Function Documentation

CmsuserauthenticationModule::getProfileAttr (   $attributename = "")

print out the path to backend cms with sid and encrypted cookie data

Definition at line 53 of file CmsuserauthenticationModule.php.

{
$attributevalue = "";
$attributevalue = Yii::app()->getModule('user')->user()->profile->getAttribute($attributename);
return $attributevalue;
}
CmsuserauthenticationModule::startRequest ( )

starts the authentication request

if(isset(Yii::app()->user->{$this->username_sessionattr})){ $username = Yii::app()->user->{$this->username_sessionattr}; }

Definition at line 18 of file CmsuserauthenticationModule.php.

References User\model().

{
$username = '';
$password = '';
$user_id = Yii::app()->user->id;
$user = User::model()->findByAttributes(array(
'id' => $user_id
));
if (isset($this->username_sessionattr) && ($this->username_sessionattr == 'username')) {
$username = $user->username;
} else {
$username = $user->email;
}
/**
if(isset(Yii::app()->user->{$this->username_sessionattr})){
$username = Yii::app()->user->{$this->username_sessionattr};
}
**/
$password = md5($this->salt_secretkey . $username);
$CMS_sid = $this->sendRequest($username, $password);
if (isset($CMS_sid) && isset($CMS_sid->{'sid'})) {
YII::app()->session->add('feSid', $CMS_sid->{'sid'});
$this->CMS_sid_object = $CMS_sid;
}
}

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