r55428 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55427‎ | r55428 | r55429 >
Date:20:15, 21 August 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Changed name of token variable.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php
@@ -42,9 +42,9 @@
4343 public static function addJS(){
4444 UsabilityInitiativeHooks::initialize();
4545 UsabilityInitiativeHooks::addScript('ClickTracking/ClickTracking.js');
46 - UsabilityInitiativeHooks::addVariables(array(
47 - 'wgEditId' => ClickTrackingHooks::get_session_id()
48 - ));
 46+ UsabilityInitiativeHooks::addVariables(
 47+ array( 'wgTrackingToken' => ClickTrackingHooks::get_session_id() )
 48+ );
4949 return true;
5050 }
5151
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.js
@@ -3,7 +3,7 @@
44
55 // creates 'track action' function to call the clicktracking API and send the ID
66 $.trackAction = function ( id ){
7 - $j.post( wgScriptPath + '/api.php', { 'action': 'clicktracking', 'eventid': id, 'editid': wgEditId } );
 7+ $j.post( wgScriptPath + '/api.php', { 'action': 'clicktracking', 'eventid': id, 'token': wgTrackingToken } );
88 };
99
1010 return $(this);
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php
@@ -9,7 +9,7 @@
1010 class ApiClickTracking extends ApiBase {
1111
1212 /**
13 - * runs when the api is called with "clicktracking", takes in "eventid" and an edit token given to the user, "editid"
 13+ * runs when the api is called with "clicktracking", takes in "eventid" and an edit token given to the user, "token"
1414 * @see includes/api/ApiBase#execute()
1515 */
1616 public function execute(){
@@ -18,7 +18,7 @@
1919 $params = $this->extractRequestParams();
2020 $this->validateParams( $params );
2121 $eventid_to_lookup = $params['eventid'];
22 - $session_id = $params['editid'];
 22+ $session_id = $params['token'];
2323
2424 //Event ID lookup table
2525 $event_id = ClickTrackingHooks::getEventIDFromName(urldecode($eventid_to_lookup));
@@ -44,7 +44,7 @@
4545 * @return unknown_type
4646 */
4747 protected function validateParams( $params ) {
48 - $required = array( 'eventid', 'editid');
 48+ $required = array( 'eventid', 'token');
4949 foreach( $required as $arg ) {
5050 if ( !isset( $params[$arg] ) ) {
5151 $this->dieUsageMsg( array( 'missingparam', $arg ) );
@@ -57,7 +57,7 @@
5858 public function getParamDescription() {
5959 return array(
6060 'eventid' => 'string of eventID',
61 - 'editid' => 'unique edit ID for this edit session'
 61+ 'token' => 'unique edit ID for this edit session'
6262 );
6363 }
6464
@@ -71,7 +71,7 @@
7272 'eventid' => array(
7373 ApiBase::PARAM_TYPE => 'string'
7474 ),
75 - 'editid' => array(
 75+ 'token' => array(
7676 ApiBase::PARAM_TYPE => 'string'
7777 )
7878 );

Status & tagging log