r97917 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97916‎ | r97917 | r97918 >
Date:13:09, 23 September 2011
Author:werdna
Status:ok (Comments)
Tags:todo 
Comment:
LiquidThreads: Submit captcha information, if available
Modified paths:
  • /trunk/extensions/LiquidThreads/api/ApiThreadAction.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/api/ApiThreadAction.php
@@ -183,6 +183,13 @@
184184 $newParent = Threads::withRoot( $article );
185185 }
186186
 187+ if ( isset($params['captchaword']) ) {
 188+ $requestData['captchaword'] = $params['captchaword'];
 189+ }
 190+ if ( isset($params['captchaid']) ) {
 191+ $requestData['captchaid'] = $params['captchaid'];
 192+ }
 193+
187194 global $wgUser;
188195 $errors = $newParent->title()->getUserPermissionsErrors( 'lqt-merge', $wgUser );
189196 if ( $errors ) {
@@ -301,6 +308,14 @@
302309 if ( $wgUser->isAllowed('bot') ) {
303310 $requestData['bot'] = true;
304311 }
 312+
 313+ if ( $params['captchaword'] !== null ) {
 314+ $requestData['captchaword'] = $params['captchaword'];
 315+ }
 316+
 317+ if ( $params['captchaid'] !== null ) {
 318+ $requestData['captchaid'] = $params['captchaid'];
 319+ }
305320
306321 $editReq = new FauxRequest( $requestData, true );
307322 LqtView::fixFauxRequestSession( $editReq );
@@ -421,6 +436,14 @@
422437 if ( $wgUser->isAllowed('bot') ) {
423438 $requestData['bot'] = true;
424439 }
 440+
 441+ if ( $params['captchaword'] !== null ) {
 442+ $requestData['captchaword'] = $params['captchaword'];
 443+ }
 444+
 445+ if ( $params['captchaid'] !== null ) {
 446+ $requestData['captchaid'] = $params['captchaid'];
 447+ }
425448
426449 $editReq = new FauxRequest( $requestData, true );
427450 LqtView::fixFauxRequestSession( $editReq );
@@ -538,6 +561,14 @@
539562 if ( $wgUser->isAllowed('bot') ) {
540563 $requestData['bot'] = true;
541564 }
 565+
 566+ if ( $params['captchaword'] !== null ) {
 567+ $requestData['captchaword'] = $params['captchaword'];
 568+ }
 569+
 570+ if ( $params['captchaid'] !== null ) {
 571+ $requestData['captchaid'] = $params['captchaid'];
 572+ }
542573
543574 $editReq = new FauxRequest( $requestData, true );
544575 LqtView::fixFauxRequestSession( $editReq );
@@ -940,6 +971,8 @@
941972 'method' => null,
942973 'operand' => null,
943974 'gettoken' => null,
 975+ 'captchaword' => null,
 976+ 'captchaid' => null,
944977 );
945978 }
946979
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -1056,6 +1056,14 @@
10571057 'reason' : summary,
10581058 'bump' : bump
10591059 };
 1060+
 1061+ if ( $j('#wpCaptchaWord') ) {
 1062+ newTopicParams.captchaword = $j('#wpCaptchaWord').val();
 1063+ }
 1064+
 1065+ if ( $j('#wpCaptchaId') ) {
 1066+ newTopicParams.captchaid = $j('#wpCaptchaId').val();
 1067+ }
10601068
10611069 if ( typeof signature != 'undefined' ) {
10621070 newTopicParams.signature = signature;
@@ -1085,6 +1093,14 @@
10861094 'reason' : summary,
10871095 'bump' : bump
10881096 };
 1097+
 1098+ if ( $j('#wpCaptchaWord') ) {
 1099+ replyParams.captchaword = $j('#wpCaptchaWord').val();
 1100+ }
 1101+
 1102+ if ( $j('#wpCaptchaId') ) {
 1103+ replyParams.captchaid = $j('#wpCaptchaId').val();
 1104+ }
10891105
10901106 if ( typeof signature != 'undefined' ) {
10911107 replyParams.signature = signature;
@@ -1113,6 +1129,14 @@
11141130 'bump' : bump,
11151131 'subject':subject
11161132 };
 1133+
 1134+ if ( $j('#wpCaptchaWord') ) {
 1135+ request.captchaword = $j('#wpCaptchaWord').val();
 1136+ }
 1137+
 1138+ if ( $j('#wpCaptchaId') ) {
 1139+ request.captchaid = $j('#wpCaptchaId').val();
 1140+ }
11171141
11181142 if ( typeof signature != 'undefined' ) {
11191143 request.signature = signature;

Comments

#Comment by Werdna (talk | contribs)   13:09, 23 September 2011

Only works if $wgSessionsInMemcached is on – the API seems to have a separate session to the UI.

Status & tagging log