$ismodsince = wfTimestamp( TS_MW, strtotime( $modsince ) );
wfDebug( "-- client send If-Modified-Since: " . $modsince . "\n", false );
wfDebug( "-- we might send Last-Modified : $lastmod\n", false );
- if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && !$wgUser->wasLoggedInAt( $ismodsince )) {
+ if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) ) {
# Make sure you're in a place you can leave when you call us!
header( "HTTP/1.0 304 Not Modified" );
$this->mLastModified = $lastmod;
$fname = 'User::loadDefaults' . $n;
wfProfileIn( $fname );
- global $wgContLang, $wgIP;
+ global $wgContLang, $wgIP, $wgDBname;
global $wgNamespacesToBeSearchedDefault;
$this->mId = 0;
unset( $this->mSkin );
$this->mDataLoaded = false;
$this->mBlockedby = -1; # Unset
- $this->mTouched = '0'; # Allow any pages to be cached
$this->setToken(); # Random
$this->mHash = false;
+
+ if ( isset( $_COOKIE[$wgDBname.'LoggedOut'] ) ) {
+ $this->mTouched = wfTimestamp( TS_MW, $_COOKIE[$wgDBname.'LoggedOut'] );
+ }
+ else {
+ $this->mTouched = '0'; # Allow any pages to be cached
+ }
+
wfProfileOut( $fname );
}
} else {
setcookie( $wgDBname.'Token', '', time() - 3600 );
}
-
- # Clear previous logged out time, set logged in time
- setcookie( $wgDBname.'LoggedOut', '', time() - 3600, $wgCookiePath, $wgCookieDomain );
- setcookie( $wgDBname.'LoggedIn', wfTimestampNow(), time() + 86400, $wgCookiePath, $wgCookieDomain );
}
/**
}
return false;
}
-
- /**
- * Check if the user was logged on at a certain timestamp, but no longer is.
- * @param int $timestamp Timestamp to check.
- * @return bool True if user was logged in.
- */
- function wasLoggedInAt( $timestamp ) {
- global $wgDBname;
-
- if ( !$this->getID() && isset( $_COOKIE[$wgDBname.'LoggedIn'] ) && isset( $_COOKIE[$wgDBname.'LoggedOut'] ) )
- return ( $timestamp >= $_COOKIE[$wgDBname.'LoggedIn'] && $timestamp <= $_COOKIE[$wgDBname.'LoggedOut'] );
- else
- return false;
- }
}
?>