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

Static Public Member Functions

static encrypt ($value, $withUrl=true)
static decrypt ($value, $withUrl=true)

Detailed Description

Definition at line 3 of file EncryptHelper.php.

Member Function Documentation

static EncryptHelper::decrypt (   $value,
  $withUrl = true 
)
static

Function for decrypt information

Parameters
string$valueinformation that should be decrypted
Returns
decrypted string

Definition at line 22 of file EncryptHelper.php.

Referenced by Item\getItemChecksum(), and ShoppingCartWidget\init().

{
try{
$result = $value;
if($withUrl){
$result = urldecode($value);
}
$result = Yii::app()->securityManager->decrypt($result, Yii::app()->securityManager->getEncryptionKey());
}catch (Exception $e){
$result = false;
}
return $result;
}
static EncryptHelper::encrypt (   $value,
  $withUrl = true 
)
static

Function for encrypt information

Parameters
string$valueinformation that should be encrypted
Returns
encrypted string

Definition at line 10 of file EncryptHelper.php.

Referenced by ShareRemembered\getEncryptedOptions(), ShoppingCartWidget\init(), and ItemWidget\run().

{
$result = Yii::app()->securityManager->encrypt($value, Yii::app()->securityManager->getEncryptionKey());
if($withUrl){
$result = urlencode($result);
}
return $result;
}

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