本文整理汇总了PHP中phpAds_SessionDataRegister函数的典型用法代码示例。如果您正苦于以下问题:PHP phpAds_SessionDataRegister函数的具体用法?PHP phpAds_SessionDataRegister怎么用?PHP phpAds_SessionDataRegister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phpAds_SessionDataRegister函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _internalLogin
/**
* Login to OpenX without using the login form in the user interface and
* receive a session ID.
*
* @access private
*
* @param string $username
* @param string $password
*
* @return boolean
*/
function _internalLogin($username, $password)
{
// Require the default language file.
include_once MAX_PATH . '/lib/max/language/Loader.php';
// Load the required language file.
Language_Loader::load('default');
$oPlugin = OA_Auth::staticGetAuthPlugin();
$doUser = $oPlugin->checkPassword($username, $password);
if ($doUser) {
phpAds_SessionDataRegister(OA_Auth::getSessionData($doUser));
return true;
} else {
return false;
}
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:26,代码来源:LogonServiceImpl.php
示例2: phpAds_Start
function phpAds_Start()
{
global $phpAds_config;
global $Session;
global $phpAds_productname;
if (!defined('phpAds_installing')) {
phpAds_SessionDataFetch();
}
if (!phpAds_isLoggedIn() || phpAds_SuppliedCredentials()) {
// Load preliminary language settings
@(include phpAds_path . '/language/english/default.lang.php');
if ($phpAds_config['language'] != 'english' && file_exists(phpAds_path . '/language/' . $phpAds_config['language'] . '/default.lang.php')) {
@(include phpAds_path . '/language/' . $phpAds_config['language'] . '/default.lang.php');
}
phpAds_SessionDataRegister(phpAds_Login());
}
// Overwrite certain preset preferences
if (isset($Session['language']) && $Session['language'] != '' && $Session['language'] != $phpAds_config['language']) {
$phpAds_config['language'] = $Session['language'];
}
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:21,代码来源:lib-permissions.inc.php
示例3: ob_flush
if (!isset($session['maint_update'])) {
if (function_exists('xml_parser_create')) {
// Show wait please text with rotating logo
echo "<br />";
echo "<table border='0' cellspacing='1' cellpadding='2'><tr><td>";
echo "<img src='" . OX::assetPath() . "/images/install-busy.gif' width='16' height='16'>";
echo "</td><td class='install'>" . $strSearchingUpdates . "</td></tr></table>";
// Send the output to the browser
if (false !== ob_get_contents()) {
ob_flush();
}
flush();
// Get updates info and store them into a session var
$oSync = new OA_Sync();
$res = $oSync->checkForUpdates();
phpAds_SessionDataRegister('maint_update', $res);
phpAds_SessionDataStore();
echo "<script language='JavaScript'>\n";
echo "<!--\n";
echo "document.location.replace('updates-product.php');\n";
echo "//-->\n";
echo "</script>\n";
exit;
} else {
echo "<br />" . $strNotAbleToCheck . "<br /><br />";
echo "<br /><br />" . $strForUpdatesLookOnWebsite . "<br /><br />";
echo "<b><img src='" . OX::assetPath() . "/images/caret-r.gif'> <a href='http://" . $phpAds_producturl . "' target='_blank'>" . $strClickToVisitWebsite . "</a></b>";
}
} else {
$maint_update = $session['maint_update'];
unset($session['maint_update']);
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:31,代码来源:updates-product.php
示例4: 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;
}
开发者ID:villos,项目名称:tree_admin,代码行数:26,代码来源:PasswordRecovery.php
示例5: switchAccount
/**
* A method to switch the active account to a different one
*
* @static
* @param int $accountId
* @param boolean $hasAccess Can be used for optimization - if we know that user
* has access to the account he is switching to there is
* no need to check it again
*/
public static function switchAccount($accountId, $hasAccess = false)
{
if ($hasAccess || self::hasAccess($accountId)) {
$oUser =& self::getCurrentUser();
$oUser->loadAccountData($accountId);
}
// Force session save
phpAds_SessionDataRegister('user', $oUser);
// If exists previous message related to switchAccount remove it
OA_Admin_UI::removeOneMessage('switchAccount');
// Queue confirmation message
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strYouAreNowWorkingAsX'], array(htmlspecialchars($oUser->aAccount['account_name'])));
OA_Admin_UI::queueMessage($translated_message, 'global', 'info', null, 'switchAccount');
}
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:24,代码来源:Permission.php
示例6: _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();
}
}
开发者ID:villos,项目名称:tree_admin,代码行数:40,代码来源:Login.php
示例7: switch
switch ($phpAds_config['updates_frequency']) {
case -1:
$update_check = false;
break;
case 0:
$update_check = true;
break;
default:
$update_check = $phpAds_config['updates_timestamp'] + $phpAds_config['updates_frequency'] * 60 * 60 * 24 <= time();
break;
}
if ($update_check) {
include 'lib-updates.inc.php';
$update_check = phpAds_checkForUpdates($phpAds_config['updates_last_seen']);
if ($update_check[0]) {
$update_check = false;
}
}
phpAds_SessionDataRegister('update_check', $update_check);
phpAds_SessionDataStore();
// Add Product Update redirector
if ($update_check) {
Header("Content-Type: application/x-javascript");
if ($Session['update_check'][1]['security_fix']) {
echo "\t\t\talert('" . $strUpdateAlertSecurity . "');\n";
} else {
echo "\t\t\tif (confirm('" . $strUpdateAlert . "'))\n\t";
}
echo "\t\tdocument.location.replace('maintenance-updates.php');\n";
}
}
开发者ID:miller-tamil,项目名称:openads-plus,代码行数:31,代码来源:maintenance-updates-js.php
示例8: OA_Sync
}
// If cache timestamp not set or older than 24hrs, re-sync
if (isset($aVars['sync_timestamp']) && $aVars['sync_timestamp'] + 86400 < time()) {
$oSync = new OA_Sync();
$res = $oSync->checkForUpdates();
if ($res[0] == 0) {
$update_check = $res[1];
}
}
if (!is_array($update_check) || $update_check['config_version'] <= $aVars['sync_last_seen']) {
$update_check = false;
} else {
// Make sure that the alert doesn't display everytime
OA_Dal_ApplicationVariables::set('sync_last_seen', $update_check['config_version']);
// Format like the XML-RPC response
$update_check = array(0, $update_check);
}
}
phpAds_SessionDataRegister('maint_update_js', true);
phpAds_SessionDataStore();
// Add Product Update redirector
if (isset($update_check[0]) && $update_check[0] == 0) {
header("Content-Type: application/x-javascript");
if ($update_check[1]['security_fix']) {
echo "alert('" . $strUpdateAlertSecurity . "');\n";
} else {
echo "if (confirm('" . $strUpdateAlert . "'))\n\t";
}
echo "document.location.replace('updates-product.php');\n";
}
}
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:maintenance-updates-js.php
示例9: phpAds_PageFooter
function phpAds_PageFooter()
{
global $phpAds_config;
global $Session, $phpAds_showHelp, $phpAds_helpDefault, $strMaintenanceNotActive;
global $phpAds_TextDirection, $phpAds_TextAlignLeft, $phpAds_TextAlignRight;
echo "</td><td width='40'> </td></tr>";
// Spacer
echo "<tr><td width='40' height='20'> </td>";
echo "<td height='20'> </td></tr>";
// Footer
if (isset($phpAds_config['my_footer']) && $phpAds_config['my_footer'] != '') {
echo "<tr><td width='40' height='20'> </td>";
echo "<td height='20'>";
include $phpAds_config['my_footer'];
echo "</td></tr>";
}
echo "</table>";
echo "</td></tr>";
echo "</table>";
if ($phpAds_showHelp) {
echo "<div id='helpLayer' name='helpLayer' style='position:absolute; left:" . ($phpAds_TextDirection != 'ltr' ? '0' : '181') . "; top:-10; width:10px; height:10px; z-index:1; overflow: hidden; visibility: hidden;'>";
echo "<img id='helpIcon' src='images/help-book.gif' align='absmiddle'>";
echo "<span id='helpContents' name='helpContents'>" . $phpAds_helpDefault . "</span></div>";
echo "<br><br><br><br><br><br>";
}
echo "\n\n";
if (!ereg("/(index|maintenance-updates|install|upgrade)\\.php\$", $_SERVER['PHP_SELF'])) {
// Add Product Update redirector
if (phpAds_isUser(phpAds_Admin) && function_exists('xml_parser_create') && !isset($Session['maint_update_js'])) {
echo "\t<script language='JavaScript' src='maintenance-updates-js.php'></script>\n";
}
// Check if the maintenance script is running
if (phpAds_isUser(phpAds_Admin)) {
if (!isset($Session['maint_not_running_warning']) && $phpAds_config['maintenance_timestamp'] < time() - 60 * 60 * 24) {
if ($phpAds_config['maintenance_timestamp'] > 0) {
phpAds_SessionDataRegister('maint_not_running_warning', true);
// The maintenance script hasn't run in the
// last 24 hours, warn the user
echo "<script language='JavaScript'>\n";
echo "<!--//\n";
echo "\talert('" . $strMaintenanceNotActive . "');\n";
echo "\tlocation.replace('maintenance-maintenance.php');\n";
echo "//-->\n";
echo "</script>";
}
}
}
}
echo "\n</body></html>";
}
开发者ID:henryhe514,项目名称:ChineseCommercial,代码行数:50,代码来源:lib-gui.inc.php
示例10: 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();
}
}
开发者ID:JackyKit,项目名称:revive-adserver,代码行数:38,代码来源:config.php
示例11: phpAds_SessionValidateToken
function phpAds_SessionValidateToken($token)
{
static $result;
if (!isset($result)) {
$result = $token === phpAds_SessionGetToken();
phpAds_SessionDataRegister('token', null);
}
return $result;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:9,代码来源:lib-sessions.inc.php
示例12: 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();
}
}
开发者ID:akirsch,项目名称:revive-adserver,代码行数:40,代码来源:config.php
注:本文中的phpAds_SessionDataRegister函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论