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']; } }
function readSession($panDetected) { // 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 ($panDetected) { $oDbh = OA_DB::singleton(); if (!PEAR::isError($oDbh)) { if ($oDbh->dbsyntax == 'pgsql') { // Make sure that session time is loaded as UTC $oDbh->exec("SET TIMEZONE TO 'UTC'"); phpAds_SessionDataFetch(); $oDbh->exec("SET TIMEZONE TO DEFAULT"); return; } } } phpAds_SessionDataFetch(); }
| GNU General Public License for more details. | | | | You should have received a copy of the GNU General Public License | | along with this program; if not, write to the Free Software | | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | +---------------------------------------------------------------------------+ $Id: install-plugin.php 37157 2009-05-28 12:31:10Z andrew.hill $ */ global $installing; $installing = true; require_once '../../init.php'; define('OA_UPGRADE_UPGRADE', 35); define('OA_UPGRADE_INSTALL', 36); // Load session data (required for login check) require_once MAX_PATH . '/www/admin/lib-sessions.inc.php'; phpAds_SessionDataFetch(); // Hack! - Plugins pre 2.7.31 may require [pluginpaths][extensions] to be set $GLOBALS['_MAX']['CONF']['pluginPaths']['extensions'] = $GLOBALS['_MAX']['CONF']['pluginPaths']['plugins']; $GLOBALS['_MAX']['CONF']['pluginPaths']['packages'] = $GLOBALS['_MAX']['CONF']['pluginPaths']['extensions'] . 'etc/'; $aErrors = array(); $result = array('name' => '', 'status' => 'Invalid Request', 'errors' => &$aErrors); if (validRequest($result)) { if ($_REQUEST['status'] === '0') { $result = installPlugin($_REQUEST['plugin']); } else { if ($_REQUEST['status'] === '1') { $result = checkPlugin($_REQUEST['plugin']); } } } // Undo hack
/** * 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(); } }
/** * 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(); } }
/** * Pre Init Session * * @return boolean */ function preInitSession() { global $pref; $oDbh = OA_DB::singleton(); if (PEAR::isError($oDbh)) { $this->raiseError("Could not connect to database"); return false; } // Load the user preferences from the database OA_Preferences::loadPreferences(); // First thing to do is clear the $session variable to // prevent users from pretending to be logged in. unset($GLOBALS['session']); phpAds_SessionDataFetch(); return true; }