r104717 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104716‎ | r104717 | r104718 >
Date:19:00, 30 November 2011
Author:khorn
Status:ok
Tags:
Comment:
followup r104707
More things that would be useful to know if/when the resultswitcher fails.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -41,9 +41,11 @@
4242 //no longer letting people in without these things. If this is
4343 //preventing you from doing something, you almost certainly want to be
4444 //somewhere else.
 45+ $forbidden = false;
4546 if ( !isset($_GET['order_id']) || !$this->adapter->hasDonorDataInSession( 'order_id', $_GET['order_id'] ) ){
4647 //TODO: i18n, apparently.
4748 wfHttpError( 403, 'Forbidden', 'You do not have permission to access this page.' );
 49+ $forbidden = true;
4850 }
4951
5052 $referrer = $wgRequest->getHeader( 'referer' );
@@ -64,6 +66,23 @@
6567 $this->adapter->getGlobal( 'CSSVersion' ) );
6668
6769 $this->setHeaders();
 70+
 71+ if ( $forbidden ){
 72+ $qs_oid = 'undefined';
 73+ $message = '';
 74+ if ( !isset($_GET['order_id']) ){
 75+ $message = 'No order ID in the Querystring.';
 76+ } else {
 77+ $qs_oid = $_GET['order_id'];
 78+ }
 79+
 80+ if ( !$this->adapter->hasDonorDataInSession( 'order_id', $_GET['order_id'] ) ){
 81+ $message = 'Requested order id not present in the session';
 82+ }
 83+
 84+ $this->adapter->log("Resultswitcher: Request forbidden. " . $message . " Quersytring Oirder ID: $qs_oid");
 85+ return;
 86+ }
6887
6988
7089 // dispatch forms/handling
@@ -99,16 +118,16 @@
100119 $wgOut->addHTML( "<br>Redirecting to page $go" );
101120 $wgOut->redirect( $go );
102121 } else {
103 - $this->adapter->log("Resultswitcher: No redirect defined.");
 122+ $this->adapter->log("Resultswitcher: No redirect defined. Order ID: $oid");
104123 }
105124 } else {
106 - $this->adapter->log("Resultswitcher: No TransactionWMFStatus.");
 125+ $this->adapter->log("Resultswitcher: No TransactionWMFStatus. Order ID: $oid");
107126 }
108127 } else {
109 - $this->adapter->log("Resultswitcher: Payment method is not cc.");
 128+ $this->adapter->log("Resultswitcher: Payment method is not cc. Order ID: $oid");
110129 }
111130 } else {
112 - $this->adapter->log("Resultswitcher: Token Check Failed.");
 131+ $this->adapter->log("Resultswitcher: Token Check Failed. Order ID: $oid");
113132 }
114133 }
115134

Follow-up revisions

RevisionCommit summaryAuthorDate
r104724MFT r103970, r104071, r104224, r104717, r104718khorn19:30, 30 November 2011
r104932followup r104717...khorn00:49, 2 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104707Added lots of log statements to GC's resultswitcher to facilitate solving the...khorn17:31, 30 November 2011

Status & tagging log