本文整理汇总了PHP中phpAds_SessionDataStore函数的典型用法代码示例。如果您正苦于以下问题:PHP phpAds_SessionDataStore函数的具体用法?PHP phpAds_SessionDataStore怎么用?PHP phpAds_SessionDataStore使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phpAds_SessionDataStore函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveDefaults
/**
* The local implementation of the saveDefaults() method to save the
* values used for the report by the user to the user's session
* preferences, so that they can be re-used in other reports.
*/
function saveDefaults()
{
global $session;
if (isset($_REQUEST['period_preset'])) {
$session['prefs']['GLOBALS']['report_period_preset'] = $_REQUEST['period_preset'];
}
phpAds_SessionDataStore();
}
示例2: getMessage
/**
* Retreives information from session
*
* @return string
* @static
*/
function getMessage()
{
global $session;
$message = isset($session['message']) ? $session['message'] : null;
unset($session['message']);
phpAds_SessionDataStore();
return $message;
}
示例3: clearEntitiesInSession
private function clearEntitiesInSession()
{
global $session;
$clientid = $session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid'];
unset($session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['clientid']);
if ($clientid) {
unset($session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['campaignid'][$clientid]);
}
phpAds_SessionDataStore();
}
示例4: addToRecentlyUsedAccounts
public static function addToRecentlyUsedAccounts($accountId)
{
global $session;
if (empty($session['recentlyUsedAccounts'])) {
$session['recentlyUsedAccounts']['a' . $accountId] = $accountId;
} else {
$session['recentlyUsedAccounts'] = array_merge(array('a' . $accountId => $accountId), $session['recentlyUsedAccounts']);
}
phpAds_SessionDataStore();
}
示例5: phpAds_SessionDataRegister
function phpAds_SessionDataRegister($key, $value = '')
{
global $Session;
if (!defined('phpAds_installing')) {
phpAds_SessionStart();
}
if (is_array($key) && $value == '') {
foreach (array_keys($key) as $name) {
$Session[$name] = $key[$name];
}
} else {
$Session[$key] = $value;
}
phpAds_SessionDataStore();
// This function has been disabled because of incompatibility
// problem with ZendOptimizer 1.00. Call sessionDataStore
// manually if have modified the session array.
// register_shutdown_function("phpAds_SessionDataStore");
}
示例6: switch
+---------------------------------------------------------------------------+
*/
// Require the initialisation file
require_once '../../init.php';
// Include required files
require_once MAX_PATH . '/lib/max/language/Loader.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Admin/Reports/Generate.php';
global $session;
if (isset($_REQUEST['submit_type']) && $_REQUEST['submit_type'] == 'change') {
// Store any values we need to pass to the next page
switch ($_REQUEST['changed_field']) {
case 'publisher':
if (isset($_REQUEST['publisherId'])) {
$session['prefs']['GLOBALS']['report_publisher'] = $_REQUEST['publisherId'];
phpAds_SessionDataStore();
}
default:
break;
}
echo "<script type='text/javascript'>window.location='" . $_REQUEST['refresh_page'] . "'</script>";
}
// If the report is for a "specific" period, store the period for later user
if (!is_null($_GET['period_preset']) && $_GET['period_preset'] == 'specific') {
if (!is_null($_GET['period_start'])) {
$session['prefs']['GLOBALS']['startDate'] = $_GET['period_start'] = date('Y-m-d', strtotime($_GET['period_start']));
}
if (!is_null($_GET['period_end'])) {
$session['prefs']['GLOBALS']['endDate'] = $_GET['period_end'] = date('Y-m-d', strtotime($_GET['period_end']));
}
}
示例7: phpAds_SessionDataRegister
function phpAds_SessionDataRegister($key, $value = '')
{
$conf = $GLOBALS['_MAX']['CONF'];
global $session;
//if ($conf['openads']['installed'])
if (OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED) {
phpAds_SessionStart();
}
if (is_array($key) && $value == '') {
foreach (array_keys($key) as $name) {
$session[$name] = $key[$name];
}
} else {
$session[$key] = $value;
}
//if ($conf['openads']['installed'])
if (OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED) {
phpAds_SessionDataStore();
}
}
示例8: saveNewPasswordAndLogin
/**
* Save the new password in the user properties
*
* @param string recovery ID
* @param string new password
* @return bool Ttrue the new password was correctly saved
*/
function saveNewPasswordAndLogin($recoveryId, $password)
{
$doPwdRecovery = OA_Dal::factoryDO('password_recovery');
$doPwdRecovery->recovery_id = $recoveryId;
$doPwdRecoveryClone = clone $doPwdRecovery;
$doPwdRecovery->find();
if ($doPwdRecovery->fetch()) {
$userId = $doPwdRecovery->user_id;
$doPlugin =& OA_Auth::staticGetAuthPlugin();
$doPlugin->setNewPassword($userId, $password);
$doPwdRecoveryClone->delete();
phpAds_SessionStart();
$doUser = OA_Dal::staticGetDO('users', $userId);
phpAds_SessionDataRegister(OA_Auth::getSessionData($doUser));
phpAds_SessionDataStore();
return true;
}
return false;
}
示例9: _checkLoginOld
function _checkLoginOld($tableName, $agencySupport)
{
if (!isset($_COOKIE['sessionID'])) {
return new PEAR_Error($GLOBALS['strEnableCookies']);
}
$prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
$oDbh = OA_DB::singleton();
if (!PEAR::isError($oDbh)) {
$tblPreferences = $oDbh->quoteIdentifier($prefix . $tableName, true);
$query = "SELECT admin, admin_pw FROM {$tblPreferences}";
if ($agencySupport) {
$query .= " WHERE agencyid = 0";
}
$aPref = $oDbh->queryRow($query, null, MDB2_FETCHMODE_ASSOC);
if (is_array($aPref)) {
$oPlugin =& OA_Auth::staticGetAuthPlugin('internal');
$aCredentials = $oPlugin->_getCredentials(false);
if (!PEAR::isError($aCredentials)) {
if (strtolower($aPref['admin']) == strtolower($aCredentials['username']) && $aPref['admin_pw'] == md5($aCredentials['password'])) {
$doUser = OA_Dal::factoryDO('users');
$doUser->username = $aPref['admin'];
$aSession = OA_Auth::getSessionData($doUser, true);
$aSession['user']->aAccount['account_type'] = OA_ACCOUNT_ADMIN;
phpAds_SessionDataRegister($aSession);
}
}
}
// Openads for PostgreSQL 2.0 session.last_used field is a
// timestamp with timezone, which gives troubles reading back
// session data if TZ offset is > 0
if ($tableName == 'config' && $oDbh->dbsyntax == 'pgsql') {
// Make sure that session time is loaded as UTC
$oDbh->exec("SET TIMEZONE TO 'UTC'");
phpAds_SessionDataStore();
$oDbh->exec("SET TIMEZONE TO DEFAULT");
return;
}
phpAds_SessionDataStore();
}
}
示例10: scheduleRun
function scheduleRun()
{
global $session;
if ($GLOBALS['_MAX']['CONF']['priority']['instantUpdate']) {
$session['RUN_MPE'] = true;
phpAds_SessionDataStore();
return true;
}
return false;
}
示例11: removeOneMessage
/**
* Removes from queue the latest message related to a given action. Please
* make sure that if you intend to remove messages you queue them with 'relatedAction'
* parameter set properly.
*
* @param string $relatedAction name of the action which messages should be removed
* @return true if there was any message removed, false otherwise
*/
function removeOneMessage($relatedAction)
{
global $session;
if (empty($relatedAction) || !isset($session['messageQueue']) || !is_array($session['messageQueue']) || !count($session['messageQueue'])) {
return false;
}
$aMessages = $session['messageQueue'];
//filter messages out, if any
$count = count($aMessages);
for ($i = 0; $i < $count; $i++) {
if ($relatedAction == $aMessages[$i]['relatedAction']) {
unset($aMessages[$i]);
$aMessages = array_slice($aMessages, 0);
//a hack to reorder indices after elem was removed
break;
}
}
//if sth was filtered save new queue
if ($count > count($aMessages)) {
$session['messageQueue'] = $aMessages;
// Force session storage
phpAds_SessionDataStore();
}
return $count - count($aMessages);
}
示例12: OA_Start
/**
* Starts or continue existing session
*
* @param unknown_type $checkRedirectFunc
*/
function OA_Start($checkRedirectFunc = null)
{
$conf = $GLOBALS['_MAX']['CONF'];
global $session;
// XXX: Why not try loading session data when OpenX is not installed?
//if ($conf['openads']['installed'])
if (OA_INSTALLATION_STATUS == OA_INSTALLATION_STATUS_INSTALLED) {
phpAds_SessionDataFetch();
}
if (!OA_Auth::isLoggedIn() || OA_Auth::suppliedCredentials()) {
// Required files
include_once MAX_PATH . '/lib/max/language/Loader.php';
// Load the required language files
Language_Loader::load('default');
phpAds_SessionDataRegister(OA_Auth::login($checkRedirectFunc));
$aPlugins = OX_Component::getListOfRegisteredComponentsForHook('afterLogin');
foreach ($aPlugins as $i => $id) {
if ($obj = OX_Component::factoryByComponentIdentifier($id)) {
$obj->afterLogin();
}
}
}
// Overwrite certain preset preferences
if (!empty($session['language']) && $session['language'] != $GLOBALS['pref']['language']) {
$GLOBALS['_MAX']['CONF']['max']['language'] = $session['language'];
}
// Check if manual account switch has happened and migrate to new global variable
if (isset($session['accountSwitch'])) {
$GLOBALS['_OX']['accountSwtich'] = $session['accountSwitch'];
unset($session['accountSwitch']);
phpAds_SessionDataStore();
}
}
示例13: phpAds_SessionGetToken
function phpAds_SessionGetToken()
{
if (OA_INSTALLATION_STATUS != OA_INSTALLATION_STATUS_INSTALLED) {
return false;
}
global $session;
phpAds_SessionStart();
if (empty($session['token'])) {
$session['token'] = md5(uniqid('phpads', 1));
phpAds_SessionDataStore();
}
return $session['token'];
}
示例14: OA_Start
/**
* Starts or continue existing session
*
* @param unknown_type $checkRedirectFunc
*/
function OA_Start($checkRedirectFunc = null)
{
$conf = $GLOBALS['_MAX']['CONF'];
global $session;
// Send no cache headers
MAX_header('Pragma: no-cache');
MAX_header('Cache-Control: no-cache, no-store, must-revalidate');
MAX_header('Expires: 0');
if (RV_INSTALLATION_STATUS == RV_INSTALLATION_STATUS_INSTALLED) {
phpAds_SessionDataFetch();
}
if (!OA_Auth::isLoggedIn() || OA_Auth::suppliedCredentials()) {
// Required files
include_once MAX_PATH . '/lib/max/language/Loader.php';
// Load the required language files
Language_Loader::load('default');
phpAds_SessionDataRegister(OA_Auth::login($checkRedirectFunc));
$aPlugins = OX_Component::getListOfRegisteredComponentsForHook('afterLogin');
foreach ($aPlugins as $i => $id) {
if ($obj = OX_Component::factoryByComponentIdentifier($id)) {
$obj->afterLogin();
}
}
}
// Overwrite certain preset preferences
if (!empty($session['language']) && $session['language'] != $GLOBALS['pref']['language']) {
$GLOBALS['_MAX']['CONF']['max']['language'] = $session['language'];
}
// Check if manual account switch has happened and migrate to new global variable
if (isset($session['accountSwitch'])) {
$GLOBALS['_OX']['accountSwtich'] = $session['accountSwitch'];
unset($session['accountSwitch']);
phpAds_SessionDataStore();
}
}
示例15: clearNotifications
function clearNotifications()
{
global $session;
$session['notificationQueue'] = array();
phpAds_SessionDataStore();
}