r105216 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105215‎ | r105216 | r105217 >
Date:20:24, 5 December 2011
Author:preilly
Status:deferred
Tags:
Comment:
1.18wmf1: MFT r105215
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -88,7 +88,7 @@
8989 }
9090
9191 class ExtMobileFrontend {
92 - const VERSION = '0.5.90';
 92+ const VERSION = '0.5.91';
9393
9494 /**
9595 * @var DOMDocument
@@ -585,6 +585,7 @@
586586 $this->sendXDeviceVaryHeader();
587587 $this->sendApplicationVersionVaryHeader();
588588 $this->checkUserStatus();
 589+ $this->checkUserLoggedIn();
589590
590591 if ( self::$title->isSpecial( 'Userlogin' ) && self::$isBetaGroupMember ) {
591592 self::$wsLoginToken = $wgRequest->getSessionData( 'wsLoginToken' );
@@ -601,6 +602,32 @@
602603 wfProfileOut( __METHOD__ );
603604 return true;
604605 }
 606+
 607+ /**
 608+ * @return bool
 609+ */
 610+ private function checkUserLoggedIn() {
 611+ global $wgUser, $wgCookieDomain, $wgRequest, $wgCookiePrefix;
 612+ wfProfileIn( __METHOD__ );
 613+ $tempWgCookieDomain = $wgCookieDomain;
 614+ $wgCookieDomain = $this->getBaseDomain();
 615+ $tempWgCookiePrefix = $wgCookiePrefix;
 616+ $wgCookiePrefix = '';
 617+
 618+ if ( $wgUser->isLoggedIn() ) {
 619+ $wgRequest->response()->setcookie( 'mfsecure', '1', 0, '' );
 620+ } else {
 621+ $mfSecure = $wgRequest->getCookie( 'mfsecure', '' );
 622+ if ( !empty( $mfSecure ) && $mfSecure == '1' ) {
 623+ $wgRequest->response()->setcookie( 'mfsecure', '', 0, '' );
 624+ }
 625+ }
 626+
 627+ $wgCookieDomain = $tempWgCookieDomain;
 628+ $wgCookiePrefix = $tempWgCookiePrefix;
 629+ wfProfileOut( __METHOD__ );
 630+ return true;
 631+ }
605632
606633 private function checkUserStatus() {
607634 wfProfileIn( __METHOD__ );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105215set mfsecure cookie if user is logged inpreilly20:23, 5 December 2011

Status & tagging log