本文整理汇总了PHP中eZSession::set方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSession::set方法的具体用法?PHP eZSession::set怎么用?PHP eZSession::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSession
的用法示例。
在下文中一共展示了eZSession::set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setCurrentlyLoggedInUser
/**
* Makes sure the $user is set as the currently logged in user by
* updating the session and setting the necessary global variables.
*
* All login handlers should use this function to ensure that the process
* is executed properly.
*
* @access private
*
* @param eZUser $user User
* @param int $userID User ID
* @param int $flags Optional flag that can be set to:
* eZUser::NO_SESSION_REGENERATE to avoid session to be regenerated
*/
static function setCurrentlyLoggedInUser($user, $userID, $flags = 0)
{
$GLOBALS["eZUserGlobalInstance_{$userID}"] = $user;
// Set/overwrite the global user, this will be accessed from
// instance() when there is no ID passed to the function.
$GLOBALS["eZUserGlobalInstance_"] = $user;
eZSession::setUserID($userID);
if (!($flags & self::NO_SESSION_REGENERATE)) {
eZSession::regenerate();
}
eZSession::set('eZUserLoggedInID', $userID);
self::cleanup();
}
示例2: getToken
/**
* Gets the user token from session if it exists or create+store
* it in session.
*
* @return string|null
*/
public static function getToken()
{
if (eZSession::issetkey(self::SESSION_KEY)) {
return eZSession::get(self::SESSION_KEY);
}
$token = md5(uniqid(self::SESSION_KEY, true));
eZSession::set(self::SESSION_KEY, $token);
return $token;
}
示例3: setCurrentlyLoggedInUser
static function setCurrentlyLoggedInUser( $user, $userID )
{
$GLOBALS["eZUserGlobalInstance_$userID"] = $user;
// Set/overwrite the global user, this will be accessed from
// instance() when there is no ID passed to the function.
$GLOBALS["eZUserGlobalInstance_"] = $user;
eZSession::setUserID( $userID );
eZSession::set( 'eZUserLoggedInID', $userID );
self::cleanup();
eZSession::regenerate();
}
示例4: flush
static public function flush()
{
if ( self::$_isDirty )
{
eZDebug::writeWarning(print_r( self::sessionArray(), true), "Flushing session - Should not happen");
eZSession::start();
foreach ( self::$_localSession as $k => $v)
eZSession::set($k, $v);
}
}
示例5: elseif
$parameters['redirect'] = 'url_alias';
eZSession::set('bcimagealias_create_parameters', $parameters);
} elseif ($http->hasVariable('NodeID') && $http->variable('NodeID') != '') {
$parameters['node-id'] = $http->variable('NodeID');
$parameters['redirect'] = 'url_alias';
eZSession::set('bcimagealias_create_parameters', $parameters);
}
/**
* Test for existance of module variable, 'Children'
*/
if (isset($Params['Children']) && $Params['Children'] != '') {
$parameters['children'] = $Params['Children'] == 'true' ? true : false;
eZSession::set('bcimagealias_create_parameters', $parameters);
} elseif ($http->hasVariable('Children') && $http->variable('Children') != '') {
$parameters['children'] = $http->variable('Children') == 'true' ? true : false;
eZSession::set('bcimagealias_create_parameters', $parameters);
}
/**
* Test for existance of module variable, 'Regenerate'
*/
if (isset($Params['Regenerate']) && $Params['Regenerate'] != '') {
$executionOptions['force'] = $Params['Regenerate'] == 'true' ? true : false;
} elseif ($http->hasVariable('Regenerate') && $http->variable('Regenerate') != '') {
$executionOptions['force'] = $http->variable('Regenerate') == 'true' ? true : false;
}
/**
* Test for existance of module variable, 'CurrentSiteaccess'
*/
if (isset($Params['CurrentSiteaccess']) && $Params['CurrentSiteaccess'] != '' && $Params['CurrentSiteaccess'] != 'true') {
$executionOptions['current-siteaccess'] = $Params['CurrentSiteaccess'] == 'true' ? true : false;
} elseif ($http->hasVariable('CurrentSiteaccess') && $http->variable('CurrentSiteaccess') != '' && $http->variable('CurrentSiteaccess') != 'true') {
示例6: store
public function store()
{
eZSession::set(self::SESSION_IDENTIFIER, serialize($this));
}
示例7: handleEZXFormToken
/**
*
* Handles casese where the token is reset during a request.
*
* @param bool $restore
*
* @return bool
*
*/
public static function handleEZXFormToken($restore = false)
{
$activeExtensions = \eZExtension::activeExtensions();
if (in_array('ezformtoken', $activeExtensions)) {
if ($restore) {
if (isset(self::$ezxFormToken) && !empty(self::$ezxFormToken)) {
\eZSession::set(\ezxFormToken::SESSION_KEY, self::$ezxFormToken);
}
} else {
self::$ezxFormToken = \eZSession::get(\ezxFormToken::SESSION_KEY);
}
return self::$ezxFormToken;
}
return false;
}
示例8: getSubsForOptin
/**
*
* @param string $user Usually get from MMUsers::getCurrentUserObject() function
*/
protected function getSubsForOptin($user) {
if( $user && SolrSafeOperatorHelper::featureIsActive('newsletterPopin') ) {
if (SolrSafeOperatorHelper::featureIsActive('UUMP')) {
// not yet activated for UUMP clusters
//$instance = new ServiceUserUUMP();
}
else {
$instance = new ServiceUser();
$userSubs = $instance->subsread();
$userSubs = $userSubs['Data']['Subs'];
$toCheck = array();
$subs = json_decode(CacheFeatureTool::getFeatureLocalizedByCode('newsletterPopin')->parameters, true);
foreach ( $subs as $key => $value ) {
if ( $value ) {
$toCheck[] = $key;
}
}
$filteredSubs = array();
if(is_array($userSubs)){
foreach ( $userSubs as $key => $value ) {
$filteredSubs[] = $value['offerId'];
}
}
$listOfChecks = array();
if ( !empty($toCheck) ) {
foreach ( $toCheck as $value ) {
if ( !in_array( $value, $filteredSubs ) && $value != "daysToCheck" ){
$listOfChecks[] = $value;
}
}
}
if (!empty($listOfChecks)) {
eZSession::set('listOfChecks', $listOfChecks);
}
}
}
}
示例9: elseif
$parameters['redirect'] = 'url_alias';
eZSession::set('bcimagealias_remove_parameters', $parameters);
} elseif ($http->hasVariable('NodeID') && $http->variable('NodeID') != '') {
$parameters['node-id'] = $http->variable('NodeID');
$parameters['redirect'] = 'url_alias';
eZSession::set('bcimagealias_remove_parameters', $parameters);
}
/**
* Test for existance of module variable, 'Children'
*/
if (isset($Params['Children']) && $Params['Children'] != '') {
$parameters['children'] = $Params['Children'] == 'true' ? true : false;
eZSession::set('bcimagealias_remove_parameters', $parameters);
} elseif ($http->hasVariable('Children') && $http->variable('Children') != '') {
$parameters['children'] = $http->variable('Children') == 'true' ? true : false;
eZSession::set('bcimagealias_remove_parameters', $parameters);
}
/**
* Test for existance of module variable, 'CurrentSiteaccess'
*/
if (isset($Params['CurrentSiteaccess']) && $Params['CurrentSiteaccess'] != '' && $Params['CurrentSiteaccess'] != 'true') {
$executionOptions['current-siteaccess'] = $Params['CurrentSiteaccess'] == 'true' ? true : false;
} elseif ($http->hasVariable('CurrentSiteaccess') && $http->variable('CurrentSiteaccess') != '' && $http->variable('CurrentSiteaccess') != 'true') {
$executionOptions['current-siteaccess'] = $http->variable('CurrentSiteaccess') == 'true' ? true : false;
}
// Fetch and use parameters from session directly
$parameters = eZSession::get('bcimagealias_remove_parameters', $parameters);
// print_r($parameters); echo "\n\n"; die();
/**
* Test for non existance of parameter variable, 'node-id' or invalid value and display browse view
*/