function phpAds_Logout()
{
    global $phpAds_config;
    phpAds_SessionDataDestroy();
    // Return to the login screen
    header("Location: index.php");
}
Esempio n. 2
0
 function autoLogin()
 {
     $oPlugin =& OA_Auth::staticGetAuthPlugin();
     phpAds_SessionStart();
     // No auto-login if auth is external
     if (empty($oPlugin) || get_class($oPlugin) != 'Plugins_Authentication') {
         phpAds_SessionDataDestroy();
         return;
     }
     $adminAccountId = OA_Dal_ApplicationVariables::get('admin_account_id');
     if (isset($adminAccountId)) {
         // Fetch the user linked to the admin account
         $doUser = OA_Dal::factoryDO('users');
         $doAUA = OA_Dal::factoryDO('account_user_assoc');
         $doAUA->account_id = $adminAccountId;
         $doUser->joinAdd($doAUA);
         $doUser->find();
         if ($doUser->fetch()) {
             phpAds_SessionDataRegister(OA_Auth::getSessionData($doUser));
             phpAds_SessionDataStore();
         }
     }
 }
 /**
  * Cleans up the session and carry on any additional tasks required to logout the user
  *
  */
 function logout()
 {
     phpAds_SessionDataDestroy();
     $dalAgency = OA_Dal::factoryDAL('agency');
     header("Location: " . $dalAgency->getLogoutUrl(OA_Permission::getAgencyId()));
     exit;
 }
Esempio n. 4
0
 function autoLogin()
 {
     $oPlugin =& OA_Auth::staticGetAuthPlugin();
     phpAds_SessionStart();
     // No auto-login if auth is external
     if (empty($oPlugin) || get_class($oPlugin) != 'Plugins_Authentication') {
         phpAds_SessionDataDestroy();
         return;
     }
     $doUser = OA_Dal::factoryDO('users');
     if (!empty($_COOKIE['oat']) && $_COOKIE['oat'] == OA_UPGRADE_UPGRADE) {
         // Upgrading, fetch the record using the username of the logged in user
         $doUser->username = OA_Permission::getUsername();
     } else {
         // Installing, fetch the user linked to the admin account
         $doAUA = OA_Dal::factoryDO('account_user_assoc');
         $doAUA->account_id = OA_Dal_ApplicationVariables::get('admin_account_id');
         $doUser->joinAdd($doAUA);
     }
     $doUser->find();
     if ($doUser->fetch()) {
         phpAds_SessionDataRegister(OA_Auth::getSessionData($doUser));
         phpAds_SessionDataStore();
     }
 }
 /**
  * Logoff from the session.
  *
  * @access public
  *
  * @param string $sessionId
  *
  * @return boolean
  */
 function logoff($sessionId)
 {
     if ($this->verifySession($sessionId)) {
         phpAds_SessionDataDestroy();
         unset($GLOBALS['session']);
         return !OA_Auth::isLoggedIn();
     } else {
         return false;
     }
 }