Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P3303
(An Untitled Masterwork)
Active
Public
Actions
Authored by
Tgr
on Jun 23 2016, 11:22 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F4194692:
Jun 23 2016, 11:22 AM
2016-06-23 11:22:22 (UTC+0)
Subscribers
None
class ExampleSessionProvider extends \MediaWiki\Session\ImmutableSessionProviderWithCookie {
public function provideSessionInfo( WebRequest $request ) {
global $egIpUserMap;
$ip = $request->getIp();
if ( isset( $egIpUserMap[$ip] ) ) {
$user = User::newFromName( $egIpUserMap[$ip] );
if ( $this->sessionCookieName === null ) {
$id = \MWCryptHash::hmac( $this . wfWikiID() . $user->getName() . $this->config->get( 'SecretKey' ), false );
$persisted = false;
$forceUse = true;
} else {
$id = $this->getSessionIdFromCookie( $request );
$persisted = $id !== null;
$forceUse = false;
}
return new SessionInfo( SessionInfo::MAX_PRIORITY, [
'provider' => $this,
'id' => $id,
'userInfo' => UserInfo::newFromUser( $user, true ),
'persisted' => $persisted,
'forceUse' => $forceUse,
] );
}
}
}
Event Timeline
Tgr
created this paste.
Jun 23 2016, 11:22 AM
2016-06-23 11:22:22 (UTC+0)
Pigsonthewing
mentioned this in
T177539: Provide an RDF mapping for external identifiers with third party URIs
.
Oct 5 2017, 9:07 PM
2017-10-05 21:07:10 (UTC+0)
Jheald
mentioned this in
T209697: Provide Mirador service on the Wikimedia Cloud/Toolforge
.
Nov 16 2018, 9:46 PM
2018-11-16 21:46:18 (UTC+0)
99of9
mentioned this in
T253201: show me the web: browser extension
.
Jul 19 2020, 11:52 AM
2020-07-19 11:52:15 (UTC+0)
Log In to Comment