Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php |
— | — | @@ -64,8 +64,11 @@ |
65 | 65 | // Display form for the first time |
66 | 66 | $this->displayForm( $this->errors ); |
67 | 67 | } |
68 | | - } else {//token mismatch |
69 | | - $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 68 | + } else { |
| 69 | + if ( !$this->adapter->isCaching() ) { |
| 70 | + // if we're not caching, there's a token mismatch |
| 71 | + $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 72 | + } |
70 | 73 | $this->displayForm( $this->errors ); |
71 | 74 | } |
72 | 75 | } |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway |
___________________________________________________________________ |
Modified: svn:mergeinfo |
73 | 76 | Reverse-merged /trunk/extensions/DonationInterface/payflowpro_gateway:r102836 |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php |
— | — | @@ -59,6 +59,9 @@ |
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
| 63 | + |
| 64 | + |
| 65 | + |
63 | 66 | $wgOut->addExtensionStyle( |
64 | 67 | $wgExtensionAssetsPath . '/DonationInterface/gateway_forms/css/gateway.css?284' . |
65 | 68 | $this->adapter->getGlobal( 'CSSVersion' ) ); |
— | — | @@ -101,7 +104,12 @@ |
102 | 105 | } //TODO: There really should be an else here. |
103 | 106 | } |
104 | 107 | } |
105 | | - } |
| 108 | + } else { |
| 109 | + if ( !$this->adapter->isCaching() ) { |
| 110 | + // if we're not caching, there's a token mismatch |
| 111 | + $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 112 | + } |
| 113 | + } |
106 | 114 | } |
107 | 115 | |
108 | 116 | /** |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php |
— | — | @@ -178,8 +178,11 @@ |
179 | 179 | |
180 | 180 | $this->displayForm( $this->errors ); |
181 | 181 | } |
182 | | - } else { //token mismatch |
183 | | - $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 182 | + } else { |
| 183 | + if ( !$this->adapter->isCaching() ) { |
| 184 | + // if we're not caching, there's a token mismatch |
| 185 | + $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' ); |
| 186 | + } |
184 | 187 | $this->displayForm( $this->errors ); |
185 | 188 | } |
186 | 189 | } |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -306,20 +306,24 @@ |
307 | 307 | * @return boolean true if match, else false. |
308 | 308 | */ |
309 | 309 | public function checkTokens() { |
310 | | - $checkResult = $this->dataObj->token_checkTokens(); |
| 310 | + if ( !$this->posted ) { |
| 311 | + //we don't care, because we can't possibly have a good one at this |
| 312 | + //point. |
| 313 | + //Additional: If we try for this before we're posted, the squid log |
| 314 | + //caching won't work. |
| 315 | + return true; |
| 316 | + } else { |
| 317 | + $checkResult = $this->dataObj->token_checkTokens(); |
311 | 318 | |
312 | | - if ( $checkResult ) { |
313 | | - if ($this->dataObj->isCaching()){ |
314 | | - $this->debugarray[] = 'Token Not Checked (Caching Enabled)'; |
| 319 | + if ( $checkResult ) { |
| 320 | + $this->debugarray[] = 'Token Match'; |
315 | 321 | } else { |
316 | | - $this->debugarray[] = 'Token Match'; |
| 322 | + $this->debugarray[] = 'Token MISMATCH'; |
317 | 323 | } |
318 | | - } else { |
319 | | - $this->debugarray[] = 'Token MISMATCH'; |
| 324 | + |
| 325 | + $this->refreshGatewayValueFromSource( 'token' ); |
| 326 | + return $checkResult; |
320 | 327 | } |
321 | | - |
322 | | - $this->refreshGatewayValueFromSource( 'token' ); |
323 | | - return $checkResult; |
324 | 328 | } |
325 | 329 | |
326 | 330 | /** |
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php |
— | — | @@ -357,16 +357,11 @@ |
358 | 358 | } |
359 | 359 | } |
360 | 360 | |
361 | | - /** |
362 | | - * Tells us if we think we're in caching mode or not. |
363 | | - * @staticvar string $cache Keeps track of the mode so we don't have to |
364 | | - * calculate it from the data fields more than once. |
365 | | - * @return boolean true if we are going to be caching, false if we aren't. |
366 | | - */ |
| 361 | + |
367 | 362 | function isCaching(){ |
368 | | - |
| 363 | + //I think it's safe to static this here. I don't want to calc this every |
| 364 | + //time some outside object asks if we're caching. |
369 | 365 | static $cache = null; |
370 | | - |
371 | 366 | if ( is_null( $cache ) ){ |
372 | 367 | if ( $this->getVal( '_cache_' ) === 'true' ){ //::head. hit. keyboard.:: |
373 | 368 | if ( $this->isSomething( 'utm_source_id' ) && !is_null( 'utm_source_id' ) ){ |
— | — | @@ -377,13 +372,6 @@ |
378 | 373 | $cache = false; |
379 | 374 | } |
380 | 375 | } |
381 | | - |
382 | | - //this business could change at any second, and it will prevent us from |
383 | | - //caching, so we're going to keep asking if it's set. |
384 | | - if (self::sessionExists()){ |
385 | | - $cache = false; |
386 | | - } |
387 | | - |
388 | 376 | return $cache; |
389 | 377 | } |
390 | 378 | |
— | — | @@ -666,13 +654,6 @@ |
667 | 655 | static $match = null; |
668 | 656 | |
669 | 657 | if ( $match === null ) { |
670 | | - if ( $this->isCaching() ){ |
671 | | - //This makes sense. |
672 | | - //If all three conditions for caching are currently true, the |
673 | | - //last thing we want to do is screw it up by setting a session |
674 | | - //token before the page loads. |
675 | | - return true; |
676 | | - } |
677 | 658 | |
678 | 659 | // establish the edit token to prevent csrf |
679 | 660 | $token = $this->token_getSaltedSessionToken(); |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
680 | 661 | Reverse-merged /trunk/extensions/DonationInterface/gateway_common/DonationData.php:r102836 |
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface |
___________________________________________________________________ |
Modified: svn:mergeinfo |
681 | 662 | Reverse-merged /trunk/extensions/DonationInterface:r102836 |