http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99785
Revision: 99785
Author: preilly
Date: 2011-10-14 18:36:56 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
add beta group support
Modified Paths:
--------------
trunk/extensions/MobileFrontend/MobileFrontend.php
Modified: trunk/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.php 2011-10-14 18:11:26 UTC
(rev 99784)
+++ trunk/extensions/MobileFrontend/MobileFrontend.php 2011-10-14 18:36:56 UTC
(rev 99785)
@@ -87,7 +87,7 @@
}
class ExtMobileFrontend {
- const VERSION = '0.5.76';
+ const VERSION = '0.5.77';
/**
* @var DOMDocument
@@ -127,6 +127,7 @@
public static $displayNoticeId;
public static $leaveFeedbackURL;
public static $mobileRedirectFormAction;
+ public static $isBetaGroupMember = false;
public static $messageKeys = array(
'mobile-frontend-show-button',
@@ -544,6 +545,7 @@
$this->getMsg();
$this->disableCaching();
$this->sendXDeviceVaryHeader();
+ $this->checkUserStatus();
ob_start( array( $this, 'DOMParse' ) );
}
}
@@ -551,6 +553,16 @@
wfProfileOut( __METHOD__ );
return true;
}
+
+ private function checkUserStatus() {
+ wfProfileIn( __METHOD__ );
+ $optInCookie = $this->getOptInOutCookie();
+ if ( !empty( $optInCookie ) &&
+ $optInCookie == 1 ) {
+ self::$isBetaGroupMember = true;
+ }
+ wfProfileOut( __METHOD__ );
+ }
/**
* @param $value string
@@ -564,6 +576,14 @@
$wgCookieDomain = $tempWgCookieDomain;
wfProfileOut( __METHOD__ );
}
+
+ private function getOptInOutCookie() {
+ global $wgRequest;
+ wfProfileIn( __METHOD__ );
+ $optInCookie = $wgRequest->getCookie( 'optin' );
+ wfProfileOut( __METHOD__ );
+ return $optInCookie;
+ }
/**
* @return string
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs