r57032 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57031‎ | r57032 | r57033 >
Date:22:30, 28 September 2009
Author:nimishg
Status:ok
Tags:
Comment:
Clicktracking, set up by default now to be off
Modified paths:
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php
@@ -50,6 +50,8 @@
5151 * Adds JavaScript
5252 */
5353 public static function addJS(){
 54+ global $wgOut;
 55+
5456 UsabilityInitiativeHooks::initialize();
5557 UsabilityInitiativeHooks::addScript( 'ClickTracking/ClickTracking.js' );
5658 UsabilityInitiativeHooks::addVariables(
@@ -57,11 +59,9 @@
5860 'wgTrackingToken' => ClickTrackingHooks::get_session_id()
5961 )
6062 );
61 - UsabilityInitiativeHooks::addVariables(
62 - array(
63 - 'wgClickTrackingIsThrottled' => ClickTrackingHooks::isUserThrottled()
64 - )
65 - );
 63+ //need a literal false, not "false" to be output, to work prperly
 64+ $userThrottle = ClickTrackingHooks::isUserThrottled();
 65+ $wgOut->addScript("<script> var wgClickTrackingIsThrottled = $userThrottle; </script>");
6666
6767 return true;
6868
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php
@@ -18,13 +18,10 @@
1919
2020 /* Configuration */
2121
22 -// functions should check if this is set before logging clicktrack events
23 -$wgClickTrackEnabled = true;
24 -
2522 // click throttle, should be seen as "1 out of every $wgClickTrackThrottle users will have it enabled"
2623 // setting this to 1 means all users will have it enabled
2724 // setting to a negative number will disable it for all users
28 -$wgClickTrackThrottle = 1;
 25+$wgClickTrackThrottle = -1;
2926
3027 // set the time window for what we consider 'recent' contributions, in days
3128 $wgClickTrackContribGranularity1 = 60 * 60 * 24 * 365 / 2; // half a year
@@ -61,7 +58,7 @@
6259
6360 //Special page setup
6461 $wgSpecialPages['ClickTracking'] = 'SpecialClickTracking';
65 -$wgSpecialPageGroups['ClickTracking'] = 'admin';
 62+$wgGroupPermissions['sysop']['clicktrack'] = true;
6663
6764 // Adds Internationalized Messages
6865 $wgExtensionMessagesFiles['ClickTracking'] = $dir . 'ClickTracking.i18n.php';

Status & tagging log