r112287 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112286‎ | r112287 | r112288 >
Date:01:29, 24 February 2012
Author:khorn
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/donationinterface_langonly.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/gateway.adapter.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/Form.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/TwoStepAmount.php (deleted) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php
@@ -6,8 +6,3 @@
77 $specialPageAliases['en'] = array(
88 'PayflowProGateway' => array( 'PayflowProGateway' ),
99 );
10 -
11 -/**
12 - * For backwards compatibility with MediaWiki 1.15 and earlier.
13 - */
14 -$aliases =& $specialPageAliases;
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php
___________________________________________________________________
Modified: svn:mergeinfo
1510 Merged /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.alias.php:r107322
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php
@@ -156,7 +156,7 @@
157157 //instantiate a new DonationData that behaves like it's owned by the correct gateway.
158158 $donationDataObj = new DonationData( $gateway_class, false, $tracking_data );
159159 // fetch the order_id
160 - $order_id = $donationDataObj->getVal( 'order_id' );
 160+ $order_id = $donationDataObj->getVal_Escaped( 'order_id' );
161161
162162 // fetch the CSRF prevention token and set it if it's not already set
163163 $token = $donationDataObj->token_getSaltedSessionToken();
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php
___________________________________________________________________
Added: svn:mergeinfo
164164 Merged /trunk/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,96127-97926,97945-99042,99045-99408,99503,99555,99568,99570-101026,101060,101063-101064,101073,101076,101109,101180,101207,101335,101441,101502,101553,101557,101561,101576,101676,101679,101757,101785-101786,101823,101826,101837,101852,101870-101872,101882,101890,101910,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102258-102259,102267,102269,102307,102313,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,103024,103032,103036-103038,103040,103044,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103411,103413,103421,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,104587,104611,105938,107106,107182,107261,107287,107342,107412,107536
165165 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/api_payflowpro_gateway.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
@@ -39,10 +39,10 @@
4040 if ( $this->adapter->posted ) {
4141 // The form was submitted and the payment method has been set
4242 // Check form for errors
43 - $form_errors = $this->validateForm( $this->errors );
 43+ $form_errors = $this->validateForm();
4444 // If there were errors, redisplay form, otherwise proceed to next step
4545 if ( $form_errors ) {
46 - $this->displayForm( $this->errors );
 46+ $this->displayForm();
4747 } else { // The submitted form data is valid, so process it
4848 $result = $this->adapter->do_transaction( 'Card' );
4949
@@ -58,11 +58,12 @@
5959 }
6060 } else {
6161 // Display form for the first time
62 - $this->displayForm( $this->errors );
 62+ $this->displayForm();
6363 }
6464 } else {//token mismatch
65 - $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' );
66 - $this->displayForm( $this->errors );
 65+ $error['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' );
 66+ $this->adapter->addManualError( $error );
 67+ $this->displayForm();
6768 }
6869 }
6970
@@ -83,7 +84,7 @@
8485 }
8586 }
8687
87 - $data = $this->adapter->getData_Raw();
 88+ $data = $this->adapter->getData_Unstaged_Escaped();
8889 $msgPrefix = $data['order_id'] . ' ' . $data['i_order_id'] . ' ';
8990
9091 // if approved, display results and send transaction to the queue
@@ -94,8 +95,9 @@
9596 } elseif ( ( $errorCode == '3' ) && ( $data['numAttempt'] < '5' ) ) {
9697 $this->log( $msgPrefix . "Transaction unsuccessful (invalid info).", LOG_DEBUG );
9798 // pass responseMsg as an array key as required by displayForm
98 - $this->errors['retryMsg'] = $responseMsg;
99 - $this->displayForm( $this->errors );
 99+ $error['retryMsg'] = $responseMsg;
 100+ $this->adapter->addManualError( $error );
 101+ $this->displayForm();
100102 // if declined or if user has already made two attempts, decline
101103 } elseif ( ( $errorCode == '2' ) || ( $data['numAttempt'] >= '3' ) ) {
102104 $this->log( $msgPrefix . "Transaction declined.", LOG_DEBUG );
@@ -108,14 +110,16 @@
109111 $this->fnPayflowDisplayPending( $data, $responseMsg );
110112 } elseif ( strpos( $errorCode, 'internal' ) === 0 ) {
111113 $this->log( $msgPrefix . "Transaction unsuccessful (communication failure).", LOG_DEBUG );
112 - $this->errors['retryMsg'] = $responseMsg;
113 - $this->displayForm( $this->errors );
 114+ $error['retryMsg'] = $responseMsg;
 115+ $this->adapter->addManualError( $error );
 116+ $this->displayForm();
114117 } elseif ( !empty( $errorCode ) ) {
115118 // This should not be hit.
116119 $this->log( $msgPrefix . "Transaction unsuccessful (unknown failure).", LOG_DEBUG );
117120 $this->fnPayflowDisplayOtherResults( $responseMsg );
118 - $this->errors['retryMsg'] = $errorCode;
119 - $this->displayForm( $this->errors );
 121+ $error['retryMsg'] = $errorCode;
 122+ $this->adapter->addManualError( $error );
 123+ $this->displayForm();
120124 }
121125 }
122126
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php
___________________________________________________________________
Modified: svn:mergeinfo
123127 Merged /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.body.php:r105938,107609
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/donationinterface_langonly.php
@@ -38,8 +38,8 @@
3939
4040 // PayflowPro-specific messaging
4141 $wgExtensionMessagesFiles['PayflowProGateway'] = $donationinterface_dir . 'payflowpro_gateway/payflowpro_gateway.i18n.php';
42 -$wgExtensionAliasesFiles['PayflowProGateway'] = $donationinterface_dir . 'payflowpro_gateway/payflowpro_gateway.alias.php';
 42+$wgExtensionMessagesFiles['PayflowProGatewayAlias'] = $donationinterface_dir . 'payflowpro_gateway/payflowpro_gateway.alias.php';
4343
4444 // GlobalCollect-specific messaging
4545 $wgExtensionMessagesFiles['GlobalCollectGateway'] = $donationinterface_dir . 'globalcollect_gateway/globalcollect_gateway.i18n.php';
46 -$wgExtensionAliasesFiles['GlobalCollectGateway'] = $donationinterface_dir . 'globalcollect_gateway/globalcollect_gateway.alias.php';
\ No newline at end of file
 46+$wgExtensionMessagesFiles['GlobalCollectGatewayAlias'] = $donationinterface_dir . 'globalcollect_gateway/globalcollect_gateway.alias.php';
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/donationinterface_langonly.php
___________________________________________________________________
Modified: svn:mergeinfo
4747 Merged /trunk/extensions/DonationInterface/donationinterface_langonly.php:r107299
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php
@@ -59,7 +59,7 @@
6060 $this->gateway_adapter->setValidationAction( $localAction );
6161
6262 $log_msg = '"' . $localAction . "\"\t\"" . $this->risk_score . "\"";
63 - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Filtered', $log_msg );
 63+ $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Filtered', $log_msg );
6464 return TRUE;
6565 }
6666
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php
___________________________________________________________________
Modified: svn:mergeinfo
6767 Merged /trunk/extensions/DonationInterface/extras/custom_filters/custom_filters.body.php:r105938
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php
@@ -21,7 +21,7 @@
2222
2323 public function filter() {
2424 // pull out the source from the filter object
25 - $source = $this->gateway_adapter->getData_Raw( 'utm_source' );
 25+ $source = $this->gateway_adapter->getData_Unstaged_Escaped( 'utm_source' );
2626
2727 // a very complex filtering algorithm for sources
2828 $srcRules = $this->gateway_adapter->getGlobal( 'CustomFiltersSrcRules' );
@@ -38,7 +38,7 @@
3939 $log_msg .= "\t\"" . addslashes( $regex ) . "\"";
4040 $log_msg .= "\t\"" . $this->cfo->risk_score . "\"";
4141 $this->log(
42 - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Filter: Source', $log_msg
 42+ $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Filter: Source', $log_msg
4343 );
4444 }
4545 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php
___________________________________________________________________
Added: svn:mergeinfo
4646 Merged /trunk/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938
4747 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php:r99568
4848 Merged /branches/fundraising/extensions/DonationInterface/extras/custom_filters/filters/source/source.body.php:r98263-100243
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php
@@ -17,7 +17,7 @@
1818 return TRUE;
1919 }
2020
21 - $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Raw() );
 21+ $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Unstaged_Escaped() );
2222 $this->query_minfraud( $minfraud_query );
2323
2424
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php
___________________________________________________________________
Added: svn:mergeinfo
2525 Merged /branches/fundraising/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php:r98263-100243
2626 Merged /trunk/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938
2727 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/minfraud/minfraud.body.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php
@@ -21,7 +21,7 @@
2222
2323 public function filter() {
2424 // pull out the referrer from the gateway_adapter
25 - $referrer = $this->gateway_adapter->getData_Raw( 'referrer' );
 25+ $referrer = $this->gateway_adapter->getData_Unstaged_Escaped( 'referrer' );
2626
2727 // a very complex filtering algorithm for referrers
2828 $refRules = $this->gateway_adapter->getGlobal( 'CustomFiltersRefRules' );
@@ -38,7 +38,7 @@
3939 $log_msg .= "\t\"" . addslashes( $regex ) . "\"";
4040 $log_msg .= "\t\"" . $this->cfo->risk_score . "\"";
4141 $this->log(
42 - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Filter: Referrer', $log_msg
 42+ $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Filter: Referrer', $log_msg
4343 );
4444 }
4545 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php
___________________________________________________________________
Added: svn:mergeinfo
4646 Merged /branches/fundraising/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php:r98263-100243
4747 Merged /trunk/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938
4848 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/custom_filters/filters/referrer/referrer.body.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php
@@ -68,7 +68,7 @@
6969 return TRUE;
7070 }
7171
72 - $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Raw() );
 72+ $minfraud_query = $this->build_query( $this->gateway_adapter->getData_Unstaged_Escaped() );
7373 $this->query_minfraud( $minfraud_query );
7474 $localAction = $this->determine_action( $this->minfraud_response['riskScore'] );
7575 $this->gateway_adapter->setValidationAction( $localAction );
@@ -76,7 +76,7 @@
7777 // reset the data hash
7878 $this->gateway_adapter->unsetHash();
7979 $this->gateway_adapter->setActionHash( $this->generate_hash( $localAction ) );
80 - $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Raw() ) );
 80+ $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Unstaged_Escaped() ) );
8181
8282 // Write the query/response to the log
8383 $this->log_query( $minfraud_query, $localAction );
@@ -88,13 +88,13 @@
8989 */
9090 public function log_query( $minfraud_query, $action ) {
9191 if ( $this->log_fh ) {
92 - $log_message = '"' . addslashes( $this->gateway_adapter->getData_Raw( 'comment' ) ) . '"';
93 - $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Raw( 'amount' ) . ' ' . $this->gateway_adapter->getData_Raw( 'currency_code' ) ) . '"';
 92+ $log_message = '"' . addslashes( $this->gateway_adapter->getData_Unstaged_Escaped( 'comment' ) ) . '"';
 93+ $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Unstaged_Escaped( 'amount' ) . ' ' . $this->gateway_adapter->getData_Unstaged_Escaped( 'currency_code' ) ) . '"';
9494 $log_message .= "\t" . '"' . addslashes( json_encode( $minfraud_query ) ) . '"';
9595 $log_message .= "\t" . '"' . addslashes( json_encode( $this->minfraud_response ) ) . '"';
9696 $log_message .= "\t" . '"' . addslashes( $action ) . '"';
97 - $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Raw( 'referrer' ) ) . '"';
98 - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'minFraud query', $log_message );
 97+ $log_message .= "\t" . '"' . addslashes( $this->gateway_adapter->getData_Unstaged_Escaped( 'referrer' ) ) . '"';
 98+ $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'minFraud query', $log_message );
9999 }
100100 }
101101
@@ -111,7 +111,7 @@
112112 */
113113 public function can_bypass_minfraud() {
114114 // if the data bits data_hash and action are not set, we need to hit minFraud
115 - $localdata = $this->gateway_adapter->getData_Raw();
 115+ $localdata = $this->gateway_adapter->getData_Unstaged_Escaped();
116116 if ( !isset($localdata['data_hash']) || !strlen( $localdata['data_hash'] ) || !isset($localdata['action']) || !strlen( $localdata['action'] ) ) {
117117 return FALSE;
118118 }
@@ -123,7 +123,7 @@
124124 // compare the data hash to make sure it's legit
125125 if ( $this->compare_hash( $data_hash, serialize( $localdata ) ) ) {
126126
127 - $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Raw() ) ); // hash the data array
 127+ $this->gateway_adapter->setHash( $this->generate_hash( $this->gateway_adapter->getData_Unstaged_Escaped() ) ); // hash the data array
128128 // check to see if we have a valid action set for us to bypass minfraud
129129 $actions = array( 'process', 'challenge', 'review', 'reject' );
130130 $action_hash = $localdata['action']; // a hash of the action to take passed in by the form submission
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php
___________________________________________________________________
Added: svn:mergeinfo
131131 Merged /trunk/extensions/DonationInterface/extras/minfraud/minfraud.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938
132132 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/minfraud/minfraud.body.php:r99568
133133 Merged /branches/fundraising/extensions/DonationInterface/extras/minfraud/minfraud.body.php:r98263-100243
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php
@@ -11,7 +11,7 @@
1212 // if the trxn has been outright rejected, log it
1313 if ( $this->gateway_adapter->getValidationAction() == 'reject' ) {
1414 $this->log(
15 - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Rejected'
 15+ $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Rejected'
1616 );
1717 return TRUE;
1818 }
@@ -21,7 +21,7 @@
2222 return FALSE;
2323
2424 $this->log(
25 - $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), "Gateway response: " . addslashes( $this->gateway_adapter->getTransactionMessage() ), '"' . addslashes( json_encode( $this->gateway_adapter->getTransactionData() ) ) . '"'
 25+ $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), "Gateway response: " . addslashes( $this->gateway_adapter->getTransactionMessage() ), '"' . addslashes( json_encode( $this->gateway_adapter->getTransactionData() ) ) . '"'
2626 );
2727 return TRUE;
2828 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php
___________________________________________________________________
Added: svn:mergeinfo
2929 Merged /trunk/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938
3030 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php:r99568
3131 Merged /branches/fundraising/extensions/DonationInterface/extras/conversion_log/conversion_log.body.php:r98263-100243
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php
@@ -42,12 +42,12 @@
4343 $captcha_resp = $this->check_captcha();
4444 if ( $captcha_resp->is_valid ) {
4545 // if validated, update the action and move on
46 - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Captcha passed' );
 46+ $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Captcha passed' );
4747 $this->gateway_adapter->setValidationAction( 'process' );
4848 return TRUE;
4949 } else {
5050 $this->recap_err = $captcha_resp->error;
51 - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Captcha failed' );
 51+ $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Captcha failed' );
5252 }
5353 }
5454 // display captcha
@@ -64,7 +64,7 @@
6565 $useSSL = $this->gateway_adapter->getGlobal( 'RecaptchaUseSSL' );
6666
6767 // log that a captcha's been triggered
68 - $this->log( $this->gateway_adapter->getData_Raw( 'contribution_tracking_id' ), 'Captcha triggered' );
 68+ $this->log( $this->gateway_adapter->getData_Unstaged_Escaped( 'contribution_tracking_id' ), 'Captcha triggered' );
6969
7070 // construct the HTML used to display the captcha
7171 $captcha_html = Xml::openElement( 'div', array( 'id' => 'mw-donate-captcha' ) );
@@ -76,7 +76,7 @@
7777
7878 //TODO: use setValidationErrors and getValidationErrors everywhere, and
7979 //refactor all the form constructors one more time. Eventually.
80 - $data = $this->gateway_adapter->getData_Raw();
 80+ $data = $this->gateway_adapter->getData_Unstaged_Escaped();
8181 $errors = $this->gateway_adapter->getValidationErrors();
8282 $form_obj = new $form_class( $this->gateway_adapter, $errors );
8383
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php
___________________________________________________________________
Added: svn:mergeinfo
8484 Merged /branches/fundraising/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php:r98263-100243
8585 Merged /trunk/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101163,101335,101553,101557,101561,101785,101823,101826,101837,101870-101872,101882,101890,101910,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102186,102188,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,103024,103076,103244,103246,103288,103385,103411,103413,103416,103435,103481,103491,103499-103501,103503,103506,103515,103519,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,105938
8686 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/extras/recaptcha/recaptcha.body.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php
@@ -1,9 +1,8 @@
22 <?php
33
44 class Gateway_Form_TwoColumnLetter2 extends Gateway_Form_OneStepTwoColumn {
5 - public $paypal = false; // true for paypal only version
65
7 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
87 global $wgScriptPath;
98
109 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -11,27 +10,17 @@
1211 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter.css' );
1312 }
1413
15 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1615 }
1716
1817 public function generateFormStart() {
19 - global $wgOut, $wgRequest;
20 -
21 - $this->paypal = $wgRequest->getBool( 'paypal', false );
22 -
2318 $form = parent::generateBannerHeader();
2419
2520 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) );
2621 $form .= Xml::openElement( 'tr' );
2722 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2823
29 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
30 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
31 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
32 -
33 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
34 - // if the template doesn't exist, prevent the display of the red link
35 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 24+ $template = self::generateTextTemplate();
3625 $form .= $template;
3726
3827 $form .= Xml::closeElement( 'td' );
@@ -82,7 +71,7 @@
8372 }
8473
8574 protected function generateBillingFields() {
86 - global $wgScriptPath, $wgRequest;
 75+ global $wgScriptPath;
8776 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
8877
8978 $form = '';
@@ -145,12 +134,8 @@
146135 }
147136
148137 // anonymous
149 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
150 - $form .= '<tr>';
151 - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
152 - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
153 - $form .= '</tr>';
154 -
 138+ $form .= $this->getCommentOptionField();
 139+
155140 // email agreement
156141 $form .= $this->getEmailOptField();
157142
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php
___________________________________________________________________
Added: svn:mergeinfo
158143 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
159144 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php:r99568
160145 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter2.php:r95724-100157
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php
@@ -1,9 +1,8 @@
22 <?php
33
44 class Gateway_Form_TwoColumnLetter3 extends Gateway_Form_OneStepTwoColumn {
5 - public $paypal = false; // true for paypal only version
65
7 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
87 global $wgScriptPath;
98
109 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -11,27 +10,17 @@
1211 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter.css' );
1312 }
1413
15 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1615 }
1716
1817 public function generateFormStart() {
19 - global $wgOut, $wgRequest;
20 -
21 - $this->paypal = $wgRequest->getBool( 'paypal', false );
22 -
2318 $form = parent::generateBannerHeader();
2419
2520 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) );
2621 $form .= Xml::openElement( 'tr' );
2722 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2823
29 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
30 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
31 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
32 -
33 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
34 - // if the template doesn't exist, prevent the display of the red link
35 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 24+ $template = self::generateTextTemplate();
3625 $form .= $template;
3726
3827 $form .= Xml::closeElement( 'td' );
@@ -82,7 +71,7 @@
8372 }
8473
8574 protected function generateBillingFields() {
86 - global $wgScriptPath, $wgRequest;
 75+ global $wgScriptPath;
8776 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
8877
8978 $form = '';
@@ -145,11 +134,7 @@
146135 }
147136
148137 // anonymous
149 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
150 - $form .= '<tr>';
151 - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
152 - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
153 - $form .= '</tr>';
 138+ $form .= $this->getCommentOptionField();
154139
155140 // email agreement
156141 $form .= $this->getEmailOptField();
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php
___________________________________________________________________
Added: svn:mergeinfo
157142 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php:r95724-100157
158143 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
159144 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter3.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php
@@ -1,9 +1,8 @@
22 <?php
33
44 class Gateway_Form_TwoColumnLetter4 extends Gateway_Form_OneStepTwoColumn {
5 - public $paypal = false; // true for paypal only version
65
7 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
87 global $wgScriptPath;
98
109 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -11,27 +10,17 @@
1211 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter4.css' );
1312 }
1413
15 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1615 }
1716
1817 public function generateFormStart() {
19 - global $wgOut, $wgRequest;
20 -
21 - $this->paypal = $wgRequest->getBool( 'paypal', false );
22 -
2318 $form = parent::generateBannerHeader();
2419
2520 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) );
2621 $form .= Xml::openElement( 'tr' );
2722 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2823
29 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
30 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
31 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
32 -
33 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
34 - // if the template doesn't exist, prevent the display of the red link
35 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 24+ $template = self::generateTextTemplate();
3625 $form .= $template;
3726
3827 $form .= Xml::closeElement( 'td' );
@@ -82,7 +71,7 @@
8372 }
8473
8574 protected function generateBillingFields() {
86 - global $wgScriptPath, $wgRequest;
 75+ global $wgScriptPath;
8776 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
8877
8978 $form = '';
@@ -145,11 +134,7 @@
146135 }
147136
148137 // anonymous
149 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
150 - $form .= '<tr>';
151 - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
152 - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
153 - $form .= '</tr>';
 138+ $form .= $this->getCommentOptionField();
154139
155140 // email agreement
156141 $form .= $this->getEmailOptField();
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php
___________________________________________________________________
Added: svn:mergeinfo
157142 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php:r95724-100157
158143 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
159144 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter4.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php
@@ -2,7 +2,7 @@
33
44 class Gateway_Form_TwoColumnLetter5 extends Gateway_Form_OneStepTwoColumn {
55
6 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
77 global $wgScriptPath;
88
99 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -10,11 +10,11 @@
1111 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter5.css' );
1212 }
1313
14 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1515 }
1616
1717 public function generateFormStart() {
18 - global $wgOut, $wgRequest;
 18+ global $wgOut;
1919
2020 $form = parent::generateBannerHeader();
2121
@@ -22,13 +22,7 @@
2323 $form .= Xml::openElement( 'tr' );
2424 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2525
26 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
27 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
28 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
29 -
30 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
31 - // if the template doesn't exist, prevent the display of the red link
32 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 26+ $template = self::generateTextTemplate();
3327 $form .= $template;
3428
3529 $form .= Xml::closeElement( 'td' );
@@ -79,7 +73,7 @@
8074 }
8175
8276 protected function generateBillingFields() {
83 - global $wgScriptPath, $wgRequest;
 77+ global $wgScriptPath;
8478 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
8579
8680 $form = '';
@@ -93,24 +87,24 @@
9488 // amount
9589 $otherChecked = false;
9690 $amount = -1;
97 - if ( $this->form_data['amount'] != 100 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) {
 91+ if ( $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) {
9892 $otherChecked = true;
99 - $amount = $this->form_data['amountOther'];
 93+ $amount = $this->getEscapedValue( 'amountOther' );
10094 }
10195 $form .= '<tr>';
102 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 96+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
10397 $form .= '</tr>';
10498 $form .= '<tr>';
10599 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
106 - $form .= '<td>' . Xml::radio( 'amount', 100, $this->form_data['amount'] == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' .
107 - Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' .
108 - Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' .
109 - Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' .
 100+ $form .= '<td>' . Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' .
 101+ Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' .
 102+ Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' .
 103+ Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' .
110104 '</td>';
111105 $form .= '</tr>';
112106 $form .= '<tr>';
113107 $form .= '<td class="label"></td>';
114 - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) .
 108+ $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) .
115109 ' ' . $this->generateCurrencyDropdown() . '</td>';
116110 $form .= '</tr>';
117111
@@ -121,7 +115,7 @@
122116 $form .= $this->getEmailField();
123117
124118 // email opt-in
125 - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true;
 119+ $email_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'email-opt' ) : true;
126120 $form .= '<tr>';
127121 $form .= '<td class="label"> </td>';
128122 $form .= '<td class="check-option">' . Xml::check( 'email-opt', $email_opt_value );
@@ -132,15 +126,15 @@
133127 $form .= Xml::closeElement( 'label' );
134128 $form .= '</td>';
135129 $form .= '</tr>';
136 -
 130+
137131 $form .= '<tr>';
138132 $form .= '<td class="label">' . wfMsg( 'donate_interface-payment-type' ) . '</td>';
139133 $form .= '<td>' .
140 - Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
141 - Xml::radio( 'card_type', 'cc2', $this->form_data['card_type'] == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' .
142 - Xml::radio( 'card_type', 'cc3', $this->form_data['card_type'] == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' .
143 - Xml::radio( 'card_type', 'cc4', $this->form_data['card_type'] == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
144 - Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
 134+ Xml::radio( 'card_type', 'cc1', $this->getEscapedValue( 'card_type' ) == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
 135+ Xml::radio( 'card_type', 'cc2', $this->getEscapedValue( 'card_type' ) == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' .
 136+ Xml::radio( 'card_type', 'cc3', $this->getEscapedValue( 'card_type' ) == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' .
 137+ Xml::radio( 'card_type', 'cc4', $this->getEscapedValue( 'card_type' ) == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
 138+ Xml::radio( 'card_type', 'pp', $this->getEscapedValue( 'card_type' ) == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
145139 '</td>';
146140 $form .= '</tr>';
147141
@@ -172,22 +166,12 @@
173167 $form .= '</tr>';
174168 $form .= '<tr>';
175169 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-postal' ), 'zip' ) . '</td>';
176 - $form .= '<td>' . Xml::input( 'zip', '15', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) .
 170+ $form .= '<td>' . Xml::input( 'zip', '15', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) .
177171 '</td>';
178172 $form .= '</tr>';
179173 // country
180174 $form .= $this->getCountryField();
181175
182 - /*
183 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
184 - $form .= '<tr>';
185 - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
186 - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
187 - $form .= '</tr>';
188 -
189 - $form .= $this->getEmailOptField();
190 - */
191 -
192176 return $form;
193177 }
194178
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php
___________________________________________________________________
Added: svn:mergeinfo
195179 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php:r95724-100157
196180 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
197181 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter5.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php
@@ -2,7 +2,7 @@
33
44 class Gateway_Form_TwoColumnLetter6 extends Gateway_Form_OneStepTwoColumn {
55
6 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
77 global $wgScriptPath;
88
99 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -10,11 +10,11 @@
1111 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter6.css' );
1212 }
1313
14 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1515 }
1616
1717 public function generateFormStart() {
18 - global $wgOut, $wgRequest;
 18+ global $wgOut;
1919
2020 $form = parent::generateBannerHeader();
2121
@@ -22,13 +22,7 @@
2323 $form .= Xml::openElement( 'tr' );
2424 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2525
26 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
27 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
28 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
29 -
30 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
31 - // if the template doesn't exist, prevent the display of the red link
32 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 26+ $template = self::generateTextTemplate();
3327 $form .= $template;
3428
3529 $form .= Xml::closeElement( 'td' );
@@ -79,7 +73,7 @@
8074 }
8175
8276 protected function generateBillingFields() {
83 - global $wgScriptPath, $wgRequest;
 77+ global $wgScriptPath;
8478 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
8579
8680 $form = '';
@@ -93,29 +87,29 @@
9488 // amount
9589 $otherChecked = false;
9690 $amount = -1;
97 - if ( $this->form_data['amount'] != 100 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) {
 91+ if ( $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) {
9892 $otherChecked = true;
99 - $amount = $this->form_data['amountOther'];
 93+ $amount = $this->getEscapedValue( 'amountOther' );
10094 }
10195 $form .= '<tr>';
102 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 96+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
10397 $form .= '</tr>';
10498 $form .= '<tr>';
10599 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
106 - $form .= '<td>' . Xml::radio( 'amount', 100, $this->form_data['amount'] == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' .
107 - Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' .
108 - Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' .
109 - Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' .
 100+ $form .= '<td>' . Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '100 ' .
 101+ Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '50 ' .
 102+ Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '35 ' .
 103+ Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '20 ' .
110104 '</td>';
111105 $form .= '</tr>';
112106 $form .= '<tr>';
113107 $form .= '<td class="label"></td>';
114 - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) .
 108+ $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ) .
115109 ' ' . $this->generateCurrencyDropdown() . '</td>';
116110 $form .= '</tr>';
117111
118112 // email opt-in
119 - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true;
 113+ $email_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'email-opt' ) : true;
120114 $form .= '<tr>';
121115 $form .= '<td class="label"> </td>';
122116 $form .= '<td class="check-option">' . Xml::check( 'email-opt', $email_opt_value );
@@ -130,17 +124,17 @@
131125 $form .= '<tr>';
132126 $form .= '<td class="label">' . wfMsg( 'donate_interface-payment-type' ) . '</td>';
133127 $form .= '<td>' .
134 - Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
135 - Xml::radio( 'card_type', 'cc2', $this->form_data['card_type'] == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' .
136 - Xml::radio( 'card_type', 'cc3', $this->form_data['card_type'] == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' .
137 - Xml::radio( 'card_type', 'cc4', $this->form_data['card_type'] == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
138 - Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
 128+ Xml::radio( 'card_type', 'cc1', $this->getEscapedValue( 'card_type' ) == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
 129+ Xml::radio( 'card_type', 'cc2', $this->getEscapedValue( 'card_type' ) == 'cc2', array( 'id' => 'cc2radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc2radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' .
 130+ Xml::radio( 'card_type', 'cc3', $this->getEscapedValue( 'card_type' ) == 'cc3', array( 'id' => 'cc3radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc3radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' .
 131+ Xml::radio( 'card_type', 'cc4', $this->getEscapedValue( 'card_type' ) == 'cc4', array( 'id' => 'cc4radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc4radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
 132+ Xml::radio( 'card_type', 'pp', $this->getEscapedValue( 'card_type' ) == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
139133 '</td>';
140134 $form .= '</tr>';
141135
142136 $form .= '</table>';
143137
144 - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
 138+ if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) {
145139 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
146140 } else {
147141 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc', 'style' => 'display: none;' ) );
@@ -180,29 +174,19 @@
181175 $form .= '</tr>';
182176 $form .= '<tr>';
183177 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-postal' ), 'zip' ) . '</td>';
184 - $form .= '<td>' . Xml::input( 'zip', '15', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) .
 178+ $form .= '<td>' . Xml::input( 'zip', '15', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'maxlength' => '15', 'id' => 'zip' ) ) .
185179 '</td>';
186180 $form .= '</tr>';
187181 // country
188182 $form .= $this->getCountryField();
189183
190 - /*
191 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
192 - $form .= '<tr>';
193 - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
194 - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
195 - $form .= '</tr>';
196 -
197 - $form .= $this->getEmailOptField();
198 - */
199 -
200184 return $form;
201185 }
202186
203187 public function generateFormSubmit() {
204188
205189 // cc submit button
206 - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
 190+ if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) {
207191 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) );
208192 } else {
209193 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit', 'style' => 'display: none;' ) );
@@ -216,7 +200,7 @@
217201 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
218202
219203 // paypal submit button
220 - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
 204+ if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) {
221205 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal', 'style' => 'display: none;' ) );
222206 } else {
223207 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) );
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php
___________________________________________________________________
Added: svn:mergeinfo
224208 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php:r95724-100157
225209 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
226210 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter6.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class Gateway_Form_TwoStepTwoColumnLetter extends Gateway_Form_TwoStepTwoColumn {
5 - public function __construct( &$gateway, &$form_errors ) {
 5+ public function __construct( &$gateway ) {
66 global $wgScriptPath;
77
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -9,11 +9,11 @@
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter.css' );
1111 }
1212
13 - parent::__construct( $gateway, $form_errors );
 13+ parent::__construct( $gateway );
1414 }
1515
1616 public function generateFormStart() {
17 - global $wgOut, $wgRequest;
 17+ global $wgOut;
1818
1919 $form = parent::generateBannerHeader();
2020
@@ -21,13 +21,7 @@
2222 $form .= Xml::openElement( 'tr' );
2323 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2424
25 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
26 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
27 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
28 -
29 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
30 - // if the template doesn't exist, prevent the display of the red link
31 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 25+ $template = self::generateTextTemplate();
3226 $form .= $template;
3327
3428 $form .= Xml::closeElement( 'td' );
@@ -90,16 +84,16 @@
9185
9286 // amount
9387 $form .= '<tr>';
94 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 88+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
9589 $form .= '</tr>';
9690 $form .= '<tr>';
9791 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
98 - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
 92+ $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
9993 ' ' . $this->generateCurrencyDropdown() . '</td>';
10094 $form .= '</tr>';
10195
10296 // card logos
103 - if ( $this->form_data[ 'currency_code' ] == 'USD' ) {
 97+ if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) {
10498 $form .= '<tr id="four_cards" style="display:table-row;">';
10599 $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>';
106100 $form .= '</tr>';
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php
___________________________________________________________________
Added: svn:mergeinfo
107101 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php:r95724-100157
108102 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
109103 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php
@@ -2,7 +2,7 @@
33
44 class Gateway_Form_TwoColumnLetter7 extends Gateway_Form_OneStepTwoColumn {
55
6 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
77 global $wgScriptPath;
88
99 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -10,7 +10,7 @@
1111 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter7.css' );
1212 }
1313
14 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1515 }
1616
1717 public function loadPlaceholders() {
@@ -135,7 +135,7 @@
136136 }
137137
138138 public function generateFormStart() {
139 - global $wgOut, $wgRequest;
 139+ global $wgOut;
140140
141141 $form = parent::generateBannerHeader();
142142
@@ -143,13 +143,7 @@
144144 $form .= Xml::openElement( 'tr' );
145145 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
146146
147 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
148 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
149 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
150 -
151 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
152 - // if the template doesn't exist, prevent the display of the red link
153 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 147+ $template = self::generateTextTemplate();
154148 $form .= $template;
155149
156150 $form .= Xml::closeElement( 'td' );
@@ -214,63 +208,49 @@
215209 // amount
216210 $otherChecked = false;
217211 $amount = -1;
218 - if ( $this->form_data['amount'] != 250 && $this->form_data['amount'] != 150 && $this->form_data['amount'] != 100 && $this->form_data['amount'] != 75 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) {
 212+ if ( $this->getEscapedValue( 'amount' ) != 250 && $this->getEscapedValue( 'amount' ) != 150 && $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 75 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) {
219213 $otherChecked = true;
220 - $amount = $this->form_data['amountOther'];
 214+ $amount = $this->getEscapedValue( 'amountOther' );
221215 }
222216 $form .= '<tr>';
223 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 217+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
224218 $form .= '</tr>';
225219 $form .= '<tr>';
226220 $form .= '<td class="label"><div style="padding-top:4px;">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</div></td>';
227221 $form .= '<td>' .
228222 '<table cellspacing="3" cellpadding="0" border="0" style="margin-bottom:0.2em;"><tr>' .
229 - '<td>'.Xml::radio( 'amount', 20, $this->form_data['amount'] == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$20 '.'</td>'.
230 - '<td>'.Xml::radio( 'amount', 35, $this->form_data['amount'] == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$35 '.'</td>'.
231 - '<td>'.Xml::radio( 'amount', 50, $this->form_data['amount'] == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$50 '.'</td>'.
232 - '<td>'.Xml::radio( 'amount', 75, $this->form_data['amount'] == 75, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$75 '.'</td>'.
 223+ '<td>'.Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$20 '.'</td>'.
 224+ '<td>'.Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$35 '.'</td>'.
 225+ '<td>'.Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$50 '.'</td>'.
 226+ '<td>'.Xml::radio( 'amount', 75, $this->getEscapedValue( 'amount' ) == 75, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$75 '.'</td>'.
233227 '</tr><tr>' .
234 - '<td>'.Xml::radio( 'amount', 100, $this->form_data['amount'] == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$100 '.'</td>'.
235 - '<td>'.Xml::radio( 'amount', 150, $this->form_data['amount'] == 150, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$150 '.'</td>'.
236 - '<td>'.Xml::radio( 'amount', 250, $this->form_data['amount'] == 250, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$250 '.'</td>'.
237 - '<td>'.Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ).Html::hidden( 'currency_code', 'USD' ).'</td>'.
 228+ '<td>'.Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$100 '.'</td>'.
 229+ '<td>'.Xml::radio( 'amount', 150, $this->getEscapedValue( 'amount' ) == 150, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$150 '.'</td>'.
 230+ '<td>'.Xml::radio( 'amount', 250, $this->getEscapedValue( 'amount' ) == 250, array( 'onfocus' => 'clearField2( document.getElementById(\'amountOther\'), "Other" )' ) ) . '$250 '.'</td>'.
 231+ '<td>'.Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField(this, "Other");document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'onblur' => 'document.getElementById("otherRadio").value = this.value;', 'id' => 'amountOther' ) ).Html::hidden( 'currency_code', 'USD' ).'</td>'.
238232 '</tr></table>' .
239233 '</td>';
240234 $form .= '</tr>';
241235
242 - // email opt-in
243 - /*
244 - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true;
245 - $form .= '<tr>';
246 - $form .= '<td class="label"> </td>';
247 - $form .= '<td class="check-option">' . Xml::check( 'email-opt', $email_opt_value );
248 - $form .= ' ';
249 - $form .= Xml::openElement( 'label', array( 'for' => 'email-opt' ) );
250 - $form .= wfMsg( 'donate_interface-email-agreement' );
251 - $form .= Xml::closeElement( 'label' );
252 - $form .= '</td>';
253 - $form .= '</tr>';
254 - */
255 -
256236 // Payment type
257237 $form .= '<tr>';
258238 $form .= '<td class="label""><div style="padding-top:9px;">' . wfMsg( 'donate_interface-payment-type' ) . '</div></td>';
259239 $form .= '<td>' .
260240 '<p style="border: 1px solid rgb(187, 187, 187); float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0 8px 0 0; padding: 5px 5px 5px 3px; white-space: nowrap;">'.
261 - Xml::radio( 'card_type', 'cc1', $this->form_data['card_type'] == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
 241+ Xml::radio( 'card_type', 'cc1', $this->getEscapedValue( 'card_type' ) == 'cc1', array( 'id' => 'cc1radio', 'onclick' => 'switchToCreditCard()' ) ) . '<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-visa.png" ) ). '</label>' .
262242 '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-mastercard.png" ) ). '</label>' .
263243 '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-amex.png" ) ). '</label>' .
264244 '&#160;<label for="cc1radio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-discover.png" ) ). '</label>' .
265245 '</p>'.
266246 '<p style="border: 1px solid transparent; float: left; -moz-border-radius: 5px 5px 5px 5px; margin: 0; padding: 5px 5px 5px 3px; white-space: nowrap;">'.
267 - Xml::radio( 'card_type', 'pp', $this->form_data['card_type'] == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
 247+ Xml::radio( 'card_type', 'pp', $this->getEscapedValue( 'card_type' ) == 'pp', array( 'id' => 'ppradio', 'onclick' => 'switchToPayPal()' ) ) . '<label for="ppradio">' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/card-paypal.png" ) ) . '</label>' .
268248 '</p>'.
269249 '</td>';
270250 $form .= '</tr>';
271251
272252 $form .= '</table>';
273253
274 - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
 254+ if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) {
275255 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
276256 } else {
277257 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc', 'style' => 'display: none;' ) );
@@ -302,8 +282,8 @@
303283 $form .= '</tr>';
304284 $form .= '<tr>';
305285 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-name-on-card' ), 'fname' ) . '</td>';
306 - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
307 - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
 286+ $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
 287+ Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
308288 $form .= "</tr>";
309289
310290 // street
@@ -312,7 +292,7 @@
313293 $form .= '</tr>';
314294 $form .= '<tr>';
315295 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-billing-address' ), 'street' ) . '</td>';
316 - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
 296+ $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
317297 '</td>';
318298 $form .= '</tr>';
319299
@@ -322,9 +302,9 @@
323303 $form .= '</tr>';
324304 $form .= '<tr>';
325305 $form .= '<td class="label"> </td>';
326 - $form .= '<td>' . Xml::input( 'city', '18', $this->form_data['city'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' .
 306+ $form .= '<td>' . Xml::input( 'city', '18', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' .
327307 $this->generateStateDropdown() . ' ' .
328 - Xml::input( 'zip', '5', $this->form_data['zip'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) .
 308+ Xml::input( 'zip', '5', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) .
329309 Html::hidden( 'country', 'US' ) .
330310 '</td>';
331311 $form .= '</tr>';
@@ -346,21 +326,11 @@
347327 $form .= '</tr>';
348328 $form .= '<tr>';
349329 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-email-receipt' ), 'emailAdd' ) . '</td>';
350 - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
 330+ $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
351331 Html::hidden( 'email-opt', 1 ) .
352332 '</td>';
353333 $form .= '</tr>';
354334
355 - /*
356 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
357 - $form .= '<tr>';
358 - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
359 - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
360 - $form .= '</tr>';
361 -
362 - $form .= $this->getEmailOptField();
363 - */
364 -
365335 return $form;
366336 }
367337
@@ -368,7 +338,7 @@
369339 global $wgScriptPath;
370340
371341 // cc submit button
372 - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
 342+ if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) {
373343 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) );
374344 } else {
375345 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit', 'style' => 'display: none;' ) );
@@ -382,7 +352,7 @@
383353 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
384354
385355 // paypal submit button
386 - if ( $this->form_data['card_type'] == 'cc1' || $this->form_data['card_type'] == 'cc2' || $this->form_data['card_type'] == 'cc3' || $this->form_data['card_type'] == 'cc4' ) {
 356+ if ( $this->getEscapedValue( 'card_type' ) == 'cc1' || $this->getEscapedValue( 'card_type' ) == 'cc2' || $this->getEscapedValue( 'card_type' ) == 'cc3' || $this->getEscapedValue( 'card_type' ) == 'cc4' ) {
387357 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal', 'style' => 'display: none;' ) );
388358 } else {
389359 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) );
@@ -439,7 +409,7 @@
440410 // generate dropdown of state opts
441411 foreach ( $states as $value => $state_name ) {
442412 if ( $value !== 'YY' && $value !== 'XX' ) {
443 - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false;
 413+ $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false;
444414 $state_opts .= Xml::option( $value, $value, $selected );
445415 }
446416 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php
___________________________________________________________________
Added: svn:mergeinfo
447417 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php:r95724-100157
448418 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
449419 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter7.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php
@@ -1,8 +1,8 @@
22 <?php
33
44 class Gateway_Form_TwoColumnPayPal extends Gateway_Form_OneStepTwoColumn {
5 - public function __construct( &$gateway, &$form_errors ) {
6 - parent::__construct( $gateway, $form_errors );
 5+ public function __construct( &$gateway ) {
 6+ parent::__construct( $gateway );
77 }
88
99 public function generateFormStart() {
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php
___________________________________________________________________
Added: svn:mergeinfo
1010 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php:r95724-100157
1111 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,107609
1212 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnPayPal.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php
@@ -2,7 +2,7 @@
33
44 class Gateway_Form_SingleColumn extends Gateway_Form_TwoColumnLetter {
55
6 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
77 global $wgScriptPath;
88
99 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -10,7 +10,7 @@
1111 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/SingleColumn.css' );
1212 }
1313
14 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1515 }
1616
1717 public function generateFormEnd() {
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php
___________________________________________________________________
Added: svn:mergeinfo
1818 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/SingleColumn.php:r95724-100157
1919 Merged /trunk/extensions/DonationInterface/gateway_forms/SingleColumn.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,107609
2020 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/SingleColumn.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class Gateway_Form_TwoStepTwoColumnLetterCA extends Gateway_Form_TwoStepTwoColumn {
5 - public function __construct( &$gateway, &$form_errors ) {
 5+ public function __construct( &$gateway ) {
66 global $wgScriptPath;
77
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -9,11 +9,11 @@
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter.css' );
1111 }
1212
13 - parent::__construct( $gateway, $form_errors );
 13+ parent::__construct( $gateway );
1414 }
1515
1616 public function generateFormStart() {
17 - global $wgOut, $wgRequest;
 17+ global $wgOut;
1818
1919 $form = parent::generateBannerHeader();
2020
@@ -21,13 +21,7 @@
2222 $form .= Xml::openElement( 'tr' );
2323 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2424
25 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
26 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
27 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
28 -
29 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
30 - // if the template doesn't exist, prevent the display of the red link
31 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 25+ $template = self::generateTextTemplate();
3226 $form .= $template;
3327
3428 $form .= Xml::closeElement( 'td' );
@@ -90,16 +84,16 @@
9185
9286 // amount
9387 $form .= '<tr>';
94 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 88+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
9589 $form .= '</tr>';
9690 $form .= '<tr>';
9791 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
98 - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
 92+ $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
9993 ' ' . $this->generateCurrencyDropdown( 'CAD' ) . '</td>';
10094 $form .= '</tr>';
10195
10296 // card logos
103 - if ( $this->form_data[ 'currency_code' ] == 'USD' ) {
 97+ if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) {
10498 $form .= '<tr id="four_cards" style="display:table-row;">';
10599 $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>';
106100 $form .= '</tr>';
@@ -182,7 +176,7 @@
183177
184178 // generate dropdown of state opts
185179 foreach ( $states as $value => $state_name ) {
186 - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false;
 180+ $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false;
187181 $state_opts .= Xml::option( wfMsg( 'donate_interface-province-dropdown-' . $value ), $value, $selected );
188182 }
189183
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php
___________________________________________________________________
Added: svn:mergeinfo
190184 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php:r95724-100157
191185 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
192186 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetterCA.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/Form.php
@@ -15,30 +15,19 @@
1616 public $hidden_fields;
1717
1818 /**
19 - * An array of form data, collected from the gateway parameter.
20 - * @var array
21 - */
22 - public $form_data;
23 -
24 - /**
2519 * The id of the form.
2620 *
2721 * This should also be the name of the form
2822 *
2923 * @var string
3024 */
 25+ //TODO: Determine what this is, and either take measures to reference
 26+ //something closer to the source data via the gateway object, or get rid of
 27+ //it. If this is (as the comment suggests) also the name of the form,
 28+ //my vote goes for option 2.
3129 public $form_id = 'payment';
3230
3331 /**
34 - * The name of the form.
35 - *
36 - * This should also be the id of the form
37 - *
38 - * @var string
39 - */
40 - public $form_name = 'payment';
41 -
42 - /**
4332 * An array of form errors, passed from the payflow pro object
4433 * @var array
4534 */
@@ -55,20 +44,14 @@
5645 * @var string
5746 */
5847 protected $captcha_html;
59 -
 48+
6049 /**
61 - * The payment method
62 - * @var string
 50+ * Tells us if we're paypal only or not.
 51+ * @var boolean
6352 */
64 - protected $payment_method = '';
 53+ public $paypal = false; // true for paypal only version
6554
6655 /**
67 - * The payment submethod
68 - * @var string
69 - */
70 - protected $payment_submethod = '';
71 -
72 - /**
7356 * Required method for returning the full HTML for a form.
7457 *
7558 * Code invoking forms will expect this method to be set. Requiring only
@@ -79,13 +62,17 @@
8063 */
8164 abstract function getForm();
8265
83 - public function __construct( &$gateway, &$error ) {
84 - global $wgOut;
 66+ public function __construct( &$gateway ) {
 67+ global $wgOut, $wgRequest;
8568
8669 $this->gateway = & $gateway;
8770 $this->test = $this->gateway->getGlobal( "Test" );
88 - $this->form_data = $this->gateway->getData_Raw();
89 - $this->form_errors = & $error;
 71+ $gateway_errors = $this->gateway->getAllErrors();
 72+ if ( !is_array( $gateway_errors ) ){
 73+ $gateway_errors = array();
 74+ }
 75+ $this->form_errors = array_merge( DataValidator::getEmptyErrorArray(), $gateway_errors );
 76+ $this->paypal = $wgRequest->getBool( 'paypal', false );
9077
9178 /**
9279 * add form-specific css - the path can be set in child classes
@@ -119,14 +106,15 @@
120107
121108 /**
122109 * Initialize the form
123 - *
 110+ * Called by the main Form construtror, this was clearly meant to be
 111+ * overridden where necessary in child classes.
124112 */
125113 protected function init() {
126114 }
127115
128116 /**
129 - * Override the link in the logo to redirec to a particular form
130 - * rather than the main page
 117+ * Override the link in the logo to redirect to a particular form
 118+ * rather than the main page. Called by the form class constructor.
131119 */
132120 public function loadLogoLinkOverride() {
133121 global $wgOut;
@@ -160,6 +148,7 @@
161149
162150 /**
163151 * Generates the donation footer ("There are other ways to give...")
 152+ * This function is not used by any RapidHTML forms.
164153 * @return string of HTML
165154 */
166155 public function generateDonationFooter() {
@@ -184,6 +173,7 @@
185174
186175 /**
187176 * Generate the menu select of countries
 177+ * This function is not used by any RapidHTML forms.
188178 * @fixme It would be great if we could default the country to the user's locale
189179 * @fixme We should also do a locale-based asort on the country dropdown
190180 * (see http://us.php.net/asort)
@@ -202,10 +192,10 @@
203193
204194 // generate a dropdown option for each country
205195 foreach ( $countries as $iso_value => $full_name ) {
206 - // Note: If the server has the php5-geoip package, $this->form_data['country'] will
 196+ // Note: If the server has the php5-geoip package, $this->getEscapedValue( 'country' ) will
207197 // always have a value.
208 - if ( $this->form_data['country'] ) {
209 - $selected = ( $iso_value == $this->form_data['country'] ) ? true : false;
 198+ if ( $this->getEscapedValue( 'country' ) ) {
 199+ $selected = ( $iso_value == $this->getEscapedValue( 'country' ) ) ? true : false;
210200 } else {
211201 $selected = ( $iso_value == $defaultCountry ) ? true : false; // Select default
212202 }
@@ -227,7 +217,9 @@
228218 }
229219
230220 /**
231 - * Genereat the menu select of credit cards
 221+ * Generate the menu select of credit cards
 222+ * getCreditCardTypeField helper function, and getCreditCardTypeField is
 223+ * only used by TwoStepTwoColumn.php.
232224 *
233225 * @fixme Abstract out the setting of avaiable cards
234226 * @return string
@@ -245,7 +237,7 @@
246238 // generate a dropdown opt for each card
247239 foreach ( $available_cards as $value => $card_name ) {
248240 // only load the card value if we're in testing mode
249 - $selected = ( $value == $this->form_data['card_type'] && $this->test ) ? true : false;
 241+ $selected = ( $value == $this->getEscapedValue( 'card_type' ) && $this->test ) ? true : false;
250242 $card_options .= Xml::option( $card_name, $value, $selected );
251243 }
252244
@@ -262,13 +254,19 @@
263255 return $card_menu;
264256 }
265257
 258+ /**
 259+ * Generates the expiry month dropdown form element.
 260+ * This function is not used by any RapidHTML forms.
 261+ * @global type $wgLang
 262+ * @return type
 263+ */
266264 public function generateExpiryMonthDropdown() {
267265 global $wgLang;
268266
269267 // derive the previously set expiry month, if set
270268 $month = NULL;
271 - if ( $this->form_data['expiration'] ) {
272 - $month = substr( $this->form_data['expiration'], 0, 2 );
 269+ if ( $this->getEscapedValue( 'expiration' ) ) {
 270+ $month = substr( $this->getEscapedValue( 'expiration' ), 0, 2 );
273271 }
274272
275273 $expiry_months = '';
@@ -293,11 +291,17 @@
294292 return $expiry_month_menu;
295293 }
296294
 295+ /**
 296+ * Generates the expiry year dropdown form element.
 297+ * This function is not used by any RapidHTML forms.
 298+ * @global type $wgLang
 299+ * @return type
 300+ */
297301 public function generateExpiryYearDropdown() {
298302 // derive the previously set expiry year, if set
299303 $year = NULL;
300 - if ( $this->form_data['expiration'] ) {
301 - $year = substr( $this->form_data['expiration'], 2, 2 );
 304+ if ( $this->getEscapedValue( 'expiration' ) ) {
 305+ $year = substr( $this->getEscapedValue( 'expiration' ), 2, 2 );
302306 }
303307
304308 $expiry_years = '';
@@ -322,6 +326,7 @@
323327
324328 /**
325329 * Generates the dropdown for states
 330+ * This function is not used by any RapidHTML forms.
326331 * @fixme Alpha sort (ideally locale alpha sort) states in dropdown
327332 * AFTER state names are translated
328333 * @return string The entire HTML select element for the state dropdown list
@@ -335,7 +340,7 @@
336341
337342 // generate dropdown of state opts
338343 foreach ( $states as $value => $state_name ) {
339 - $selected = ( $this->form_data['state'] == $value ) ? true : false;
 344+ $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false;
340345 $state_opts .= Xml::option( wfMsg( 'donate_interface-state-dropdown-' . $value ), $value, $selected );
341346 }
342347
@@ -353,6 +358,7 @@
354359
355360 /**
356361 * Generates the dropdown list for available currencies
 362+ * This function is not used by any RapidHTML forms.
357363 *
358364 * @param string $defaultCurrencyCode default currency code to select
359365 * @param boolean $showCardsOnCurrencyChange Allow javascript onchange="showCards();" to be executed.
@@ -368,8 +374,8 @@
369375 $availableCurrencies = $this->gateway->getCurrencies();
370376
371377 // If a currency has already been posted, use that, otherwise use the default.
372 - if ( $this->form_data['currency_code'] ) {
373 - $selectedCurrency = $this->form_data['currency_code'];
 378+ if ( $this->getEscapedValue( 'currency_code' ) ) {
 379+ $selectedCurrency = $this->getEscapedValue( 'currency_code' );
374380 } else {
375381 $selectedCurrency = $defaultCurrencyCode;
376382 }
@@ -409,12 +415,16 @@
410416
411417 /**
412418 * Generates the radio buttons for selecting a donation amount
 419+ * This function appears to be used only by the Universal Test form, and as
 420+ * such should be moved to that class and away from the class all the forms
 421+ * are eventually descended from.
413422 *
414423 * @param array $options
415424 *
416425 * $options:
417426 * - displayCurrencyDropdown: Display the currency dropdown selector
418427 * - showCardsOnCurrencyChange: Passed to @see Gateway_Form::generateStateDropdown()
 428+ * - setCurrency: ???
419429 *
420430 * @todo
421431 * - Use Xml object to generate form elements.
@@ -423,6 +433,7 @@
424434 */
425435 public function generateAmountByRadio( $options = array() ) {
426436
 437+ //TODO: Stop using extract.
427438 extract( $options );
428439
429440 $showCardsOnCurrencyChange = isset( $showCardsOnCurrencyChange ) ? (boolean) $showCardsOnCurrencyChange : true;
@@ -430,7 +441,7 @@
431442 $setCurrency = isset( $setCurrency ) ? (string) $setCurrency : '';
432443 $displayCurrencyDropdown = empty( $setCurrency ) ? $displayCurrencyDropdown : false;
433444
434 - $amount = isset( $this->form_data['amount'] ) ? (string) $this->form_data['amount'] : '0';
 445+ $amount = !is_null( $this->getEscapedValue( 'amount' ) ) ? (string) $this->getEscapedValue( 'amount' ) : '0';
435446
436447 // Treat values as string for comparison
437448 $amountValues = array('5', '10', '20', '35', '50', '100', '250',);
@@ -483,38 +494,38 @@
484495
485496 /**
486497 * Set the hidden field array
487 - *
488498 * If you pass nothing in, we'll set the fields for you.
 499+ * This function is not used by any RapidHTML forms.
489500 * @param array $hidden_fields
490501 */
491502 public function setHiddenFields( $hidden_fields = NULL ) {
492503 if ( !$hidden_fields ) {
493504 $hidden_fields = array(
494 - 'utm_source' => $this->form_data['utm_source'],
495 - 'utm_medium' => $this->form_data['utm_medium'],
496 - 'utm_campaign' => $this->form_data['utm_campaign'],
497 - 'language' => $this->form_data['language'],
498 - 'referrer' => $this->form_data['referrer'],
499 - 'comment' => $this->form_data['comment'],
500 - 'comment-option' => $this->form_data['comment-option'],
501 - 'email-opt' => $this->form_data['email-opt'],
502 - 'size' => $this->form_data['size'],
503 - 'premium_language' => $this->form_data['premium_language'],
 505+ 'utm_source' => $this->getEscapedValue( 'utm_source' ),
 506+ 'utm_medium' => $this->getEscapedValue( 'utm_medium' ),
 507+ 'utm_campaign' => $this->getEscapedValue( 'utm_campaign' ),
 508+ 'language' => $this->getEscapedValue( 'language' ),
 509+ 'referrer' => $this->getEscapedValue( 'referrer' ),
 510+ 'comment' => $this->getEscapedValue( 'comment' ),
 511+ 'comment-option' => $this->getEscapedValue( 'comment-option' ),
 512+ 'email-opt' => $this->getEscapedValue( 'email-opt' ),
 513+ 'size' => $this->getEscapedValue( 'size' ),
 514+ 'premium_language' => $this->getEscapedValue( 'premium_language' ),
504515 // process has been disabled - may no longer be needed.
505 - //'process' => isset( $this->form_data['process'] ) ? $this->form_data['process'] : 'CreditCard',
 516+ //'process' => !is_null( $this->getEscapedValue( 'process' ) ) ? $this->getEscapedValue( 'process' ) : 'CreditCard',
506517 // payment_method is no longer set to: processed
507 - 'payment_method' => isset( $this->form_data['payment_method'] ) ? $this->form_data['payment_method'] : '',
508 - 'payment_submethod' => isset( $this->form_data['payment_submethod'] ) ? $this->form_data['payment_submethod'] : '',
509 - 'token' => $this->form_data['token'],
510 - 'order_id' => $this->form_data['order_id'],
511 - 'i_order_id' => $this->form_data['i_order_id'],
512 - 'numAttempt' => $this->form_data['numAttempt'],
513 - 'contribution_tracking_id' => $this->form_data['contribution_tracking_id'],
514 - 'data_hash' => $this->form_data['data_hash'],
515 - 'action' => $this->form_data['action'],
516 - 'owa_session' => $this->form_data['owa_session'],
517 - 'owa_ref' => $this->form_data['owa_ref'],
518 - 'gateway' => $this->form_data['gateway'],
 518+ 'payment_method' => !is_null( $this->getEscapedValue( 'payment_method' ) ) ? $this->getEscapedValue( 'payment_method' ) : '',
 519+ 'payment_submethod' => !is_null( $this->getEscapedValue( 'payment_submethod' ) ) ? $this->getEscapedValue( 'payment_submethod' ) : '',
 520+ 'token' => $this->getEscapedValue( 'token' ),
 521+ 'order_id' => $this->getEscapedValue( 'order_id' ),
 522+ 'i_order_id' => $this->getEscapedValue( 'i_order_id' ),
 523+ 'numAttempt' => $this->getEscapedValue( 'numAttempt' ),
 524+ 'contribution_tracking_id' => $this->getEscapedValue( 'contribution_tracking_id' ),
 525+ 'data_hash' => $this->getEscapedValue( 'data_hash' ),
 526+ 'action' => $this->getEscapedValue( 'action' ),
 527+ 'owa_session' => $this->getEscapedValue( 'owa_session' ),
 528+ 'owa_ref' => $this->getEscapedValue( 'owa_ref' ),
 529+ 'gateway' => $this->getEscapedValue( 'gateway' ),
519530 );
520531 }
521532
@@ -523,7 +534,7 @@
524535
525536 /**
526537 * Gets an array of the hidden fields for the form
527 - *
 538+ * This function is not used by any RapidHTML forms.
528539 * @return array
529540 */
530541 public function getHiddenFields() {
@@ -559,6 +570,14 @@
560571 $this->captcha_html = $html;
561572 }
562573
 574+ /**
 575+ * generateBannerHeader
 576+ * Generates a banner header based on the existance of set masthead data,
 577+ * and/or a gateway header defined in LocalSettings.
 578+ * This function is not used by any RapidHTML forms.
 579+ * @global type $wgOut
 580+ * @global type $wgRequest
 581+ */
563582 protected function generateBannerHeader() {
564583 global $wgOut, $wgRequest;
565584 $g = $this->gateway;
@@ -568,18 +587,45 @@
569588
570589 // intro text
571590 if ( $wgRequest->getText( 'masthead', false ) ) {
572 - $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data['language'] . '}}' );
 591+ $parse = '{{' . htmlspecialchars( $wgRequest->getText( 'masthead' ), ENT_COMPAT, 'UTF-8', false ) . '/' . $this->getEscapedValue( 'language' ) . '}}';
 592+ $template = $wgOut->parse( $parse );
573593 } elseif ( $header ) {
574 - $header = str_replace( '@language', $this->form_data['language'], $header );
575 - $template = $wgOut->parse( $header );
 594+ $header = str_replace( '@language', $this->getEscapedValue( 'language' ), $header );
 595+ $template = $wgOut->parse( htmlspecialchars( $header, ENT_COMPAT, 'UTF-8', false ) );
576596 }
577 -
 597+
578598 // make sure that we actually have a matching template to display so we don't display the 'redlink'
579599 if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template ) ) {
580600 $wgOut->addHtml( $template );
581601 }
582602 }
 603+
 604+ /**
 605+ * generateTextTemplate: Loads the text from the appropraite template.
 606+ * This function is not used by any RapidHTML forms.
 607+ * @global type $wgOut
 608+ * @global type $wgRequest
 609+ * @return string
 610+ */
 611+ protected function generateTextTemplate() {
 612+ global $wgOut, $wgRequest;
 613+ $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
 614+
 615+ //TODO: determine if this next line is really as silly as it looks. I don't think we should be using $wgRequest here at all.
 616+ //(See DonationData::setLanguage())
 617+ if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->getEscapedValue( 'language' );
 618+
 619+ $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . htmlspecialchars( $text_template, ENT_COMPAT, 'UTF-8', false ) . '}}' ) : '';
 620+ // if the template doesn't exist, prevent the display of the red link
 621+ if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 622+ return $template;
 623+ }
583624
 625+ /**
 626+ * Builds and returns the email form field
 627+ * This function is not used by any RapidHTML forms.
 628+ * @return string
 629+ */
584630 protected function getEmailField() {
585631 // email
586632 $form = '<tr>';
@@ -587,40 +633,50 @@
588634 $form .= '</tr>';
589635 $form .= '<tr>';
590636 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-email' ), 'emailAdd' ) . '</td>';
591 - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
 637+ $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
592638 '</td>';
593639 $form .= '</tr>';
594640 return $form;
595641 }
596642
 643+ /**
 644+ * Builds and returns the amount form field.
 645+ * This function is not used by any RapidHTML forms.
 646+ * @return string
 647+ */
597648 protected function getAmountField() {
598649 $otherChecked = false;
599650 $amount = -1;
600 - if ( $this->form_data['amount'] != 100 && $this->form_data['amount'] != 50 && $this->form_data['amount'] != 35 && $this->form_data['amount'] != 20 && $this->form_data['amountOther'] > 0 ) {
 651+ if ( $this->getEscapedValue( 'amount' ) != 100 && $this->getEscapedValue( 'amount' ) != 50 && $this->getEscapedValue( 'amount' ) != 35 && $this->getEscapedValue( 'amount' ) != 20 && $this->getEscapedValue( 'amountOther' ) > 0 ) {
601652 $otherChecked = true;
602 - $amount = $this->form_data['amountOther'];
 653+ $amount = $this->getEscapedValue( 'amountOther' );
603654 }
604655 $form = '<tr>';
605 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 656+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
606657 $form .= '</tr>';
607658 $form .= '<tr>';
608659 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
609 - $form .= '<td>' . Xml::radio( 'amount', 100, $this->form_data['amount'] == 100 ) . '100 ' .
610 - Xml::radio( 'amount', 50, $this->form_data['amount'] == 50 ) . '50 ' .
611 - Xml::radio( 'amount', 35, $this->form_data['amount'] == 35 ) . '35 ' .
612 - Xml::radio( 'amount', 20, $this->form_data['amount'] == 20 ) . '20 ' .
 660+ $form .= '<td>' . Xml::radio( 'amount', 100, $this->getEscapedValue( 'amount' ) == 100 ) . '100 ' .
 661+ Xml::radio( 'amount', 50, $this->getEscapedValue( 'amount' ) == 50 ) . '50 ' .
 662+ Xml::radio( 'amount', 35, $this->getEscapedValue( 'amount' ) == 35 ) . '35 ' .
 663+ Xml::radio( 'amount', 20, $this->getEscapedValue( 'amount' ) == 20 ) . '20 ' .
613664 '</td>';
614665 $form .= '</tr>';
615666 $form .= '<tr>';
616667 $form .= '<td class="label"></td>';
617 - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-other' ) . '\' )', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if (this.value > 0) document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' => 'amountOther' ) ) .
 668+ $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->getEscapedValue( 'amountOther' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-other' ) . '\' )', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if (this.value > 0) document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' => 'amountOther' ) ) .
618669 ' ' . $this->generateCurrencyDropdown() . '</td>';
619670 $form .= '</tr>';
620671 return $form;
621672 }
622673
 674+ /**
 675+ * getCardnumberField builds and returns the credit card number field.
 676+ * This function is not used by any RapidHTML forms.
 677+ * @return string
 678+ */
623679 protected function getCardnumberField() {
624 - $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data['card_num'] : '';
 680+ $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'card_num' ) : '';
625681 $form = '';
626682 if ( $this->form_errors['card_num'] ) {
627683 $form .= '<tr>';
@@ -640,8 +696,13 @@
641697 return $form;
642698 }
643699
 700+ /**
 701+ * Builds and returns the cvv form field
 702+ * This function is not used by any RapidHTML forms.
 703+ * @return string
 704+ */
644705 protected function getCvvField() {
645 - $cvv = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data['cvv'] : '';
 706+ $cvv = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'cvv' ) : '';
646707
647708 $form = '<tr>';
648709 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['cvv'] . '</span></td>';
@@ -654,42 +715,62 @@
655716 return $form;
656717 }
657718
 719+ /**
 720+ * Builds and returns the street form element.
 721+ * This function is not used by any RapidHTML forms.
 722+ * @return string
 723+ */
658724 protected function getStreetField() {
659725 $form = '<tr>';
660726 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['street'] . '</span></td>';
661727 $form .= '</tr>';
662728 $form .= '<tr>';
663729 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-street' ), 'street' ) . '</td>';
664 - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
 730+ $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
665731 '</td>';
666732 $form .= '</tr>';
667733 return $form;
668734 }
669735
 736+ /**
 737+ * getCityField builds and returns the city form element.
 738+ * This function is not used by any RapidHTML forms.
 739+ * @return string
 740+ */
670741 protected function getCityField() {
671742 $form = '<tr>';
672743 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['city'] . '</span></td>';
673744 $form .= '</tr>';
674745 $form .= '<tr>';
675746 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-city' ), 'city' ) . '</td>';
676 - $form .= '<td>' . Xml::input( 'city', '30', $this->form_data['city'], array( 'type' => 'text', 'maxlength' => '40', 'id' => 'city', 'class' => 'fullwidth' ) ) .
 747+ $form .= '<td>' . Xml::input( 'city', '30', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'maxlength' => '40', 'id' => 'city', 'class' => 'fullwidth' ) ) .
677748 '</td>';
678749 $form .= '</tr>';
679750 return $form;
680751 }
681752
 753+ /**
 754+ * Builds and returns the zip (postal) code form element.
 755+ * This function is not used by any RapidHTML forms.
 756+ * @return string
 757+ */
682758 protected function getZipField() {
683759 $form = '<tr>';
684760 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['zip'] . '</span></td>';
685761 $form .= '</tr>';
686762 $form .= '<tr>';
687763 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-postal' ), 'zip' ) . '</td>';
688 - $form .= '<td>' . Xml::input( 'zip', '30', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '9', 'id' => 'zip', 'class' => 'fullwidth' ) ) .
 764+ $form .= '<td>' . Xml::input( 'zip', '30', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'maxlength' => '9', 'id' => 'zip', 'class' => 'fullwidth' ) ) .
689765 '</td>';
690766 $form .= '</tr>';
691767 return $form;
692768 }
693769
 770+ /**
 771+ * Builds and returns the name-related form controls.
 772+ * This function is not used by any RapidHTML forms.
 773+ * @return string
 774+ */
694775 protected function getNameField() {
695776 $form = '<tr>';
696777 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['fname'] . '</span></td>';
@@ -699,12 +780,17 @@
700781 $form .= '</tr>';
701782 $form .= '<tr>';
702783 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-name' ), 'fname' ) . '</td>';
703 - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-fname' ) . '\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
704 - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-lname' ) . '\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
 784+ $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-fname' ) . '\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
 785+ Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \'' . wfMsg( 'donate_interface-donor-lname' ) . '\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
705786 $form .= "</tr>";
706787 return $form;
707788 }
708789
 790+ /**
 791+ * Builds and returns the comment message.
 792+ * This function is not used by any RapidHTML forms.
 793+ * @return string
 794+ */
709795 protected function getCommentMessageField() {
710796 $form = '<tr>';
711797 $form .= '<td colspan="2">';
@@ -714,17 +800,26 @@
715801 return $form;
716802 }
717803
 804+ /**
 805+ * Builds and returns the comment form field.
 806+ * This function is not used by any RapidHTML forms.
 807+ * @return string
 808+ */
718809 protected function getCommentField() {
719810 $form = '<tr>';
720811 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-comment' ), 'comment' ) . '</td>';
721 - $form .= '<td>' . Xml::input( 'comment', '30', $this->form_data['comment'], array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' ) ) . '</td>';
 812+ $form .= '<td>' . Xml::input( 'comment', '30', $this->getEscapedValue( 'comment' ), array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' ) ) . '</td>';
722813 $form .= '</tr>';
723814 return $form;
724815 }
725816
 817+ /**
 818+ * Builds and returns the comment option checkbox.
 819+ * This function is not used by any RapidHTML forms.
 820+ * @return string
 821+ */
726822 protected function getCommentOptionField() {
727 - global $wgRequest;
728 - $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data['comment-option'] : true;
 823+ $comment_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'comment-option' ) : true;
729824 $form = '<tr>';
730825 $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value );
731826 $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>';
@@ -732,9 +827,13 @@
733828 return $form;
734829 }
735830
 831+ /**
 832+ * Builds and returns the email-opt checkbox.
 833+ * This function is not used by any RapidHTML forms.
 834+ * @return string
 835+ */
736836 protected function getEmailOptField() {
737 - global $wgRequest;
738 - $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data['email-opt'] : true;
 837+ $email_opt_value = ( $this->gateway->posted ) ? $this->getEscapedValue( 'email-opt' ) : true;
739838 $form = '<tr>';
740839 $form .= '<td class="check-option" colspan="2">' . Xml::check( 'email-opt', $email_opt_value );
741840 $form .= ' ';
@@ -747,6 +846,12 @@
748847 return $form;
749848 }
750849
 850+ /**
 851+ * Builds and returns the paypal button form element.
 852+ * This function is only used in TwoColumnPayPal.php.
 853+ * @global type $wgScriptPath
 854+ * @return string
 855+ */
751856 protected function getPaypalButton() {
752857 global $wgScriptPath;
753858 $scriptPath = "$wgScriptPath/extensions/DonationInterface/gateway_forms/includes";
@@ -761,6 +866,11 @@
762867 return $form;
763868 }
764869
 870+ /**
 871+ * Builds and returns the state dropdown form element.
 872+ * This function is not used by any RapidHTML forms.
 873+ * @return string
 874+ */
765875 protected function getStateField() {
766876 $form = '<tr>';
767877 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['state'] . '</span></td>';
@@ -772,6 +882,12 @@
773883 return $form;
774884 }
775885
 886+ /**
 887+ * Builds and returns the country form element.
 888+ * This function is not used by any RapidHTML forms.
 889+ * @param type $defaultCountry
 890+ * @return string
 891+ */
776892 protected function getCountryField( $defaultCountry = null ) {
777893 $form = '<tr>';
778894 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['country'] . '</span></td>';
@@ -783,6 +899,11 @@
784900 return $form;
785901 }
786902
 903+ /**
 904+ * Builds and returns the card type dropdown.
 905+ * This function is only used by TwoStepTwoColumn.php
 906+ * @return string
 907+ */
787908 protected function getCreditCardTypeField() {
788909 $form = '<tr>';
789910 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-card' ), 'card_type' ) . '</td>';
@@ -791,6 +912,11 @@
792913 return $form;
793914 }
794915
 916+ /**
 917+ * Builds and returns the credit card expiry form controls.
 918+ * This function is not used by any RapidHTML forms.
 919+ * @return string
 920+ */
795921 protected function getExpiryField() {
796922 $form = '<tr>';
797923 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-expiration' ), 'expiration' ) . '</td>';
@@ -799,16 +925,31 @@
800926 return $form;
801927 }
802928
 929+ /**
 930+ * Uses resource loader to load the form validation javascript.
 931+ * @global type $wgOut
 932+ */
803933 protected function loadValidateJs() {
804934 global $wgOut;
805935 $wgOut->addModules( 'di.form.core.validate' );
806936 }
807937
 938+ /**
 939+ * Uses the resource loader to add the api client side javascript, usually
 940+ * only when the form is caching.
 941+ * @global type $wgOut
 942+ */
808943 protected function loadApiJs() {
809944 global $wgOut;
810945 $wgOut->addModules( 'pfp.form.core.api' );
811946 }
812947
 948+ /**
 949+ * Loads the OWA javascript.
 950+ * if OWA is enabled, this is called by the main form constructor.
 951+ * @global type $wgOut
 952+ * @global type $wgScriptPath
 953+ */
813954 protected function loadOwaJs() {
814955 global $wgOut, $wgScriptPath;
815956 $wgOut->addHeadItem( 'owa_tracker', '<script type="text/javascript" src="https://owa.wikimedia.org/owa/modules/base/js/owa.tracker-combined-min.js"></script>' );
@@ -823,7 +964,7 @@
824965
825966 /**
826967 * Generate HTML for <noscript> tags
827 - *
 968+ * This function is not used by any RapidHTML forms.
828969 * For displaying when a user does not have Javascript enabled in their browser.
829970 */
830971 protected function getNoScript() {
@@ -865,7 +1006,9 @@
8661007 unset( $query_array['_cache_'] );
8671008
8681009 // make sure no other data that might overwrite posted data makes it into the URL
869 - foreach ( $this->form_data as $key => $value ) {
 1010+
 1011+ $all_form_data = $this->gateway->getData_Unstaged_Escaped();
 1012+ foreach ( $all_form_data as $key => $value ) {
8701013 unset( $query_array[$key] );
8711014 }
8721015
@@ -875,88 +1018,32 @@
8761019
8771020 /**
8781021 * Get the form id
879 - *
 1022+ * This function appears to be used only by the Universal Test form, and as
 1023+ * such should be moved to that class and away from the class all the forms
 1024+ * are eventually descended from.
8801025 * @return string
8811026 */
8821027 protected function getFormId() {
883 -
 1028+ //TODO: Determine what this is, and either take measures to reference
 1029+ //something closer to the source data, move it to a child class, or get rid of it.
8841030 return $this->form_id;
8851031 }
8861032
8871033 /**
888 - * Set the form id
889 - *
890 - * @param string $value The form_id value
891 - */
892 - protected function setFormId( $value = '' ) {
893 -
894 - $this->form_id = (string) $value;
895 - }
896 -
897 - /**
8981034 * Get the form name
899 - *
 1035+ * This function appears to be used only by the Universal Test form, and as
 1036+ * such should be moved to that class and away from the class all the forms
 1037+ * are eventually descended from.
9001038 * @return string
9011039 */
9021040 protected function getFormName() {
9031041
904 - return $this->form_name;
 1042+ return $this->getEscapedValue( 'form_name' );
9051043 }
9061044
9071045 /**
908 - * Set the form name
909 - *
910 - * @param string $value The form_name value
 1046+ * Create and return the Verisign logo (small size) form element.
9111047 */
912 - protected function setFormName( $value = '' ) {
913 -
914 - $this->form_name = (string) $value;
915 - }
916 -
917 - /**
918 - * Get the payment method
919 - *
920 - * @return string
921 - */
922 - protected function getPaymentMethod() {
923 -
924 - return $this->payment_method;
925 - }
926 -
927 - /**
928 - * Set the payment method
929 - *
930 - * @param string $value The payment method value
931 - */
932 - protected function setPaymentMethod( $value = '' ) {
933 -
934 - $this->payment_method = (string) $value;
935 - }
936 -
937 - /**
938 - * Get the payment submethod
939 - *
940 - * @return string
941 - */
942 - protected function getPaymentSubmethod() {
943 -
944 - return $this->payment_submethod;
945 - }
946 -
947 - /**
948 - * Set the payment submethod
949 - *
950 - * @param string $value The payment submethod value
951 - */
952 - protected function setPaymentSubmethod( $value = '' ) {
953 -
954 - $this->payment_submethod = (string) $value;
955 - }
956 -
957 - /**
958 - * Create the Verisign logo (small size)
959 - *
960 - */
9611048 protected function getSmallSecureLogo() {
9621049
9631050 $form = '<table id="secureLogo" width="130" border="0" cellpadding="2" cellspacing="0" title=' . wfMsg('donate_interface-securelogo-title') . '>';
@@ -966,5 +1053,17 @@
9671054 $form .= '</table>';
9681055 return $form;
9691056 }
 1057+
 1058+ /**
 1059+ * Pulls normalized and escaped data from the $gateway object.
 1060+ * For more information, see GatewayAdapter::getData_Unstaged_Escaped in
 1061+ * $IP/extensions/DonationData/gateway_common/gateway.adapter.php
 1062+ * @param string $key The value to fetch from the adapter.
 1063+ * @return mixed The escaped value in the adapter, or null if none exists.
 1064+ * Note: The value could still be a blank string in some cases.
 1065+ */
 1066+ protected function getEscapedValue( $key ) {
 1067+ return $this->gateway->getData_Unstaged_Escaped( $key );
 1068+ }
9701069 }
9711070
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/Form.php
___________________________________________________________________
Modified: svn:mergeinfo
9721071 Merged /trunk/extensions/DonationInterface/gateway_forms/Form.php:r105938,106109,106158,107609,108541
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php
@@ -1,9 +1,8 @@
22 <?php
33
44 class Gateway_Form_TwoColumnLetter extends Gateway_Form_OneStepTwoColumn {
5 - public $paypal = false; // true for paypal only version
65
7 - public function __construct( &$gateway, &$form_errors ) {
 6+ public function __construct( &$gateway ) {
87 global $wgScriptPath;
98
109 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -11,27 +10,17 @@
1211 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoColumnLetter.css' );
1312 }
1413
15 - parent::__construct( $gateway, $form_errors );
 14+ parent::__construct( $gateway );
1615 }
1716
1817 public function generateFormStart() {
19 - global $wgOut, $wgRequest;
20 -
21 - $this->paypal = $wgRequest->getBool( 'paypal', false );
22 -
2318 $form = parent::generateBannerHeader();
2419
2520 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0 ) );
2621 $form .= Xml::openElement( 'tr' );
2722 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2823
29 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
30 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
31 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
32 -
33 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
34 - // if the template doesn't exist, prevent the display of the red link
35 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 24+ $template = self::generateTextTemplate();
3625 $form .= $template;
3726
3827 $form .= Xml::closeElement( 'td' );
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php
___________________________________________________________________
Added: svn:mergeinfo
3928 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
4029 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php:r99568
4130 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoColumnLetter.php:r95724-100157
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class Gateway_Form_TwoStepTwoColumnPremium extends Gateway_Form_TwoStepTwoColumn {
5 - public function __construct( &$gateway, &$form_errors ) {
 5+ public function __construct( &$gateway ) {
66 global $wgScriptPath;
77
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -9,11 +9,11 @@
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnPremium.css' );
1111 }
1212
13 - parent::__construct( $gateway, $form_errors );
 13+ parent::__construct( $gateway );
1414 }
1515
1616 public function generateFormStart() {
17 - global $wgRequest, $wgScriptPath;
 17+ global $wgScriptPath;
1818
1919 $form = parent::generateBannerHeader();
2020
@@ -26,12 +26,12 @@
2727 $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/wikipedia-ten-tshirt-front.png", 'width' => '300', 'height' => '280' ) ) . "<br/>";
2828 $form .= Xml::openElement( 'div', array( 'id' => 'premium-values' ) );
2929 $form .= Xml::openElement( 'div', array( 'id' => 'premium-size' ) );
30 - $sizeDisplay = '<span id="size-display">'.$wgRequest->getText( 'size' ).'</span>';
 30+ $sizeDisplay = '<span id="size-display">'.$this->getEscapedValue( 'size' ).'</span>';
3131 $form .= wfMsg( 'donate_interface-shirt-size-2', $sizeDisplay );
3232 $form .= Xml::closeElement( 'div' ); // close div#premium-size
3333 $form .= wfMsg( 'donate_interface-on-the-back' ) . "<br/>";
3434 $form .= Xml::openElement( 'div', array( 'id' => 'premium-language' ) );
35 - $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/wordmarks/".$wgRequest->getText( 'premium_language' )."-wordmark.png", 'width' => '200', 'height' => '92' ) );
 35+ $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/wordmarks/".$this->getEscapedValue( 'premium_language' )."-wordmark.png", 'width' => '200', 'height' => '92' ) );
3636 $form .= Xml::closeElement( 'div' ); // close div#premium-language
3737 $form .= Xml::closeElement( 'div' ); // close div#premium-values
3838 $form .= Xml::closeElement( 'div' ); // close div#premium-confirmation
@@ -96,16 +96,16 @@
9797
9898 // amount
9999 $form .= '<tr>';
100 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 100+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
101101 $form .= '</tr>';
102102 $form .= '<tr>';
103103 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
104 - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
 104+ $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
105105 ' ' . $this->generateCurrencyDropdown() . '</td>';
106106 $form .= '</tr>';
107107
108108 // card logos
109 - if ( $this->form_data[ 'currency_code' ] == 'USD' ) {
 109+ if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) {
110110 $form .= '<tr id="four_cards" style="display:table-row;">';
111111 $form .= '<td class="label"> </td><td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>';
112112 $form .= '</tr>';
@@ -142,7 +142,7 @@
143143 $form .= $this->getZipField();
144144
145145 // country
146 - $form .= $this->getCountryField( $this->form_data[ 'country2' ] );
 146+ $form .= $this->getCountryField( $this->getEscapedValue( 'country2' ) );
147147
148148 /*
149149 $form .= '<tr>';
@@ -176,7 +176,7 @@
177177 }
178178
179179 // Temporary
180 - $form .= Html::hidden( 'country2', $this->form_data[ 'country2' ] );
 180+ $form .= Html::hidden( 'country2', $this->getEscapedValue( 'country2' ) );
181181
182182 $form .= Xml::closeElement( 'form' ); // close form 'payment'
183183 $form .= $this->generateDonationFooter();
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php
___________________________________________________________________
Added: svn:mergeinfo
184184 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php:r95724-100157
185185 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
186186 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremium.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php
@@ -2,8 +2,8 @@
33
44 class Gateway_Form_TwoStepTwoColumn extends Gateway_Form {
55
6 - public function __construct( &$gateway, &$form_errors ) {
7 - parent::__construct( $gateway, $form_errors );
 6+ public function __construct( &$gateway ) {
 7+ parent::__construct( $gateway );
88 }
99
1010 public function loadPlaceholders() {
@@ -166,11 +166,11 @@
167167
168168 // amount
169169 $form = '<tr>';
170 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 170+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
171171 $form .= '</tr>';
172172 $form .= '<tr>';
173173 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-donor-amount' ), 'amount' ) . '</td>';
174 - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
 174+ $form .= '<td>' . Xml::input( 'amount', '7', $this->getEscapedValue( 'amount' ), array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
175175 ' ' . $this->generateCurrencyDropdown() . '</td>';
176176 $form .= '</tr>';
177177
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php
___________________________________________________________________
Added: svn:mergeinfo
178178 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php:r95724-100157
179179 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
180180 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumn.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class Gateway_Form_TwoStepTwoColumnLetter2 extends Gateway_Form_TwoStepTwoColumnLetter {
5 - public function __construct( &$gateway, &$form_errors ) {
 5+ public function __construct( &$gateway ) {
66 global $wgScriptPath;
77
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -9,6 +9,6 @@
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter2.css' );
1111 }
1212
13 - parent::__construct( $gateway, $form_errors );
 13+ parent::__construct( $gateway );
1414 }
1515 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php
___________________________________________________________________
Added: svn:mergeinfo
1616 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php:r95724-100157
1717 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,107609
1818 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter2.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php
@@ -1,14 +1,14 @@
22 <?php
33
44 class Gateway_Form_TwoStepTwoColumnLetter3 extends Gateway_Form_TwoStepTwoColumn {
5 - public function __construct( &$gateway, &$form_errors ) {
 5+ public function __construct( &$gateway ) {
66 global $wgExtensionAssetsPath;
77
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
99 if ( !strlen( $this->getStylePath() ) ) {
1010 $this->setStylePath( $wgExtensionAssetsPath . '/DonationInterface/gateway_forms/css/TwoStepTwoColumnLetter3.css' );
1111 }
12 - parent::__construct( $gateway, $form_errors );
 12+ parent::__construct( $gateway );
1313 }
1414
1515 public function loadPlaceholders() {
@@ -115,7 +115,7 @@
116116 }
117117
118118 public function generateFormStart() {
119 - global $wgOut, $wgRequest;
 119+ global $wgOut;
120120
121121 $form = parent::generateBannerHeader();
122122
@@ -123,13 +123,7 @@
124124 $form .= Xml::openElement( 'tr' );
125125 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
126126
127 - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
128 - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
129 - if ( $wgRequest->getText( 'language' ) ) $text_template .= '/' . $this->form_data[ 'language' ];
130 -
131 - $template = ( strlen( $text_template ) ) ? $wgOut->parse( '{{' . $text_template . '}}' ) : '';
132 - // if the template doesn't exist, prevent the display of the red link
133 - if ( preg_match( '/redlink\=1/', $template ) ) $template = NULL;
 127+ $template = self::generateTextTemplate();
134128 $form .= $template;
135129
136130 $form .= Xml::closeElement( 'td' );
@@ -201,7 +195,7 @@
202196
203197 // amount
204198 $form .= '<tr>';
205 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 199+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['amount'] . '</span></td>';
206200 $form .= '</tr>';
207201 $form .= '<tr>';
208202 $form .= '<td colspan="2">';
@@ -213,11 +207,11 @@
214208 $form .= '</tr>';
215209 $form .= '<tr>';
216210 $form .= '<td class="amount_data">'.wfMsg( 'donate_interface-donation' ).'</td>';
217 - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] .
218 - Html::hidden( 'amount', $this->form_data['amount'] ) .
 211+ $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'amount' ) .
 212+ Html::hidden( 'amount', $this->getEscapedValue( 'amount' ) ) .
219213 '</td>';
220 - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency_code' ] .
221 - Html::hidden( 'currency_code', $this->form_data['currency_code'] ) .
 214+ $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'currency_code' ) .
 215+ Html::hidden( 'currency_code', $this->getEscapedValue( 'currency_code' ) ) .
222216 '</td>';
223217 $form .= '</tr>';
224218 $form .= '</table>';
@@ -232,7 +226,7 @@
233227 // card logos
234228 $form .= '<tr>';
235229 $form .= '<td class="label"> </td>';
236 - if ( $this->form_data[ 'currency_code' ] == 'USD' ) {
 230+ if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) {
237231 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>';
238232 } else {
239233 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>';
@@ -240,7 +234,7 @@
241235 $form .= '</tr>';
242236
243237 // card number
244 - $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data[ 'card_num' ] : '';
 238+ $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'card_num' ) : '';
245239 $form .= '';
246240 if ( $this->form_errors['card_num'] ) {
247241 $form .= '<tr>';
@@ -276,8 +270,8 @@
277271 $form .= '</tr>';
278272 $form .= '<tr>';
279273 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-name-on-card' ), 'fname' ) . '</td>';
280 - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
281 - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
 274+ $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
 275+ Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
282276 $form .= "</tr>";
283277
284278 // street
@@ -286,7 +280,7 @@
287281 $form .= '</tr>';
288282 $form .= '<tr>';
289283 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-billing-address' ), 'street' ) . '</td>';
290 - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
 284+ $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
291285 '</td>';
292286 $form .= '</tr>';
293287
@@ -296,9 +290,9 @@
297291 $form .= '</tr>';
298292 $form .= '<tr>';
299293 $form .= '<td class="label"> </td>';
300 - $form .= '<td>' . Xml::input( 'city', '18', $this->form_data['city'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' .
 294+ $form .= '<td>' . Xml::input( 'city', '18', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' .
301295 $this->generateStateDropdown() . ' ' .
302 - Xml::input( 'zip', '5', $this->form_data['zip'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) .
 296+ Xml::input( 'zip', '5', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) .
303297 Html::hidden( 'country', 'US' ) .
304298 '</td>';
305299 $form .= '</tr>';
@@ -320,7 +314,7 @@
321315 $form .= '</tr>';
322316 $form .= '<tr>';
323317 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-email-receipt' ), 'emailAdd' ) . '</td>';
324 - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
 318+ $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
325319 '</td>';
326320 $form .= '</tr>';
327321
@@ -368,7 +362,7 @@
369363 // generate dropdown of state opts
370364 foreach ( $states as $value => $state_name ) {
371365 if ( $value !== 'YY' && $value !== 'XX' ) {
372 - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false;
 366+ $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false;
373367 $state_opts .= Xml::option( $value, $value, $selected );
374368 }
375369 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php
___________________________________________________________________
Added: svn:mergeinfo
376370 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php:r95724-100157
377371 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
378372 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnLetter3.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php
@@ -92,12 +92,14 @@
9393 '#emailAdd',
9494 );
9595
96 - public function __construct( &$gateway, &$form_errors ) {
 96+ public function __construct( &$gateway ) {
9797 global $wgRequest;
98 - parent::__construct( $gateway, $form_errors );
 98+ parent::__construct( $gateway );
 99+ $form_errors = $this->form_errors;
99100
100101 $this->loadValidateJs();
101102
 103+ //Not sure if we should be using $wgRequest here. Depends if we want the normalized one or not.
102104 $country = $wgRequest->getText( 'country', '' );
103105 // Get error passed via query string
104106 $error = $wgRequest->getText( 'error' );
@@ -180,8 +182,8 @@
181183 foreach ( $this->data_tokens as $token ) {
182184 $key = substr( $token, 1, strlen( $token )); //get the token string w/o the '@'
183185 if ( $key == 'emailAdd' ) $key = 'email';
184 - if ( array_key_exists( $key, $this->form_data )) {
185 - $replace = $this->form_data[ $key ];
 186+ if ( $this->getEscapedValue( $key ) ) {
 187+ $replace = $this->getEscapedValue( $key );
186188 } else {
187189 $replace = '';
188190 }
@@ -254,7 +256,7 @@
255257 } else {
256258 $params[ $k ] .= '?';
257259 }
258 - $params[ $k ] .= "language=" . $this->form_data['language']. "&country=" . $this->form_data['country'];
 260+ $params[ $k ] .= "language=" . $this->getEscapedValue( 'language' ) . "&country=" . $this->getEscapedValue( 'country' );
259261 }
260262 }
261263 // TODO: add support for message variations here as well
@@ -286,7 +288,7 @@
287289 * @return string The HTML form containing translated messages
288290 */
289291 public function replace_blocks( $html ){
290 - global $wgRequest, $wgGlobalCollectGatewayHtmlFormDir;
 292+ global $wgRequest;
291293 if( $wgRequest->getText( 'debug', 'false' ) == 'true' ){
292294 # do not replace tokens
293295 return $html;
@@ -300,14 +302,15 @@
301303
302304 foreach( $matches[ 1 ] as $i => $key ){
303305 # $matches[ 1 ] is specified in the code, not user input
304 - $filepath = $wgGlobalCollectGatewayHtmlFormDir . '/_' . $matches[ 1 ][ $i ] . '/';
 306+ $filepath = $this->gateway->getGlobal('HtmlFormDir') . '/_' . $matches[ 1 ][ $i ] . '/';
305307
306308 $var = 'default';
307309
308 - # check to see if the parameter is, in fact, an element of form_data
309 - if( array_key_exists( $matches[ 2 ][ $i ], $this->form_data ) ){
 310+ # check to see if the parameter is, in fact, an element in DonationData
 311+ $param = $this->getEscapedValue( $matches[ 2 ][ $i ] );
 312+ if( $param ){
310313 # get the value of the element and super-escape
311 - $var = $this->make_safe( $this->form_data[ $matches[ 2 ][ $i ] ], 'default' );
 314+ $var = $this->make_safe( $param, 'default' );
312315 }
313316
314317 # oh, and we only allow with the extension .html
@@ -341,7 +344,7 @@
342345 // currency code
343346 $start = strpos( $html, 'name="currency_code"' );
344347 if ( $start ) {
345 - $currency_code = $this->form_data['currency_code'];
 348+ $currency_code = $this->getEscapedValue( 'currency_code' );
346349 $end = strpos( $html, '</select>', $start );
347350 $str = substr( $html, $start, ( $end - $start ) );
348351 $str = str_replace( 'value="' . $currency_code . '"', 'value="' . $currency_code . '" selected="selected"', $str );
@@ -349,7 +352,7 @@
350353 }
351354
352355 // mos
353 - $month = substr( $this->form_data['expiration'], 0, 2 );
 356+ $month = substr( $this->getEscapedValue( 'expiration' ), 0, 2 );
354357 $start = strpos( $html, 'name="mos"' );
355358 if ( $start ) {
356359 $end = strpos( $html, '</select>', $start );
@@ -359,7 +362,7 @@
360363 }
361364
362365 // year
363 - $year = substr( $this->form_data['expiration'], 2, 2 );
 366+ $year = substr( $this->getEscapedValue( 'expiration' ), 2, 2 );
364367 $start = strpos( $html, 'name="year"' );
365368 if ( $start ) {
366369 $end = strpos( $html, '</select>', $start );
@@ -370,7 +373,7 @@
371374 }
372375
373376 // state
374 - $state = $this->form_data['state'];
 377+ $state = $this->getEscapedValue( 'state' );
375378 $start = strpos( $html, 'name="state"' );
376379 if ( $start ) {
377380 $end = strpos( $html, '</select>', $start );
@@ -380,7 +383,7 @@
381384 }
382385
383386 //country
384 - $country = $this->form_data['country'];
 387+ $country = $this->getEscapedValue( 'country' );
385388 $start = strpos( $html, 'name="country"' );
386389 if ( $start ) {
387390 $end = strpos( $html, '</select>', $start );
@@ -414,10 +417,12 @@
415418 * Load API js if this form needs to support cacheing
416419 */
417420 public function handle_cacheability() {
 421+ //We may change this from checking one thing in $wgRequest, to a
 422+ //reference to $this->gateway->isCaching(). Little more robust.
418423 global $wgRequest;
419424 if ( $wgRequest->getText( '_cache_', false )) {
420425 $this->loadApiJs();
421 -}
 426+ }
422427 }
423428
424429 /**
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/RapidHtml.php
___________________________________________________________________
Modified: svn:mergeinfo
425430 Merged /trunk/extensions/DonationInterface/gateway_forms/RapidHtml.php:r106109,106158,107609,107690
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php
@@ -1,7 +1,7 @@
22 <?php
33
44 class Gateway_Form_TwoStepTwoColumnPremiumUS extends Gateway_Form_TwoStepTwoColumn {
5 - public function __construct( &$gateway, &$form_errors ) {
 5+ public function __construct( &$gateway ) {
66 global $wgScriptPath;
77
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
@@ -9,7 +9,7 @@
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/gateway_forms/css/TwoStepTwoColumnPremiumUS.css' );
1111 }
1212
13 - parent::__construct( $gateway, $form_errors );
 13+ parent::__construct( $gateway );
1414 }
1515
1616 public function loadPlaceholders() {
@@ -121,7 +121,7 @@
122122 }
123123
124124 public function generateFormStart() {
125 - global $wgRequest, $wgScriptPath;
 125+ global $wgScriptPath;
126126
127127 $form = parent::generateBannerHeader();
128128
@@ -131,7 +131,7 @@
132132
133133 $form .= Xml::openElement( 'div', array( 'id' => 'premium-confirmation' ) );
134134 $form .= Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/Wikipedia-ten-tshirt-back.jpg", 'width' => '300', 'height' => '300' ) );
135 - $form .= wfMsg( 'donate_interface-shirt-size-2', $wgRequest->getText( 'size' ) );
 135+ $form .= wfMsg( 'donate_interface-shirt-size-2', $this->getEscapedValue( 'size' ) );
136136 $form .= Xml::closeElement( 'div' ); // close div#premium-confirmation
137137
138138 $form .= Xml::closeElement( 'td' );
@@ -197,11 +197,11 @@
198198 $form .= '</tr>';
199199 $form .= '<tr>';
200200 $form .= '<td class="amount_data">'.wfMsg( 'donate_interface-donation' ).'</td>';
201 - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data['amount'] .
202 - Html::hidden( 'amount', $this->form_data['amount'] ) .
 201+ $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'amount' ) .
 202+ Html::hidden( 'amount', $this->getEscapedValue( 'amount' ) ) .
203203 '</td>';
204 - $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->form_data[ 'currency_code' ] .
205 - Html::hidden( 'currency_code', $this->form_data['currency_code'] ) .
 204+ $form .= '<td class="amount_data" style="text-align:right;width:75px;">'.$this->getEscapedValue( 'currency_code' ) .
 205+ Html::hidden( 'currency_code', $this->getEscapedValue( 'currency_code' ) ) .
206206 '</td>';
207207 $form .= '</tr>';
208208 $form .= '</table>';
@@ -216,7 +216,7 @@
217217 // card logos
218218 $form .= '<tr>';
219219 $form .= '<td class="label"> </td>';
220 - if ( $this->form_data[ 'currency_code' ] == 'USD' ) {
 220+ if ( $this->getEscapedValue( 'currency_code' ) == 'USD' ) {
221221 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos.gif" ) ) . '</td>';
222222 } else {
223223 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/gateway_forms/includes/credit_card_logos3.gif" ) ) . '</td>';
@@ -224,7 +224,7 @@
225225 $form .= '</tr>';
226226
227227 // card number
228 - $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->form_data[ 'card_num' ] : '';
 228+ $card_num = ( $this->gateway->getGlobal( "Test" ) ) ? $this->getEscapedValue( 'card_num' ) : '';
229229 $form .= '';
230230 if ( $this->form_errors['card_num'] ) {
231231 $form .= '<tr>';
@@ -260,8 +260,8 @@
261261 $form .= '</tr>';
262262 $form .= '<tr>';
263263 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-name-on-card' ), 'fname' ) . '</td>';
264 - $form .= '<td>' . Xml::input( 'fname', '30', $this->form_data['fname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
265 - Xml::input( 'lname', '30', $this->form_data['lname'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
 264+ $form .= '<td>' . Xml::input( 'fname', '30', $this->getEscapedValue( 'fname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-fname' ).'\' )', 'maxlength' => '25', 'class' => 'required', 'id' => 'fname' ) ) .
 265+ Xml::input( 'lname', '30', $this->getEscapedValue( 'lname' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-lname' ).'\' )', 'maxlength' => '25', 'id' => 'lname' ) ) . '</td>';
266266 $form .= "</tr>";
267267
268268 // street
@@ -270,7 +270,7 @@
271271 $form .= '</tr>';
272272 $form .= '<tr>';
273273 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-billing-address' ), 'street' ) . '</td>';
274 - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
 274+ $form .= '<td>' . Xml::input( 'street', '30', $this->getEscapedValue( 'street' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-street' ).'\' )', 'maxlength' => '100', 'id' => 'street', 'class' => 'fullwidth' ) ) .
275275 '</td>';
276276 $form .= '</tr>';
277277
@@ -280,9 +280,9 @@
281281 $form .= '</tr>';
282282 $form .= '<tr>';
283283 $form .= '<td class="label"> </td>';
284 - $form .= '<td>' . Xml::input( 'city', '18', $this->form_data['city'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' .
 284+ $form .= '<td>' . Xml::input( 'city', '18', $this->getEscapedValue( 'city' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-city' ).'\' )', 'maxlength' => '40', 'id' => 'city' ) ) . ' ' .
285285 $this->generateStateDropdown() . ' ' .
286 - Xml::input( 'zip', '5', $this->form_data['zip'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) .
 286+ Xml::input( 'zip', '5', $this->getEscapedValue( 'zip' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-zip-code' ).'\' )', 'maxlength' => '10', 'id' => 'zip' ) ) .
287287 Html::hidden( 'country', 'US' ) .
288288 '</td>';
289289 $form .= '</tr>';
@@ -293,7 +293,7 @@
294294 $form .= '</tr>';
295295 $form .= '<tr>';
296296 $form .= '<td class="label"> </td>';
297 - $form .= '<td>' . $this->generateCountryDropdown( $this->form_data['country2'] ) . '</td>';
 297+ $form .= '<td>' . $this->generateCountryDropdown( $this->getEscapedValue( 'country2' ) ) . '</td>';
298298 $form .= '</tr>';
299299
300300 // email
@@ -302,7 +302,7 @@
303303 $form .= '</tr>';
304304 $form .= '<tr>';
305305 $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-email-receipt' ), 'emailAdd' ) . '</td>';
306 - $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
 306+ $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->getEscapedValue( 'email' ), array( 'type' => 'text', 'onfocus' => 'clearField( this, \''.wfMsg( 'donate_interface-donor-email' ).'\' )', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) .
307307 '</td>';
308308 $form .= '</tr>';
309309
@@ -350,7 +350,7 @@
351351 // generate dropdown of state opts
352352 foreach ( $states as $value => $state_name ) {
353353 if ( $value !== 'YY' && $value !== 'XX' ) {
354 - $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false;
 354+ $selected = ( $this->getEscapedValue( 'state' ) == $value ) ? true : false;
355355 $state_opts .= Xml::option( $value, $value, $selected );
356356 }
357357 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php
___________________________________________________________________
Added: svn:mergeinfo
358358 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php:r99568
359359 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php:r95724-100157
360360 Merged /trunk/extensions/DonationInterface/gateway_forms/TwoStepTwoColumnPremiumUS.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,107609
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php
@@ -1,10 +1,9 @@
22 <?php
33
44 class Gateway_Form_OneStepTwoColumn extends Gateway_Form {
5 - public $paypal = false; // true for paypal only version
65
7 - public function __construct( &$gateway, &$form_errors ) {
8 - parent::__construct( $gateway, $form_errors );
 6+ public function __construct( &$gateway ) {
 7+ parent::__construct( $gateway );
98
109 // update the list of hidden fields we need to use in this form.
1110 $this->updateHiddenFields();
@@ -120,10 +119,6 @@
121120 }
122121
123122 public function generateFormStart() {
124 - global $wgRequest;
125 -
126 - $this->paypal = $wgRequest->getBool( 'paypal', false );
127 -
128123 $form = $this->generateBannerHeader();
129124
130125 $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
@@ -197,34 +192,16 @@
198193 return $form;
199194 }
200195
201 - protected function generateBannerHeader() {
202 - global $wgOut, $wgRequest;
203 - $template = '';
204 -
205 - // intro text
206 - if ( $wgRequest->getText( 'masthead', false ) ) {
207 - $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data[ 'language' ] . '}}' );
208 - } elseif ( $this->gateway->getGlobal( "Header" ) ) {
209 - $header = str_replace( '@language', $this->form_data[ 'language' ], $this->gateway->getGlobal( "Header" ) );
210 - $template = $wgOut->parse( $header );
211 - }
212 -
213 - // make sure that we actually have a matching template to display so we don't display the 'redlink'
214 - if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template ) ) {
215 - $wgOut->addHtml( $template );
216 - }
217 - }
218 -
219196 protected function generatePersonalContainer() {
220 - global $wgRequest, $wgScriptPath;
 197+ global $wgScriptPath;
221198 $form = '';
222199 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' ) );
223200 $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header', 'id' => 'payflow-cc-form-header-personal' ), wfMsg( 'donate_interface-make-your-donation' ) );
224201 if ( !$this->paypal ) {
225 - $source = htmlspecialchars( $wgRequest->getText( 'utm_source' ) );
226 - $medium = htmlspecialchars( $wgRequest->getText( 'utm_medium' ) );
227 - $campaign = htmlspecialchars( $wgRequest->getText( 'utm_campaign' ) );
228 - $formname = htmlspecialchars( $wgRequest->getText( 'form_name' ) );
 202+ $source = $this->getEscapedValue( 'utm_source' );
 203+ $medium = $this->getEscapedValue( 'utm_medium' );
 204+ $campaign = $this->getEscapedValue( 'utm_campaign' );
 205+ $formname = $this->getEscapedValue( 'form_name' );
229206 $form .= Xml::Tags( 'p', array( 'id' => 'payflowpro_gateway-cc_otherways' ), wfMsg( 'donate_interface-paypal', $wgScriptPath, $formname, $source, $medium, $campaign ) );
230207 }
231208 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php
___________________________________________________________________
Added: svn:mergeinfo
232209 Merged /trunk/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,100119-101026,101060,101063-101064,101073,101076,101335,101441,101501-101502,101549,101553,101557,101561,101638,101700,101719,101757,101785,101823,101826,101837,101846,101852,101870-101872,101882,101890,101910,101917,101929,101947,101949-101951,101955-101960,101964-101966,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102124-102125,102127,102134,102140,102147,102151-102152,102155-102156,102185-102186,102188-102241,102261,102308,102318,102332,102338,102341-102342,102345,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102736,102752,102763,102805,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102936,102938,102943,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103070,103105,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103281,103371,103397,103399,103401,103411,103413,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103636,103680,103775,103784,103837,103839,103863,103866,106109,106158,107609
233210 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php:r99568
234211 Merged /branches/fundraising/extensions/DonationInterface/gateway_forms/OneStepTwoColumn.php:r95724-100157
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php
@@ -89,7 +89,7 @@
9090 $this->setHeaders();
9191
9292 if ( $forbidden ){
93 - $this->adapter->log( "Resultswitcher: Request forbidden. " . $f_message . " Querystring Order ID: $qs_oid Adapter Order ID: " . $this->adapter->getData_Raw( 'order_id' ) );
 93+ $this->adapter->log( "Resultswitcher: Request forbidden. " . $f_message . " Querystring Order ID: $qs_oid Adapter Order ID: " . $this->adapter->getData_Unstaged_Escaped( 'order_id' ) );
9494 return;
9595 } else {
9696 $this->adapter->log( "Resultswitcher: OK to process Order ID: " . $qs_oid );
@@ -101,7 +101,7 @@
102102 $oid = $wgRequest->getText( 'order_id' );
103103
104104 //this next block is for credit card coming back from GC. Only that. Nothing else, ever.
105 - if ( $this->adapter->getData_Raw( 'payment_method') === 'cc' ) {
 105+ if ( $this->adapter->getData_Unstaged_Escaped( 'payment_method') === 'cc' ) {
106106 if ( !array_key_exists( 'order_status', $_SESSION ) || !array_key_exists( $oid, $_SESSION['order_status'] ) || !is_array( $_SESSION['order_status'][$oid] ) ) {
107107 $_SESSION['order_status'][$oid] = $this->adapter->do_transaction( 'Confirm_CreditCard' );
108108 $_SESSION['order_status'][$oid]['data']['count'] = 0;
@@ -148,7 +148,7 @@
149149 function getDeclinedResultPage() {
150150 global $wgOut;
151151
152 - $displayData = $this->adapter->getData_Raw();
 152+ $displayData = $this->adapter->getData_Unstaged_Escaped();
153153 $failpage = $this->adapter->getFailPage();
154154
155155 if ( $failpage ) {
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php
___________________________________________________________________
Modified: svn:mergeinfo
156156 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_resultswitcher.body.php:r105938
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php
@@ -6,8 +6,3 @@
77 $specialPageAliases['en'] = array(
88 'GlobalCollectGateway' => array( 'GlobalCollectGateway' ),
99 );
10 -
11 -/**
12 - * For backwards compatibility with MediaWiki 1.15 and earlier.
13 - */
14 -$aliases =& $specialPageAliases;
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php
___________________________________________________________________
Modified: svn:mergeinfo
1510 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.alias.php:r107322
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/TwoStepAmount.php
@@ -1,983 +0,0 @@
2 -<?php
3 -/**
4 - * Wikimedia Foundation
5 - *
6 - * LICENSE
7 - *
8 - * This program is free software; you can redistribute it and/or modify
9 - * it under the terms of the GNU General Public License as published by
10 - * the Free Software Foundation; either version 2 of the License, or
11 - * (at your option) any later version.
12 - *
13 - * This program is distributed in the hope that it will be useful,
14 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 - * GNU General Public License for more details.
17 - *
18 - * @since r98249
19 - * @author Jeremy Postlethwaite <jpostlethwaite@wikimedia.org>
20 - */
21 -
22 -/**
23 - * This form is designed for bank transfers
24 - */
25 -class Gateway_Form_TwoStepAmount extends Gateway_Form {
26 -
27 - /**
28 - * The default value of section header tags.
29 - *
30 - * A value of 3 => h3
31 - *
32 - * @var integer $sectionHeaderLevel
33 - */
34 - public $sectionHeaderLevel = 3;
35 -
36 - /**
37 - * The appeal
38 - *
39 - * @var string $appeal
40 - */
41 - public $appeal = '';
42 -
43 - /**
44 - * The default appeal
45 - *
46 - */
47 - const DEFAULT_APPEAL = <<<HTML
48 - <h2 id="appeal-head"> <span class="mw-headline" id="From_Wikipedia_programmer_Brandon_Harris">From Wikipedia programmer Brandon Harris</span></h2>
49 - <div id="appeal-body" class="plainlinks">
50 - <p>I feel like I'm living the first line of my obituary.</p>
51 - <p>I don't think there will be anything else that I do in my life as important as what I do now for Wikipedia. We're not just building an encyclopedia, we're working to make people free. When we have access to free knowledge, we are better people. We understand the world is bigger than us, and we become infected with tolerance and understanding.</p>
52 - <p>Wikipedia is the 5th largest website in the world. I work at the small non-profit that keeps it on the web. We don't run ads because doing so would sacrifice our independence. The site is not and should never be a propaganda tool.</p>
53 - <p>Our work is possible because of donations from our readers. Will you help protect Wikipedia by donating $5, $10, $20 or whatever you can afford?</p>
54 - <p>I work at the Wikimedia Foundation because everything in my soul tells me it's the right thing to do. I've worked at huge tech companies, doing some job to build some crappy thing that's designed to steal money from some kid who doesn't know it. I would come home from work crushed.</p>
55 - <p>You might not know this, but the Wikimedia Foundation operates with a very small staff. Most other top-ten sites have tens of thousands of people and massive budgets. But they produce a fraction of what we pull off with sticks and wire.</p>
56 - <p>When you give to Wikipedia, you're supporting free knowledge around the world. You're not only leaving a legacy for your children and for their children, you're elevating people around the world who have access to this treasure. You're assuring that one day everyone else will too.</p>
57 - <p>Thank you,</p>
58 - <p><strong>Brandon Harris</strong><br /></p>
59 - <p>Programmer, Wikimedia Foundation</p>
60 - </div>
61 -HTML;
62 -
63 - ////////////////////////////////////////////////////////////////////////////
64 - //
65 - // Form methods
66 - //
67 - ////////////////////////////////////////////////////////////////////////////
68 -
69 - /**
70 - * Initialize the form
71 - *
72 - * This is called at the end of the constructor
73 - *
74 - */
75 - protected function init() {
76 -
77 - $this->setPaymentMethod( $this->form_data['payment_method'] );
78 - $this->setPaymentSubmethod( $this->form_data['payment_submethod'] );
79 -
80 - // Should process be deprecated?
81 - $this->form_data['process'] = 'other';
82 -
83 - // Initialize the appeal
84 - $this->appeal = self::DEFAULT_APPEAL;
85 -
86 - $this->loadResources();
87 - }
88 -
89 - /**
90 - * Required method for returning the full HTML for a form.
91 - *
92 - * @return string The entire form HTML
93 - */
94 - public function getForm() {
95 -
96 - return $this->getFormPage();
97 -
98 - $form = '';
99 -
100 - $form .= $this->generateFormStart();
101 - $form .= $this->generateFormEnd();
102 - return $form;
103 - }
104 -
105 - /**
106 - * Get the form messages by type.
107 - *
108 - * Since this displays to the end user, if a key does not exist, it fails
109 - * silently and returns an empty string.
110 - *
111 - * @param string $type
112 - * @param array $options
113 - *
114 - * @todo
115 - * - Move to the parent class
116 - * - This returns error messages by paragraph tags, but it may be better to do this as a list.
117 - *
118 - * @return string Returns an HTML string
119 - */
120 - protected function getFormMessagesByType( $type, $options = array() ) {
121 -
122 - if ( isset( $options['type'] ) ) {
123 - unset( $options['type'] );
124 - }
125 -
126 - extract( $options );
127 -
128 - $defaultErrorClass = 'payment_error_message payment_error_message_' . strtolower( $type );
129 -
130 - $errorClass = isset( $errorClass ) ? $errorClass : $defaultErrorClass;
131 -
132 - $return = '';
133 -
134 - if ( isset( $this->form_errors[ $type ] ) ) {
135 -
136 - if ( is_array( $this->form_errors[ $type ] ) ) {
137 -
138 - // Loop through messages and display them as paragraphs
139 - foreach ( $this->form_errors[ $type ] as $message ) {
140 - $return .= Xml::tags( 'p', array( 'class' => $errorClass ), $message );
141 - }
142 - } else {
143 -
144 - // Display single message
145 - $return .= Xml::tags( 'p', array( 'class' => $errorClass ), $this->form_errors[ $type ] );
146 - }
147 - }
148 -
149 - return $return;
150 - }
151 -
152 - /**
153 - * Get the form messages
154 - *
155 - * @param array $options
156 - *
157 - * @return string Returns an HTML string
158 - */
159 - protected function getFormMessages( $options = array() ) {
160 -
161 - $return = '';
162 -
163 - // We want this container to exist so it can be populated with javascript messages.
164 - $return .= Xml::openElement( 'div', array( 'id' => 'payment_form_messages' ) );
165 -
166 - $return .= $this->getFormMessagesByType('general');
167 -
168 - $return .= $this->getFormMessagesByType('invalidamount');
169 -
170 - $return .= $this->getFormMessagesByType('retryMsg');
171 -
172 - $return .= Xml::closeElement( 'div' ); // payment_form_messages
173 -
174 - return $return;
175 - }
176 -
177 - /**
178 - * Get the section header tag
179 - *
180 - * @param string $section The section label
181 - * @param array $options
182 - *
183 - * @return string Returns an HTML string
184 - */
185 - protected function getFormSectionHeaderTag( $section, $options = array() ) {
186 -
187 - // Make sure $section does not get overridden.
188 - if ( isset( $options['section'] ) ) {
189 -
190 - unset( $options['section'] );
191 - }
192 -
193 - extract( $options );
194 -
195 - $headerLevel = isset( $headerLevel ) ? (integer) $headerLevel : (integer) $this->sectionHeaderLevel;
196 - $headerId = isset( $headerId ) ? (string) $headerId : '';
197 - $headerClass = isset( $headerClass ) ? (string) $headerClass : '';
198 -
199 - // Set maximum level to 6
200 - $headerLevel = ( $headerLevel > 6 ) ? 6 : $headerLevel;
201 -
202 - // Set minimum level to 2
203 - $headerLevel = ( $headerLevel < 2 ) ? 2 : $headerLevel;
204 -
205 - $headerTag = 'h' . $headerLevel;
206 -
207 - $headerOptions = array();
208 -
209 - // Add a header class
210 - if ( !empty( $headerClass ) ) {
211 - $headerOptions['class'] = $headerClass;
212 - }
213 -
214 - // Add a header id
215 - if ( !empty( $headerId ) ) {
216 - $headerOptions['id'] = $headerId;
217 - }
218 -
219 - $return = Xml::tags( $headerTag, $headerOptions, $section );
220 -
221 - return $return;
222 - }
223 -
224 - /**
225 - * Load form resources
226 - */
227 - protected function loadResources() {
228 -
229 - $this->loadValidateJs();
230 - }
231 -
232 - /**
233 - * Load extra javascript
234 - */
235 - protected function loadValidateJs() {
236 - global $wgOut;
237 - $wgOut->addModules( 'gc.form.core.validate' );
238 -
239 - $js = "\n" . '<script type="text/javascript">'
240 - . "var validatePaymentForm = {
241 - formId: '" . $this->getFormId() . "',
242 - payment_method: '" . $this->getPaymentMethod() . "',
243 - payment_submethod: '" . $this->getPaymentSubmethod() . "',
244 - }"
245 - . '</script>' . "\n";
246 - $wgOut->addHeadItem( 'loadValidateJs', $js );
247 - }
248 -
249 - ////////////////////////////////////////////////////////////////////////////
250 - //
251 - // Get and set html snippets of code for form
252 - //
253 - ////////////////////////////////////////////////////////////////////////////
254 -
255 - /**
256 - * Set the appeal
257 - *
258 - * @param string $appeal The html appeal text
259 - * @param array $options
260 - *
261 - * @return string Returns an HTML string
262 - */
263 - protected function setAppeal( $appeal, $options = array() ) {
264 -
265 - $this->appeal = $appeal;
266 - }
267 -
268 - /**
269 - * Get the appeal
270 - *
271 - * @param array $options
272 - *
273 - * @return string Returns an HTML string
274 - */
275 - protected function getAppeal( $options = array() ) {
276 -
277 - $return = '';
278 -
279 - $return .= Xml::openElement( 'div', array( 'id' => 'appeal' ) );
280 -
281 - $return .= Xml::openElement( 'div', array( 'id' => 'appeal-content' ) );
282 -
283 - $return .= $this->appeal;
284 -
285 - $return .= Xml::closeElement( 'div' ); // appeal-content
286 -
287 - $return .= Xml::closeElement( 'div' ); // appeal
288 -
289 - return $return;
290 - }
291 -
292 - /**
293 - * Generate the bank transfer component
294 - *
295 - * Nothing is being added right now.
296 - *
297 - * @param array $options
298 - *
299 - * @return string Returns an HTML string
300 - */
301 - protected function getBankTransfer( $options = array() ) {
302 -
303 - extract( $options );
304 -
305 - $return = '';
306 -
307 - return $return;
308 - }
309 -
310 - /**
311 - * Generate the credit card component
312 - *
313 - * Nothing is being added right now.
314 - *
315 - * @param array $options
316 - *
317 - * @return string Returns an HTML string
318 - */
319 - protected function getCreditCard( $options = array() ) {
320 -
321 - extract( $options );
322 -
323 - $return = '';
324 -
325 - return $return;
326 - }
327 -
328 - /**
329 - * Generate the direct debit component
330 - *
331 - * @param array $options
332 - *
333 - * @return string Returns an HTML string
334 - */
335 - protected function getDirectDebit( $options = array() ) {
336 -
337 - extract( $options );
338 -
339 - $return = '';
340 -
341 - $ignore = isset( $ignore ) ? (array) $ignore : array();
342 -
343 - if ( $this->getPaymentMethod() != 'dd' ) {
344 -
345 - // No direct debit fields need to be loaded.
346 - return $return;
347 - }
348 -
349 - $fields = array(
350 - 'account_name' => array( 'required' => true, ),
351 - 'account_number' => array( 'required' => true, ),
352 - 'authorization_id' => array( 'required' => true, ),
353 - 'bank_check_digit' => array( 'required' => true, ),
354 - 'bank_code' => array( 'required' => true, ),
355 - 'bank_name' => array( 'required' => true, ),
356 - 'branch_code' => array( 'required' => true, ),
357 - 'iban' => array( 'required' => true, ),
358 - );
359 -
360 - $country = isset( $this->form_data['country'] ) ? $this->form_data['country'] : '';
361 -
362 - if ( $country == 'AT' ) {
363 -
364 - unset( $fields['bank_check_digit'] );
365 - unset( $fields['branch_code'] );
366 - unset( $fields['iban'] );
367 - }
368 - elseif ( $country == 'BE' ) {
369 -
370 - unset( $fields['branch_code'] );
371 - unset( $fields['iban'] );
372 - }
373 - elseif ( $country == 'IT' ) {
374 -
375 - unset( $fields['iban'] );
376 - }
377 - elseif ( $country == 'NL' ) {
378 -
379 - unset( $fields['bank_check_digit'] );
380 - unset( $fields['branch_code'] );
381 - unset( $fields['iban'] );
382 - }
383 - elseif ( $country == 'ES' ) {
384 -
385 - unset( $fields['iban'] );
386 - }
387 -
388 -
389 - foreach ( $fields as $field => $meta ) {
390 -
391 - // Skip ignored fields
392 - if ( in_array( $field, $ignore ) ) {
393 -
394 - continue;
395 - }
396 -
397 - $return .= '<tr>';
398 - $return .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-dd-' . $field ), $field ) . '</td>';
399 -
400 - $return .= '<td>';
401 -
402 - $required = isset ( $meta['required'] ) ? (boolean) $meta['required'] : false ;
403 - $elementClass = '';
404 - $elementClass .= $required ? ' required ' : '' ;
405 - $elementClass = trim( $elementClass );
406 -
407 - $return .= Xml::input( $field, '', $this->form_data[ $field ], array( 'class' => $elementClass, 'type' => 'text', 'maxlength' => '32', 'id' => $field ) );
408 - $return .= '</td>';
409 - $return .= '</tr>';
410 - }
411 -
412 - return $return;
413 - }
414 -
415 - /**
416 - * Get the end of the form
417 - *
418 - * This method gets the hidden fields and appends the closing form tag.
419 - *
420 - * @param array $options
421 - *
422 - * @return string Returns an HTML string
423 - */
424 - protected function getFormEnd( $options = array() ) {
425 -
426 - extract( $options );
427 -
428 - $return = '';
429 -
430 - $return .= $this->generateFormSubmit();
431 -
432 - // Add hidden fields
433 - foreach ( $this->getHiddenFields() as $field => $value ) {
434 -
435 - $return .= Html::hidden( $field, $value );
436 - }
437 -
438 - $return .= Xml::closeElement( 'form' );
439 -
440 - return $return;
441 - }
442 -
443 - /**
444 - * Get the page including form and content
445 - *
446 - * @param array $options
447 - *
448 - * @return string Returns an HTML string
449 - */
450 - protected function getFormPage( $options = array() ) {
451 -
452 - extract( $options );
453 -
454 - $return = '';
455 -
456 - $headerLevel = isset( $headerLevel ) ? (integer) $headerLevel : 3;
457 -
458 - // Tell the user they need JavaScript enabled.
459 - $return .= $this->getNoScript();
460 -
461 - // Display the form messages
462 - $return .= $this->getFormMessages( $options );
463 -
464 - $return .= Xml::openElement( 'div', array( 'id' => 'payment_form_container' ) );
465 -
466 - $return .= $this->getFormStart();
467 -
468 - $return .= $this->getCaptchaHTML();
469 -
470 - $return .= $this->getFormSectionAmount();
471 -
472 - $return .= $this->getFormSectionPersonal();
473 -
474 - $return .= $this->getFormSectionPayment();
475 -
476 - $return .= $this->getFormEnd();
477 -
478 - $return .= $this->generateDonationFooter();
479 -
480 - $return .= Xml::closeElement( 'div' ); // payment_form_container
481 -
482 - // Display the appeal
483 - $return .= $this->getAppeal( $options );
484 -
485 - return $return;
486 - }
487 -
488 - /**
489 - * Get the page including form and content
490 - *
491 - * @param array $options
492 - *
493 - * @return string Returns an HTML string
494 - */
495 - protected function generateFormSubmit( $options = array() ) {
496 -
497 - extract( $options );
498 -
499 - $return = '';
500 -
501 - // submit button
502 - $return .= Xml::openElement( 'div', array( 'id' => 'payment_gateway-form-submit' ) );
503 - $return .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
504 - $return .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'donate_interface-submit-button' ), 'type' => 'submit' ) );
505 - $return .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
506 - $return .= Xml::closeElement( 'div' ); // close div#payment_gateway-form-submit
507 -
508 - return $return;
509 - }
510 -
511 - /**
512 - * Get the start of the form
513 - *
514 - * @param array $options
515 - *
516 - * @return string Returns an HTML string
517 - */
518 - protected function getFormStart( $options = array() ) {
519 -
520 - extract( $options );
521 -
522 - $return = '';
523 -
524 - $formOptions = array(
525 - 'action' => $this->getNoCacheAction(),
526 - 'autocomplete' => 'off',
527 - 'id' => $this->getFormId(),
528 - 'method' => 'post',
529 - 'name' => $this->getFormName(),
530 - 'onsubmit' => '',
531 - );
532 -
533 - // Xml::element seems to convert html to htmlentities
534 - $return .= Xml::openElement( 'form', $formOptions );
535 -
536 - return $return;
537 - }
538 -
539 - /**
540 - * Generate the bank transfer component
541 - *
542 - * Nothing is being added right now.
543 - *
544 - * @param array $options
545 - *
546 - * @return string Returns an HTML string
547 - */
548 - protected function getRealTimeBankTransfer( $options = array() ) {
549 -
550 - extract( $options );
551 -
552 - $return = '';
553 -
554 - $payment_submethod = $this->gateway->getPaymentSubmethodMeta( $this->getPaymentSubmethod() );
555 - if ( !isset( $payment_submethod['issuerids'] ) || empty( $payment_submethod['issuerids'] ) ) {
556 -
557 - // No issuer_id to load
558 - return $return;
559 - }
560 -
561 - $selectOptions = '';
562 -
563 - // generate dropdown of issuer_ids
564 - foreach ( $payment_submethod['issuerids'] as $issuer_id => $issuer_id_label ) {
565 - $selected = ( $this->form_data['issuer_id'] == $issuer_id ) ? true : false;
566 - //$selectOptions .= Xml::option( wfMsg( 'donate_interface-rtbt-' . $issuer_id ), $issuer_id_label, $selected );
567 - $selectOptions .= Xml::option( $issuer_id_label, $issuer_id, $selected );
568 - }
569 - $return .= '<tr>';
570 - $return .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-rtbt-issuer_id' ), 'issuer_id' ) . '</td>';
571 -
572 - $return .= '<td>';
573 - $return .= Xml::openElement(
574 - 'select',
575 - array(
576 - 'name' => 'issuer_id',
577 - 'id' => 'issuer_id',
578 - 'onchange' => '',
579 - ) );
580 - $return .= $selectOptions;
581 - $return .= Xml::closeElement( 'select' );
582 -
583 - $return .= '</td>';
584 - $return .= '</tr>';
585 -
586 - return $return;
587 - }
588 -
589 - ////////////////////////////////////////////////////////////////////////////
590 - //
591 - // Form sections
592 - //
593 - ////////////////////////////////////////////////////////////////////////////
594 -
595 - /**
596 - * Get the donation amount section
597 - *
598 - * @param array $options
599 - *
600 - * Fields:
601 - * - amount|amountRadio
602 - * - currency_code
603 - *
604 - * @return string Returns an HTML string
605 - */
606 - protected function getFormSectionAmount( $options = array() ) {
607 -
608 - $return = '';
609 -
610 - $id = 'section_amount';
611 -
612 - $headerOptions = $options;
613 -
614 - $headerOptions['id'] = $id . '_header';
615 -
616 - $return .= $this->getFormSectionHeaderTag( wfMsg( 'donate_interface-payment_method-' . $this->getPaymentMethod() ), $headerOptions );
617 -
618 - $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id
619 -
620 - $radioOptions = array();
621 - $radioOptions['showCardsOnCurrencyChange'] = false;
622 -
623 - $country = isset( $this->form_data['country'] ) ? $this->form_data['country'] : '';
624 -
625 - if ( $country == 'SG' ) {
626 - $radioOptions['setCurrency'] = 'SGD';
627 - }
628 -
629 - $return .= $this->generateAmountByRadio( $radioOptions );
630 -
631 - $return .= Xml::closeElement( 'div' ); // $id
632 -
633 - return $return;
634 - }
635 -
636 - /**
637 - * Get the personal information section
638 - *
639 - * @param array $options
640 - *
641 - * Fields:
642 - * - fname
643 - * - lname
644 - * - email
645 - * - street
646 - * - city
647 - * - zip
648 - * - country
649 - *
650 - * @return string Returns an HTML string
651 - */
652 - protected function getFormSectionPersonal( $options = array() ) {
653 -
654 - $return = '';
655 -
656 - $id = 'section_personal';
657 -
658 - $headerOptions = $options;
659 -
660 - $headerOptions['id'] = $id . '_header';
661 -
662 - $return .= $this->getFormSectionHeaderTag( wfMsg( 'donate_interface-cc-form-header-personal' ), $headerOptions );
663 -
664 - $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id
665 -
666 - $return .= Xml::openElement( 'table', array( 'id' => $id . '_table' ) );
667 -
668 - $return .= $this->getNameField();
669 -
670 - // email
671 - $return .= $this->getEmailField();
672 -
673 - // street
674 - $return .= $this->getStreetField();
675 -
676 - // city
677 - $return .= $this->getCityField();
678 -
679 - // state
680 - $return .= $this->getStateField();
681 -
682 - // zip
683 - $return .= $this->getZipField();
684 -
685 - // country
686 - $return .= $this->getCountryField();
687 -
688 - $return .= Xml::closeElement( 'table' ); // close $id . '_table'
689 -
690 - $return .= Xml::closeElement( 'div' ); // $id
691 -
692 - return $return;
693 - }
694 -
695 - /**
696 - * Get the payment information section
697 - *
698 - * @param array $options
699 - *
700 - * Fields:
701 - * - rtbt
702 - * - bt
703 - * - dd
704 - *
705 - * @return string Returns an HTML string
706 - */
707 - protected function getFormSectionPayment( $options = array() ) {
708 -
709 - $return = '';
710 -
711 - $id = 'section_personal';
712 -
713 - $headerOptions = $options;
714 -
715 - $headerOptions['id'] = $id . '_header';
716 -
717 - $return .= $this->getFormSectionHeaderTag( wfMsg( 'donate_interface-cc-form-header-payment' ), $headerOptions );
718 -
719 - $return .= Xml::openElement( 'div', array( 'id' => $id ) ); // $id
720 -
721 - $return .= Xml::openElement( 'table', array( 'id' => $id . '_table' ) );
722 -
723 - switch ( $this->getPaymentMethod() ) {
724 - case 'bt':
725 - $return .= $this->getBankTransfer();
726 - break;
727 - case 'cc':
728 - $return .= $this->getCreditCard();
729 - break;
730 - case 'dd':
731 - $return .= $this->getDirectDebit();
732 - break;
733 - case 'rtbt':
734 - $return .= $this->getRealTimeBankTransfer();
735 - break;
736 - default:
737 - $return .= $this->getCreditCard();
738 - break;
739 - }
740 -
741 - $return .= Xml::closeElement( 'table' ); // close $id . '_table'
742 -
743 - $return .= Xml::closeElement( 'div' ); // $id
744 -
745 - return $return;
746 - }
747 -
748 - ////////////////////////////////////////////////////////////////////////////
749 - //
750 - // Deprecated
751 - //
752 - ////////////////////////////////////////////////////////////////////////////
753 -
754 - /**
755 - * Generate the payment information
756 - *
757 - * @todo
758 - * - a large part of this method is for debugging and may need to be removed.
759 - */
760 - public function generateFormPaymentInformation() {
761 -
762 - $form = '';
763 -
764 - // Payment debugging information
765 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-payment-information' ) );
766 -
767 - $form .= Xml::tags( 'h2', array(), 'Payment debugging information' );
768 -
769 - $form .= Xml::openElement( 'ul', array() ); // open div#mw-payment-information ul
770 - $form .= Xml::tags( 'li', array(), 'payment_method: ' . $this->getPaymentMethod() );
771 - $form .= Xml::tags( 'li', array(), 'payment_submethod: ' . $this->getPaymentSubmethod() );
772 -
773 - if ( isset( $this->form_data['issuer_id'] ) ) {
774 - $form .= Xml::tags( 'li', array(), 'issuer_id: ' . $this->form_data['issuer_id'] );
775 - }
776 -
777 - $form .= Xml::closeElement( 'ul' ); // close div#mw-payment-information ul
778 -
779 - $form .= Xml::tags( 'h3', array(), 'Payment choices' );
780 -
781 - $form .= Xml::tags( 'h4', array(), 'Payment method:' );
782 -
783 - $form .= Xml::openElement( 'ul', array() ); // open div#mw-payment-information ul
784 -
785 - // Payment methods that are not supported by this form.
786 - $ignorePaymentMethod = array( 'cc', );
787 -
788 - // Loop through forms to display
789 - foreach ( $this->gateway->getPaymentMethods() as $payment_method => $payment_methodMeta ) {
790 -
791 - if ( in_array( $payment_method, $ignorePaymentMethod ) ) {
792 - continue;
793 - }
794 -
795 - $form .= Xml::openElement( 'li', array() );
796 -
797 - $form .= Xml::tags( 'span', array(), $payment_method );
798 -
799 - foreach ( $payment_methodMeta['types'] as $payment_submethod ) {
800 - $form .= ' - ' . Xml::tags( 'a', array('href'=>'?form_name=TwoStepAmount&payment_method=' . $payment_method . '&payment_submethod=' . $payment_submethod), $payment_submethod );
801 - }
802 -
803 - $form .= Xml::closeElement( 'li' );
804 - }
805 -
806 - $form .= Xml::closeElement( 'ul' ); // close div#mw-payment-information ul
807 -
808 - $form .= Xml::closeElement( 'div' ); // close div#mw-payment-information
809 -
810 - return $form;
811 - }
812 -
813 - /**
814 - * Generate the issuerId for real time bank transfer
815 - */
816 - public function generateFormIssuerIdDropdown() {
817 -
818 - $form = '';
819 - //return $form;
820 -
821 - $payment_submethod = $this->gateway->getPaymentSubmethodMeta( $this->getPaymentSubmethod() );
822 - if ( !isset( $payment_submethod['issuerids'] ) || empty( $payment_submethod['issuerids'] ) ) {
823 -
824 - // No issuer_id to load
825 - return $form;
826 - }
827 -
828 - $selectOptions = '';
829 -
830 - // generate dropdown of issuer_ids
831 - foreach ( $payment_submethod['issuerids'] as $issuer_id => $issuer_id_label ) {
832 - $selected = ( $this->form_data['issuer_id'] == $issuer_id ) ? true : false;
833 - //$selectOptions .= Xml::option( wfMsg( 'donate_interface-rtbt-' . $issuer_id ), $issuer_id_label, $selected );
834 - $selectOptions .= Xml::option( $issuer_id_label, $issuer_id, $selected );
835 - }
836 - $form .= '<tr>';
837 - $form .= '<td class="label">' . Xml::label( wfMsg( 'donate_interface-rtbt-issuer_id' ), 'issuer_id' ) . '</td>';
838 -
839 - $form .= '<td>';
840 - $form .= Xml::openElement(
841 - 'select',
842 - array(
843 - 'name' => 'issuer_id',
844 - 'id' => 'issuer_id',
845 - 'onchange' => '',
846 - ) );
847 - $form .= $selectOptions;
848 - $form .= Xml::closeElement( 'select' );
849 -
850 - $form .= '</td>';
851 - $form .= '</tr>';
852 -
853 - return $form;
854 - }
855 -
856 -
857 - /**
858 - * Generate the first part of the form
859 - */
860 - public function generateFormStart() {
861 -
862 - $form = '';
863 -
864 - //$form .= $this->generateBannerHeader();
865 -
866 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
867 -
868 - // provide a place at the top of the form for displaying general messages
869 - if ( $this->form_errors['general'] ) {
870 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-payment-general-error' ) );
871 - if ( is_array( $this->form_errors['general'] ) ) {
872 - foreach ( $this->form_errors['general'] as $this->form_errors_msg ) {
873 - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
874 - }
875 - } else {
876 - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
877 - }
878 - $form .= Xml::closeElement( 'div' );
879 - }
880 -
881 - // add noscript tags for javascript disabled browsers
882 - $form .= $this->getNoScript();
883 -
884 - $form .= $this->generateFormPaymentInformation();
885 -
886 - // open form
887 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
888 -
889 - // Xml::element seems to convert html to htmlentities
890 - $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
891 - $form .= Xml::openElement( 'form', array( 'id' => $this->getFormId(), 'name' => $this->getFormName(), 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => '', 'autocomplete' => 'off' ) );
892 -
893 - $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payment-cc-form-section' ) );
894 - $form .= $this->generatePersonalContainer();
895 - $form .= $this->generatePaymentContainer();
896 - $form .= $this->generateFormSubmit();
897 - $form .= Xml::closeElement( 'div' ); // close div#left-column
898 -
899 - //$form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payment-cc-form-section' ) );
900 -
901 - return $form;
902 - }
903 -
904 - public function generateFormEnd() {
905 - $form = '';
906 - // add hidden fields
907 - $hidden_fields = $this->getHiddenFields();
908 - foreach ( $hidden_fields as $field => $value ) {
909 - $form .= Html::hidden( $field, $value );
910 - }
911 -
912 - $form .= Xml::closeElement( 'form' );
913 - $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form
914 - $form .= $this->generateDonationFooter();
915 - $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard
916 - return $form;
917 - }
918 -
919 - protected function generatePersonalContainer() {
920 - $form = '';
921 - $form .= Xml::openElement( 'div', array( 'id' => 'payment_gateway-personal-info' ) ); ;
922 - //$form .= Xml::tags( 'h3', array( 'class' => 'payment-cc-form-header', 'id' => 'payment-cc-form-header-personal' ), wfMsg( 'donate_interface-cc-form-header-personal' ) );
923 - $form .= Xml::openElement( 'table', array( 'id' => 'payment-table-donor' ) );
924 -
925 - $form .= $this->generatePersonalFields();
926 -
927 - $form .= Xml::closeElement( 'table' ); // close table#payment-table-donor
928 - $form .= Xml::closeElement( 'div' ); // close div#payment_gateway-personal-info
929 -
930 - return $form;
931 - }
932 -
933 - protected function generatePersonalFields() {
934 - // first name
935 - $form = $this->getNameField();
936 -
937 - // country
938 - $form .= $this->getCountryField();
939 -
940 - // street
941 - $form .= $this->getStreetField();
942 -
943 -
944 - // city
945 - $form .= $this->getCityField();
946 -
947 - // state
948 - $form .= $this->getStateField();
949 -
950 - // zip
951 - $form .= $this->getZipField();
952 -
953 - // email
954 - $form .= $this->getEmailField();
955 -
956 - return $form;
957 - }
958 -
959 - protected function generatePaymentContainer() {
960 - $form = '';
961 - // credit card info
962 - $form .= Xml::openElement( 'div', array( 'id' => 'donation-payment-info' ) );
963 - //$form .= Xml::tags( 'h3', array( 'class' => 'payment-cc-form-header', 'id' => 'payment-cc-form-header-payment' ), wfMsg( 'donate_interface-cc-form-header-payment' ) );
964 - $form .= Xml::openElement( 'table', array( 'id' => 'donation-table-cc' ) );
965 -
966 - $form .= $this->generatePaymentFields();
967 -
968 - $form .= Xml::closeElement( 'table' ); // close table#payment-table-cc
969 - $form .= Xml::closeElement( 'div' ); // close div#payment_gateway-payment-info
970 -
971 - return $form;
972 - }
973 -
974 - protected function generatePaymentFields() {
975 - // amount
976 - $form .= $this->generateAmountByRadio();
977 -
978 - $form .= $this->generateFormIssuerIdDropdown();
979 - $form .= $this->generateFormDirectDebit();
980 -
981 -
982 - return $form;
983 - }
984 -}
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
@@ -125,7 +125,7 @@
126126 $final .= " Status $status = $count\n";
127127 }
128128 }
129 -
 129+ $this->adapter->log($final);
130130 echo $final;
131131 }
132132
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php
___________________________________________________________________
Modified: svn:mergeinfo
133133 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphans.php:r105938
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php
@@ -36,7 +36,7 @@
3737 //re-init all these arrays, because this is a batch thing.
3838 $this->hard_data = array( );
3939 $this->transaction_results = array( );
40 - $this->raw_data = array( );
 40+ $this->unstaged_data = array( );
4141 $this->staged_data = array( );
4242
4343 $this->hard_data['order_id'] = $data['order_id'];
@@ -44,7 +44,7 @@
4545
4646 $this->dataObj = new DonationData( get_called_class(), false, $data );
4747
48 - $this->raw_data = $this->dataObj->getData();
 48+ $this->unstaged_data = $this->dataObj->getDataEscaped();
4949
5050 if ( $useDB ){
5151 $this->hard_data = array_merge( $this->hard_data, $this->getUTMInfoFromDB() );
@@ -61,7 +61,7 @@
6262 }
6363 $this->reAddHardData();
6464
65 - $this->staged_data = $this->raw_data;
 65+ $this->staged_data = $this->unstaged_data;
6666
6767 $this->setPostDefaults();
6868 $this->defineTransactions();
@@ -86,7 +86,7 @@
8787 //anywhere else, and this would constitute abuse of the system.
8888 //so don't do it.
8989 foreach ( $this->hard_data as $key => $val ) {
90 - $this->raw_data[$key] = $val;
 90+ $this->unstaged_data[$key] = $val;
9191 $this->staged_data[$key] = $val;
9292 }
9393 }
@@ -95,7 +95,7 @@
9696 switch ( $transaction ) {
9797 case 'SET_PAYMENT':
9898 case 'CANCEL_PAYMENT':
99 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ": CVV: " . $this->getData_Raw( 'cvv_result' ) . ": AVS: " . $this->getData_Raw( 'avs_result' ) );
 99+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ": CVV: " . $this->getData_Unstaged_Escaped( 'cvv_result' ) . ": AVS: " . $this->getData_Unstaged_Escaped( 'avs_result' ) );
100100 //and then go on, unless you're testing, in which case:
101101 // return "NOPE";
102102 // break;
@@ -130,7 +130,7 @@
131131 return null;
132132 }
133133
134 - $ctid = $this->getData_Raw( 'contribution_tracking_id' );
 134+ $ctid = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' );
135135
136136 $data = array( );
137137
@@ -191,11 +191,11 @@
192192 return;
193193 }
194194
195 - if ( !is_null( $this->getData_Raw( 'date' ) ) ) {
196 - $timestamp = $this->getData_Raw( 'date' );
 195+ if ( !is_null( $this->getData_Unstaged_Escaped( 'date' ) ) ) {
 196+ $timestamp = $this->getData_Unstaged_Escaped( 'date' );
197197 } else {
198 - if ( !is_null( $this->getData_Raw( 'ts' ) ) ) {
199 - $timestamp = strtotime( $this->getData_Raw( 'ts' ) ); //I hate that this works.
 198+ if ( !is_null( $this->getData_Unstaged_Escaped( 'ts' ) ) ) {
 199+ $timestamp = strtotime( $this->getData_Unstaged_Escaped( 'ts' ) ); //I hate that this works.
200200 } else {
201201 $timestamp = time();
202202 }
@@ -208,7 +208,7 @@
209209 'gateway_txn_id' => $this->getTransactionGatewayTxnID(),
210210 //'language' => '',
211211 );
212 - $transaction += $this->getData_Raw();
 212+ $transaction += $this->getData_Unstaged_Escaped();
213213
214214 try {
215215 wfRunHooks( $hook, array( $transaction ) );
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php
___________________________________________________________________
Modified: svn:mergeinfo
216216 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/scripts/orphan_adapter.php:r105938
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
@@ -86,12 +86,11 @@
8787 $payment_submethod = $this->adapter->getPaymentSubmethod();
8888
8989 // Check form for errors
90 - $form_errors = $this->validateForm( $this->errors, $this->adapter->getPaymentSubmethodFormValidation() );
 90+ $form_errors = $this->validateForm( $this->adapter->getPaymentSubmethodFormValidation() );
9191
9292 // If there were errors, redisplay form, otherwise proceed to next step
9393 if ( $form_errors ) {
94 -
95 - $this->displayForm( $this->errors );
 94+ $this->displayForm();
9695 } else { // The submitted form data is valid, so process it
9796 // allow any external validators to have their way with the data
9897 // Execute the proper transaction code:
@@ -179,18 +178,20 @@
180179
181180 //TODO: Get rid of $data out here completely, by putting this logic inside the adapter somewhere.
182181 //All we seem to be doing with it now, is internal adapter logic outside of the adapter.
183 - $data = $this->adapter->getData_Raw();
 182+ $data = $this->adapter->getData_Unstaged_Escaped();
184183
185184 // If the result of the previous transaction was failure, set the retry message.
186185 if ( $data && array_key_exists( 'response', $data ) && $data['response'] == 'failure' ) {
187 - $this->errors['retryMsg'] = wfMsg( 'php-response-declined' );
 186+ $error['retryMsg'] = wfMsg( 'php-response-declined' );
 187+ $this->adapter->addManualError( $error );
188188 }
189189
190 - $this->displayForm( $this->errors );
 190+ $this->displayForm();
191191 }
192192 } else { //token mismatch
193 - $this->errors['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' );
194 - $this->displayForm( $this->errors );
 193+ $error['general']['token-mismatch'] = wfMsg( 'donate_interface-token-mismatch' );
 194+ $this->adapter->addManualError( $error );
 195+ $this->displayForm();
195196 }
196197 }
197198
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
___________________________________________________________________
Modified: svn:mergeinfo
198199 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php:r105938,107609
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -591,7 +591,6 @@
592592 'label' => 'Bank transfer',
593593 'types' => array( 'bt', ),
594594 'validation' => array( 'creditCard' => false, )
595 - //'forms' => array( 'Gateway_Form_TwoStepAmount', ),
596595 );
597596
598597 // Credit Cards
@@ -605,7 +604,6 @@
606605 'label' => 'Direct Debit',
607606 'types' => array( 'dd_at', 'dd_be', 'dd_ch', 'dd_de', 'dd_es','dd_fr', 'dd_gb', 'dd_it', 'dd_nl', ),
608607 'validation' => array( 'creditCard' => false, )
609 - //'forms' => array( 'Gateway_Form_TwoStepAmount', ),
610608 );
611609
612610 // eWallets
@@ -613,7 +611,6 @@
614612 'label' => 'eWallets',
615613 'types' => array( 'ew_cashu', 'ew_moneybookers', 'ew_paypal', 'ew_webmoney', ),
616614 'validation' => array( 'address' => false, 'creditCard' => false, )
617 - //'forms' => array( 'Gateway_Form_TwoStepAmount', ),
618615 );
619616
620617 // Bank Transfers
@@ -621,7 +618,6 @@
622619 'label' => 'Online bank transfer',
623620 'types' => array( 'bpay', ),
624621 'validation' => array( 'creditCard' => false, )
625 - //'forms' => array( 'Gateway_Form_TwoStepAmount', ),
626622 );
627623
628624 // Real Time Bank Transfers
@@ -1074,9 +1070,9 @@
10751071 $is_orphan = false;
10761072 if ( count( $addme ) ){ //nothing unusual here.
10771073 $this->addData( $addme );
1078 - $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': ';
1079 - $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' );
1080 - $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' );
 1074+ $logmsg = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ': ';
 1075+ $logmsg .= 'CVV Result: ' . $this->getData_Unstaged_Escaped( 'cvv_result' );
 1076+ $logmsg .= ', AVS Result: ' . $this->getData_Unstaged_Escaped( 'avs_result' );
10811077 self::log( $logmsg );
10821078 } else { //this is an orphan transaction.
10831079 $this->staged_data['order_id'] = $this->staged_data['i_order_id'];
@@ -1109,9 +1105,9 @@
11101106 $gotCVV = true;
11111107 $this->addData( $addme );
11121108 $this->staged_data['order_id'] = $this->staged_data['i_order_id'];
1113 - $logmsg = $this->getData_Raw( 'contribution_tracking_id' ) . ': ';
1114 - $logmsg .= 'CVV Result: ' . $this->getData_Raw( 'cvv_result' );
1115 - $logmsg .= ', AVS Result: ' . $this->getData_Raw( 'avs_result' );
 1109+ $logmsg = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ': ';
 1110+ $logmsg .= 'CVV Result: ' . $this->getData_Unstaged_Escaped( 'cvv_result' );
 1111+ $logmsg .= ', AVS Result: ' . $this->getData_Unstaged_Escaped( 'avs_result' );
11161112 self::log( $logmsg );
11171113 $this->runPreProcessHooks();
11181114 $status_result['action'] = $this->getValidationAction();
@@ -1222,7 +1218,7 @@
12231219
12241220 if ( $problemflag ){
12251221 //we have probably had a communication problem that could mean stranded payments.
1226 - $problemmessage = $this->getData_Raw( 'contribution_tracking_id' ) . ':' . $this->getData_Raw( 'order_id' ) . ' ' . $problemmessage;
 1222+ $problemmessage = $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ':' . $this->getData_Unstaged_Escaped( 'order_id' ) . ' ' . $problemmessage;
12271223 self::log( $problemmessage );
12281224 //hurm. It would be swell if we had a message that told the user we had some kind of internal error.
12291225 $ret = array(
@@ -1252,7 +1248,7 @@
12531249 $xmlString = $this->stripXMLResponseHeaders( $rawResponse );
12541250 $displayXML = $this->formatXmlString( $xmlString );
12551251 $realXML = new DomDocument( '1.0' );
1256 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ": Raw XML Response:\n" . $displayXML ); //I am apparently a huge fibber.
 1252+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ": Raw XML Response:\n" . $displayXML ); //I am apparently a huge fibber.
12571253 $realXML->loadXML( trim( $xmlString ) );
12581254 return $realXML;
12591255 }
@@ -1646,7 +1642,7 @@
16471643 //set the transaction result message
16481644 $responseStatus = isset( $response['STATUSID'] ) ? $response['STATUSID'] : '';
16491645 $this->setTransactionResult( "Response Status: " . $responseStatus, 'txn_message' ); //TODO: Translate for GC.
1650 - $this->setTransactionResult( $this->getData_Raw( 'order_id' ), 'gateway_txn_id' );
 1646+ $this->setTransactionResult( $this->getData_Unstaged_Escaped( 'order_id' ), 'gateway_txn_id' );
16511647 }
16521648
16531649 /**
@@ -2032,7 +2028,7 @@
20332029 // Get the default returnto
20342030 $returnto = $this->getData_Staged( 'returnto' );
20352031
2036 - if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){
 2032+ if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc' ){
20372033
20382034 // Add order ID to the returnto URL, only if it's not already there.
20392035 //TODO: This needs to be more robust (like actually pulling the
@@ -2053,7 +2049,7 @@
20542050
20552051 protected function pre_process_insert_orderwithpayment(){
20562052 $this->incrementNumAttempt();
2057 - if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){
 2053+ if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc' ){
20582054 $this->addDonorDataToSession();
20592055 }
20602056 }
@@ -2074,7 +2070,7 @@
20752071 }
20762072
20772073 protected function pre_process_get_orderstatus(){
2078 - if ( $this->getData_Raw( 'payment_method' ) === 'cc' ){
 2074+ if ( $this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc' ){
20792075 $this->runPreProcessHooks();
20802076 }
20812077 }
@@ -2084,13 +2080,13 @@
20852081 * determine if we want to fail the transaction ourselves or not.
20862082 */
20872083 public function getCVVResult(){
2088 - if ( is_null( $this->getData_Raw( 'cvv_result' ) ) ){
 2084+ if ( is_null( $this->getData_Unstaged_Escaped( 'cvv_result' ) ) ){
20892085 return null;
20902086 }
20912087
20922088 $cvv_map = $this->getGlobal( 'CvvMap' );
20932089
2094 - $result = $cvv_map[$this->getData_Raw( 'cvv_result' )];
 2090+ $result = $cvv_map[$this->getData_Unstaged_Escaped( 'cvv_result' )];
20952091 return $result;
20962092
20972093 }
@@ -2100,7 +2096,7 @@
21012097 * determine if we want to fail the transaction ourselves or not.
21022098 */
21032099 public function getAVSResult(){
2104 - if ( is_null( $this->getData_Raw( 'avs_result' ) ) ){
 2100+ if ( is_null( $this->getData_Unstaged_Escaped( 'avs_result' ) ) ){
21052101 return null;
21062102 }
21072103 //Best guess here:
@@ -2108,7 +2104,7 @@
21092105
21102106 $avs_map = $this->getGlobal( 'AvsMap' );
21112107
2112 - $result = $avs_map[$this->getData_Raw( 'avs_result' )];
 2108+ $result = $avs_map[$this->getData_Unstaged_Escaped( 'avs_result' )];
21132109 return $result;
21142110 }
21152111
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
___________________________________________________________________
Modified: svn:mergeinfo
21162112 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php:r105938,106366
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/gateway.adapter.php
@@ -163,16 +163,22 @@
164164 protected $staged_vars = array();
165165 protected $return_value_map;
166166 protected $staged_data;
167 - protected $raw_data;
 167+ protected $unstaged_data;
168168 protected $postdatadefaults;
169169 protected $xmlDoc;
170170 protected $dataObj;
171171 protected $transaction_results;
172 - protected $form_class;
173172 protected $validation_errors;
 173+ protected $manual_errors = array();
174174 protected $current_transaction;
175175 protected $action;
176176 public $debugarray;
 177+ /**
 178+ * A boolean that will tell us if we've posted to ourselves. A little more telling than
 179+ * $wgRequest->wasPosted(), as something else could have posted to us.
 180+ * @var boolean
 181+ */
 182+ public $posted = false;
177183 protected $batch = false;
178184
179185 //ALL OF THESE need to be redefined in the children. Much voodoo depends on the accuracy of these constants.
@@ -221,9 +227,10 @@
222228
223229 $this->dataObj = new DonationData( get_called_class(), self::getGlobal( 'Test' ), $external_data );
224230
225 - $this->raw_data = $this->dataObj->getData();
226 - $this->staged_data = $this->raw_data;
 231+ $this->unstaged_data = $this->dataObj->getDataEscaped();
 232+ $this->staged_data = $this->unstaged_data;
227233
 234+ //If we ever put numAttempt in the session, we'll probably want to re-examine which form value we want to use here.
228235 $this->posted = ( $this->dataObj->wasPosted() && ( !is_null( $wgRequest->getVal( 'numAttempt', null ) ) ) );
229236
230237 $this->setPostDefaults( $postDefaults );
@@ -284,7 +291,7 @@
285292 $page = self::getGlobal( "FailPage" );
286293 if ( $page ) {
287294
288 - $language = $this->getData_Raw( 'language' );
 295+ $language = $this->getData_Unstaged_Escaped( 'language' );
289296
290297 $page .= '?uselang=' . $language;
291298 }
@@ -300,7 +307,7 @@
301308 * @return string A URL
302309 */
303310 protected function appendLanguageAndMakeURL( $url ){
304 - $language = $this->getData_Raw( 'language' );
 311+ $language = $this->getData_Unstaged_Escaped( 'language' );
305312 //make sure we don't already have the language in there...
306313 $dirs = explode('/', $url);
307314 if ( !is_array($dirs) || !in_array( $language, $dirs ) ){
@@ -387,20 +394,24 @@
388395 /**
389396 * This is the ONLY getData type function anything should be using
390397 * outside the adapter.
391 - * Please note that in this case, raw means it's been normalized and
392 - * sanitized by DonationData. Mostly, we qualify it as "raw" because it's
393 - * not been staged for this adapter.
 398+ * Short explanation of the data population up to now:
 399+ * *) When the gateway adapter is constructed, it constructs a DonationData
 400+ * object.
 401+ * *) On construction, the DonationData object pulls donation data from an
 402+ * appropriate source, and normalizes the entire data set for storage.
 403+ * *) The gateway adapter pulls normalized, html escaped data out of the
 404+ * DonationData object, as the base of its own data set.
394405 * @param string $val The specific key you're looking for (if any)
395406 * @return mixed An array of all the raw, unstaged (but normalized and
396407 * sanitized) data sent to the adapter, or if $val was set, either the
397408 * specific value held for $val, or null if none exists.
398409 */
399 - public function getData_Raw( $val = '' ) {
 410+ public function getData_Unstaged_Escaped( $val = '' ) {
400411 if ( $val === '' ) {
401 - return $this->raw_data;
 412+ return $this->unstaged_data;
402413 } else {
403 - if ( array_key_exists( $val, $this->raw_data ) ) {
404 - return $this->raw_data[$val];
 414+ if ( array_key_exists( $val, $this->unstaged_data ) ) {
 415+ return $this->unstaged_data[$val];
405416 } else {
406417 return null;
407418 }
@@ -798,9 +809,7 @@
799810 //reset, in case this isn't our first time.
800811 $this->transaction_results = array();
801812 $this->setValidationAction('process', true);
802 -
803 - $this->log( 'ReferrerHeaderTest (' . $this->getData_Raw( 'contribution_tracking_id' ) . "): Value @ do_transaction = " . $this->getData_Raw( 'referrer' ) );
804 -
 813+
805814 try {
806815 $this->setCurrentTransaction( $transaction );
807816
@@ -948,7 +957,7 @@
949958 }
950959
951960 // log that the transaction is essentially complete
952 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . " Transaction complete." );
 961+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . " Transaction complete." );
953962
954963 $this->debugarray[] = 'numAttempt = ' . $this->getData_Staged('numAttempt');
955964
@@ -1031,7 +1040,7 @@
10321041 */
10331042 public function getPaymentMethod() {
10341043
1035 - return $this->getData_Raw('payment_method');
 1044+ return $this->getData_Unstaged_Escaped('payment_method');
10361045 }
10371046
10381047 /**
@@ -1066,7 +1075,7 @@
10671076 */
10681077 public function getPaymentSubmethod() {
10691078
1070 - return $this->getData_Raw('payment_submethod');
 1079+ return $this->getData_Unstaged_Escaped('payment_submethod');
10711080 }
10721081
10731082 /**
@@ -1131,15 +1140,15 @@
11321141 $results = array();
11331142
11341143 while ( $i++ <= 3 ) {
1135 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Preparing to send transaction to ' . self::getGatewayName() );
 1144+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Preparing to send transaction to ' . self::getGatewayName() );
11361145 $results['result'] = curl_exec( $ch );
11371146 $results['headers'] = curl_getinfo( $ch );
11381147
11391148 if ( $results['headers']['http_code'] != 200 && $results['headers']['http_code'] != 403 ) {
1140 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Failed sending transaction to ' . self::getGatewayName() . ', retrying' );
 1149+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Failed sending transaction to ' . self::getGatewayName() . ', retrying' );
11411150 sleep( 1 );
11421151 } elseif ( $results['headers']['http_code'] == 200 || $results['headers']['http_code'] == 403 ) {
1143 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Finished sending transaction to ' . self::getGatewayName() );
 1152+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Finished sending transaction to ' . self::getGatewayName() );
11441153 break;
11451154 }
11461155 }
@@ -1151,7 +1160,7 @@
11521161 //TODO: i18n here!
11531162 //TODO: But also, fire off some kind of "No response from the gateway" thing to somebody so we know right away.
11541163 $results['message'] = 'No response from ' . self::getGatewayName() . '. Please try again later!';
1155 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' No response from ' . self::getGatewayName() . ': ' . curl_error( $ch ) );
 1164+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' No response from ' . self::getGatewayName() . ': ' . curl_error( $ch ) );
11561165 curl_close( $ch );
11571166 return false;
11581167 }
@@ -1315,7 +1324,7 @@
13161325 }
13171326
13181327 $params = array(
1319 - 'contribution_id' => $this->dataObj->getVal( 'contribution_tracking_id' ),
 1328+ 'contribution_id' => $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ),
13201329 'duration' => $this->getStopwatch( $function ),
13211330 'gateway' => self::getGatewayName(),
13221331 'function' => $function,
@@ -1510,7 +1519,7 @@
15111520 'gateway_txn_id' => $this->getTransactionGatewayTxnID(),
15121521 //'language' => '',
15131522 );
1514 - $transaction += $this->getData_Raw();
 1523+ $transaction += $this->getData_Unstaged_Escaped();
15151524
15161525 try {
15171526 wfRunHooks( $hook, array( $transaction ) );
@@ -1532,7 +1541,7 @@
15331542 return;
15341543 }
15351544
1536 - if ($this->getData_Raw( 'payment_method' ) === 'cc'){
 1545+ if ($this->getData_Unstaged_Escaped( 'payment_method' ) === 'cc'){
15371546 global $wgCCLimboStompQueueName;
15381547 if ( !isset( $wgCCLimboStompQueueName ) || $wgCCLimboStompQueueName === false ){
15391548 return;
@@ -1554,7 +1563,7 @@
15551564 'date' => time(),
15561565 'gateway_txn_id' => $this->getTransactionGatewayTxnID(),
15571566 'correlation-id' => $this->getCorrelationID(),
1558 - 'payment_method' => $this->getData_Raw( 'payment_method' ),
 1567+ 'payment_method' => $this->getData_Unstaged_Escaped( 'payment_method' ),
15591568 'antimessage' => 'true'
15601569 );
15611570 } else {
@@ -1563,14 +1572,14 @@
15641573 'date' => time(),
15651574 'gateway_txn_id' => $this->getTransactionGatewayTxnID(),
15661575 'correlation-id' => $this->getCorrelationID(),
1567 - 'payment_method' => $this->getData_Raw( 'payment_method' ),
 1576+ 'payment_method' => $this->getData_Unstaged_Escaped( 'payment_method' ),
15681577 );
15691578
1570 - $raw_data = array();
 1579+ $unstaged_local = array();
15711580 foreach ( $stomp_fields as $field ){
1572 - $raw_data[$field] = $this->getData_Raw( $field );
 1581+ $unstaged_local[$field] = $this->getData_Unstaged_Escaped( $field );
15731582 }
1574 - $transaction = array_merge( $raw_data, $transaction );
 1583+ $transaction = array_merge( $unstaged_local, $transaction );
15751584 }
15761585
15771586 try {
@@ -1581,7 +1590,7 @@
15821591 }
15831592
15841593 protected function getCorrelationID(){
1585 - return $this->getIdentifier() . '-' . $this->getData_Raw('order_id');
 1594+ return $this->getIdentifier() . '-' . $this->getData_Unstaged_Escaped('order_id');
15861595 }
15871596
15881597 function smooshVarsForStaging() {
@@ -1670,7 +1679,7 @@
16711680 }
16721681
16731682 function getPaypalRedirectURL() {
1674 - $currency = $this->getData_Raw( 'currency_code' );
 1683+ $currency = $this->getData_Unstaged_Escaped( 'currency_code' );
16751684
16761685 // update the utm source to set the payment instrument to pp rather than cc
16771686 $data['payment_method'] = 'pp';
@@ -1720,9 +1729,9 @@
17211730 );
17221731 $ret = array();
17231732 foreach ( $paypalkeys as $key ){
1724 - $val = $this->getData_Raw( $key );
 1733+ $val = $this->getData_Unstaged_Escaped( $key );
17251734 if (!is_null( $val )){
1726 - $ret[$key] = $this->getData_Raw( $key );
 1735+ $ret[$key] = $this->getData_Unstaged_Escaped( $key );
17271736 }
17281737 }
17291738 return $ret;
@@ -1874,14 +1883,10 @@
18751884 }
18761885 }
18771886
1878 - public function setFormClass( $formClassName ) {
1879 - //I'm adding this because Captcha needs it, and we're gonna fire the hook inside. Nothing else really needs it as far as I know.
1880 - $this->form_class = $formClassName;
1881 - }
1882 -
18831887 public function getFormClass() {
1884 - if ( isset( $this->form_class ) && class_exists( $this->form_class ) ) {
1885 - return $this->form_class;
 1888+ $form_class = $this->getData_Unstaged_Escaped( 'form_class' );
 1889+ if ( ( $form_class ) && class_exists( $form_class ) ) {
 1890+ return $form_class;
18861891 } else {
18871892 return false;
18881893 }
@@ -1891,7 +1896,8 @@
18921897 return get_called_class();
18931898 }
18941899
1895 - public function setValidationErrors( $errors ) {
 1900+ //only the gateway should be setting validation errors. Everybody else should set manual errors.
 1901+ protected function setValidationErrors( $errors ) {
18961902 $this->validation_errors = $errors;
18971903 }
18981904
@@ -1903,6 +1909,35 @@
19041910 }
19051911 }
19061912
 1913+ public function addManualError( $errors, $reset = false ) {
 1914+ if ( $reset ){
 1915+ $this->manual_errors = array();
 1916+ return;
 1917+ }
 1918+ $this->manual_errors = array_merge( $this->manual_errors, $errors );
 1919+ }
 1920+
 1921+ public function getManualErrors() {
 1922+ if ( !empty( $this->manual_errors ) ) {
 1923+ return $this->manual_errors;
 1924+ } else {
 1925+ return false;
 1926+ }
 1927+ }
 1928+
 1929+ public function getAllErrors(){
 1930+ $validation = $this->getValidationErrors();
 1931+ $manual = $this->getManualErrors();
 1932+ $return = array();
 1933+ if ( is_array( $validation ) ){
 1934+ $return = array_merge( $return, $validation );
 1935+ }
 1936+ if ( is_array( $manual ) ){
 1937+ $return = array_merge( $return, $manual );
 1938+ }
 1939+ return $return;
 1940+ }
 1941+
19071942 public function incrementNumAttempt() {
19081943 $this->dataObj->incrementNumAttempt();
19091944 $this->refreshGatewayValueFromSource( 'numAttempt' );
@@ -1932,9 +1967,9 @@
19331968 */
19341969 function runPreProcessHooks() {
19351970 // allow any external validators to have their way with the data
1936 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . " Preparing to query MaxMind" );
 1971+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . " Preparing to query MaxMind" );
19371972 wfRunHooks( 'GatewayValidate', array( &$this ) );
1938 - self::log( $this->getData_Raw( 'contribution_tracking_id' ) . ' Finished querying Maxmind' );
 1973+ self::log( $this->getData_Unstaged_Escaped( 'contribution_tracking_id' ) . ' Finished querying Maxmind' );
19391974
19401975 //DO NOT set some variable as getValidationAction() here, and keep
19411976 //checking that. getValidationAction could change with each one of these
@@ -2004,7 +2039,7 @@
20052040 /**
20062041 * Instead of pulling all the DonationData back through to update one local
20072042 * value, use this. It updates both staged_data (which is intended to be
2008 - * staged and used _just_ by the gateway) and raw_data, which is actually
 2043+ * staged and used _just_ by the gateway) and unstaged_data, which is actually
20092044 * just normalized and sanitized form data as entered by the user.
20102045 *
20112046 * TODO: handle the cases where $val is listed in the gateway adapter's
@@ -2016,13 +2051,13 @@
20172052 * our DonationData object.
20182053 */
20192054 function refreshGatewayValueFromSource( $val ) {
2020 - $refreshed = $this->dataObj->getVal( $val );
 2055+ $refreshed = $this->dataObj->getVal_Escaped( $val );
20212056 if ( !is_null($refreshed) ){
20222057 $this->staged_data[$val] = $refreshed;
2023 - $this->raw_data[$val] = $refreshed;
 2058+ $this->unstaged_data[$val] = $refreshed;
20242059 } else {
20252060 unset( $this->staged_data[$val] );
2026 - unset( $this->raw_data[$val] );
 2061+ unset( $this->unstaged_data[$val] );
20272062 }
20282063 }
20292064
@@ -2100,5 +2135,23 @@
21012136 return $this->batch;
21022137 }
21032138 }
 2139+
 2140+ public function getOriginalValidationErrors( ){
 2141+ return $this->dataObj->getValidationErrors();
 2142+ }
 2143+
 2144+ //TODO: Maybe validate on $unstaged_data directly?
 2145+ public function revalidate( $check_not_empty = array() ){
 2146+ $validation_errors = $this->dataObj->getValidationErrors( true, $check_not_empty );
 2147+ $this->setValidationErrors( $validation_errors );
 2148+ return $this->validatedOK();
 2149+ }
21042150
2105 -}
 2151+ public function validatedOK(){
 2152+ if ( $this->getValidationErrors() === false ){
 2153+ return true;
 2154+ }
 2155+ return false;
 2156+ }
 2157+
 2158+}
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/gateway.adapter.php
___________________________________________________________________
Modified: svn:mergeinfo
21062159 Merged /trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php:r105938,106109,106158,107609,107981
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php
@@ -44,7 +44,7 @@
4545 $this->dieUsage( "Invalid gateway <<<$gateway>>> passed to Donation API.", 'unknown_gateway' );
4646 }
4747
48 - //$normalizedData = $gatewayObj->getData_Raw();
 48+ //$normalizedData = $gatewayObj->getData_Unstaged_Escaped();
4949 $outputResult = array();
5050 $outputResult['message'] = $result['message'];
5151 $outputResult['status'] = $result['status'];
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/donation.api.php
___________________________________________________________________
Modified: svn:mergeinfo
5252 Merged /trunk/extensions/DonationInterface/gateway_common/donation.api.php:r105938
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php
@@ -1,24 +1,57 @@
22 <?php
33
44 /**
5 - * Description of DonationData
6 - *
 5+ * DonationData
 6+ * This class is responsible for pulling all the data used by DonationInterface
 7+ * from various sources. Once pulled, DonationData will then normalize and
 8+ * sanitize the data for use by the various gateway adapters which connect to
 9+ * the payment gateways, and through those gateway adapters, the forms that
 10+ * provide the user interface.
 11+ *
 12+ * DonationData was not written to be instantiated by anything other than a
 13+ * gateway adapter (or class descended from GatewayAdapter).
 14+ *
715 * @author khorn
816 */
917 class DonationData {
1018
1119 protected $normalized = array( );
1220 public $boss;
 21+ protected $validationErrors = null;
1322
 23+ /**
 24+ * DonationData constructor
 25+ * @param string $owning_class The name of the class that instantiated this
 26+ * instance of DonationData. This is used to grab gateway-specific functions
 27+ * and values, such as the logging function and gateway-specific global
 28+ * variables.
 29+ * @param boolean $test Indicates if DonationData has been instantiated in
 30+ * testing mode. Default is false.
 31+ * @param mixed $data An optional array of donation data that will, if
 32+ * present, circumvent the usual process of gathering the data from various
 33+ * places in $wgRequest, or 'false' to gather the data the usual way.
 34+ * Default is false.
 35+ */
1436 function __construct( $owning_class, $test = false, $data = false ) {
15 - //TODO: Actually think about this bit.
16 - // ...and keep in mind we can re-populate if it's a test or whatever. (But that may not be a good idea either)
1737 $this->boss = $owning_class;
1838 $this->gatewayID = $this->getGatewayIdentifier();
1939 $this->populateData( $test, $data );
2040 }
2141
22 - function populateData( $test = false, $external_data = false ) {
 42+ /**
 43+ * populateData, called on construct, pulls donation data from various
 44+ * sources. Once the data has been pulled, it will handle any session data
 45+ * if present, normalize the data regardless of the source, and handle the
 46+ * caching variables.
 47+ * @global Webrequest $wgRequest
 48+ * @param boolean $test Indicates if DonationData has been instantiated in
 49+ * testing mode. Default is false.
 50+ * @param mixed $external_data An optional array of donation data that will,
 51+ * if present, circumvent the usual process of gathering the data from
 52+ * various places in $wgRequest, or 'false' to gather the data the usual way.
 53+ * Default is false.
 54+ */
 55+ protected function populateData( $test = false, $external_data = false ) {
2356 global $wgRequest;
2457 $this->normalized = array( );
2558 if ( is_array( $external_data ) ){
@@ -101,6 +134,8 @@
102135 'direct_debit_text' => $wgRequest->getText( 'direct_debit_text', null ),
103136 'iban' => $wgRequest->getText( 'iban', null ),
104137 'transaction_type' => $wgRequest->getText( 'transaction_type', null ),
 138+ 'form_name' => $wgRequest->getText( 'form_name', null ),
 139+ 'ffname' => $wgRequest->getText( 'ffname', null ),
105140 'recurring' => $wgRequest->getVal( 'recurring', null ), //boolean type
106141 );
107142 if ( !$this->wasPosted() ) {
@@ -108,25 +143,12 @@
109144 }
110145 }
111146
112 - $posted_referrer = $wgRequest->getVal( 'referrer' );
113 - $tries = array(
114 - 'referer',
115 - 'referrer',
116 - 'Referer',
117 - 'Referrer'
118 - );
119 - foreach ($tries as $trythis){
120 - $header[$trythis] = $wgRequest->getHeader( $trythis );
121 - }
122 -
123 - $this->log( 'ReferrerHeaderTest (' . $this->getVal( 'contribution_tracking_id' ) . "): Posted = $posted_referrer, Header Tries = " . print_r($header, true) . ', Final = ' . $this->getVal('referrer') );
124 -
125147 //if we have saved any donation data to the session, pull them in as well.
126148 $this->integrateDataFromSession();
127149
128150 $this->doCacheStuff();
129151
130 - $this->normalizeAndSanitize();
 152+ $this->normalize();
131153
132154 }
133155
@@ -135,7 +157,7 @@
136158 * If donor session data has been set, pull the fields in the session that
137159 * are populated, and merge that with the data set we already have.
138160 */
139 - function integrateDataFromSession(){
 161+ protected function integrateDataFromSession(){
140162 if ( self::sessionExists() && array_key_exists( 'Donor', $_SESSION ) ) {
141163 //if the thing coming in from the session isn't already something,
142164 //replace it.
@@ -154,14 +176,39 @@
155177 }
156178 }
157179 }
158 - $this->log( 'ReferrerHeaderTest (' . $this->getVal( 'contribution_tracking_id' ) . "): Final After Session Integration = " . $this->getVal('referrer') );
159180 }
160181
161 - function getData() {
 182+ /**
 183+ * Returns an array of normalized and escaped donation data
 184+ * @return array
 185+ */
 186+ public function getDataEscaped() {
 187+ $escaped = $this->normalized;
 188+ array_walk( $escaped, array( $this, 'sanitizeInput' ) );
 189+ return $escaped;
 190+ }
 191+
 192+ /**
 193+ * Returns an array of normalized (but unescaped) donation data
 194+ * @return array
 195+ */
 196+ public function getDataUnescaped() {
162197 return $this->normalized;
163198 }
164199
165 - function populateData_Test( $testdata = false ) {
 200+ /**
 201+ * populateData helper function.
 202+ * If there is no external data provided upon DonationData construct, and
 203+ * the object was instantiated in test mode, populateData_Test in intended
 204+ * to provide a baseline minimum of data with which to run tests without
 205+ * exploding.
 206+ * Populates $this->normalized.
 207+ * TODO: Implement an override for the test data, in the event that a
 208+ * partial data array is provided when DonationData is instantiated.
 209+ * @param array $testdata Intended to implement an override for any values
 210+ * that may be provided on instantiation.
 211+ */
 212+ protected function populateData_Test( $testdata = false ) {
166213 // define arrays of cc's and cc #s for random selection
167214 $cards = array( 'american' );
168215 $card_nums = array(
@@ -231,11 +278,13 @@
232279 }
233280
234281 /**
235 - * Tells you if a value is something or not.
236 - * @param string $key The field you would like to determine if it exists or not.
237 - * @return boolean true if the field is something. False if it is null, or an empty string.
 282+ * Tells you if a value in $this->normalized is something or not.
 283+ * @param string $key The field you would like to determine if it exists in
 284+ * a usable way or not.
 285+ * @return boolean true if the field is something. False if it is null, or
 286+ * an empty string.
238287 */
239 - function isSomething( $key ) {
 288+ public function isSomething( $key ) {
240289 if ( array_key_exists( $key, $this->normalized ) ) {
241290 if ( is_null($this->normalized[$key]) || $this->normalized[$key] === '' ) {
242291 return false;
@@ -246,8 +295,31 @@
247296 }
248297 }
249298
250 - function getVal( $key ) {
 299+ /**
 300+ * getVal_Escaped
 301+ * @param string $key The data field you would like to retrieve. Pulls the
 302+ * data from $this->normalized if it is found to be something.
 303+ * @return mixed The normalized and escaped value of that $key.
 304+ */
 305+ public function getVal_Escaped( $key ) {
251306 if ( $this->isSomething( $key ) ) {
 307+ //TODO: If we ever start sanitizing in a more complicated way, we should move this
 308+ //off to a function and have both getVal_Escaped and sanitizeInput call that.
 309+ return htmlspecialchars( $this->normalized[$key], ENT_COMPAT, 'UTF-8', false );
 310+ } else {
 311+ return null;
 312+ }
 313+ }
 314+
 315+ /**
 316+ * getVal
 317+ * For Internal Use Only! External objects should use getVal_Escaped.
 318+ * @param string $key The data field you would like to retrieve directly
 319+ * from $this->normalized.
 320+ * @return mixed The normalized value of that $key.
 321+ */
 322+ protected function getVal( $key ) {
 323+ if ( $this->isSomething( $key ) ) {
252324 return $this->normalized[$key];
253325 } else {
254326 return null;
@@ -256,14 +328,23 @@
257329
258330 /**
259331 * Sets a key in the normalized data array, to a new value.
 332+ * This function should only ever be used for keys that are not listed in
 333+ * DonationData::getCalculatedFields().
 334+ * TODO: If the $key is listed in DonationData::getCalculatedFields(), use
 335+ * DonationData::addData() instead. Or be a jerk about it and throw an
 336+ * exception. (Personally I like the second one)
260337 * @param string $key The key you want to set.
261338 * @param string $val The value you'd like to assign to the key.
262339 */
263 - function setVal( $key, $val ) {
 340+ public function setVal( $key, $val ) {
264341 $this->normalized[$key] = $val;
265342 }
266343
267 - function expunge( $key ) {
 344+ /**
 345+ * Removes a value from $this->normalized.
 346+ * @param type $key
 347+ */
 348+ public function expunge( $key ) {
268349 if ( array_key_exists( $key, $this->normalized ) ) {
269350 unset( $this->normalized[$key] );
270351 }
@@ -271,12 +352,13 @@
272353
273354 /**
274355 * Returns an array of all the fields that get re-calculated during a
275 - * normalizeAndSanitize.
276 - * This will most likely be used on the outside when in the process of
277 - * adding data.
 356+ * normalize.
 357+ * This can be used on the outside when in the process of changing data,
 358+ * particularly if any of the recalculted fields need to be restaged by the
 359+ * gateway adapter.
278360 * @return array An array of values matching all recauculated fields.
279361 */
280 - function getCalculatedFields() {
 362+ public function getCalculatedFields() {
281363 $fields = array(
282364 'utm_source',
283365 'amount',
@@ -294,10 +376,14 @@
295377 }
296378
297379 /**
298 - * Normalizes and Sanitizes the current set of data, just after it's been
299 - * pulled (or re-pulled) from a source.
 380+ * Normalizes the current set of data, just after it's been
 381+ * pulled (or re-pulled) from a data source.
 382+ * Care should be taken in the normalize helper functions to write code in
 383+ * such a way that running them multiple times on the same array won't cause
 384+ * the data to stroll off into the sunset: Normalize will definitely need to
 385+ * be called multiple times against the same array.
300386 */
301 - function normalizeAndSanitize() {
 387+ protected function normalize() {
302388 if ( !empty( $this->normalized ) ) {
303389 $this->setUtmSource();
304390 $this->setNormalizedAmount();
@@ -308,15 +394,60 @@
309395 $this->setCountry();
310396 $this->handleContributionTrackingID();
311397 $this->setCurrencyCode();
312 - array_walk( $this->normalized, array( $this, 'sanitizeInput' ) );
 398+ $this->setFormClass();
 399+
 400+ $this->getValidationErrors();
313401 }
314402 }
315403
316404 /**
317 - * normalizeAndSanitize helper function
 405+ * normalize helper function
 406+ * Sets the form class we will be using.
 407+ * In the case that we are using forms, form_name will be harvested from
 408+ * $wgRequest by populateData. If we are coming from somewhere that does not
 409+ * use a form interface (like an api call), this logic should be skipped.
 410+ *
 411+ * For any specified form, if it is enabled and available, the class would
 412+ * have been autoloaded at this point. If it is not enabled and available,
 413+ * we will check the default for the calling gateway, and failing that,
 414+ * throw an exception.
 415+ *
 416+ */
 417+ protected function setFormClass(){
 418+ //don't actually try to load the forms here... but do determine if what we've got in there will load or not.
 419+ //Elsewise, set it to the default.
 420+ $default = false;
 421+
 422+ if ( $this->isSomething( 'form_name' ) ){
 423+ $class_name = "Gateway_Form_" . $this->getVal( 'form_name' );
 424+ } else {
 425+ $default = true;
 426+ $class_name = "Gateway_Form_" . $this->getGatewayGlobal( 'DefaultForm' );
 427+ }
 428+
 429+ if ( !class_exists( $class_name ) ) {
 430+ if (!$default){ //try that, then.
 431+ $class_name_orig = $class_name;
 432+ $class_name = "Gateway_Form_" . $this->getGatewayGlobal( 'DefaultForm' );
 433+ }
 434+
 435+ if ( class_exists( $class_name ) ) {
 436+ $this->setVal( 'form_name', $this->getGatewayGlobal( 'DefaultForm' ) );
 437+ } else {
 438+ throw new MWException( 'Could not find form ' . $class_name_orig . ', nor default form ' . $class_name );
 439+ }
 440+ }
 441+
 442+ $this->setVal( 'form_class', $class_name );
 443+ }
 444+
 445+ /**
 446+ * normalize helper function
318447 * Setting the country correctly.
 448+ * If we have no country, we try to get something rational through GeoIP
 449+ * lookup.
319450 */
320 - function setCountry() {
 451+ protected function setCountry() {
321452 global $wgRequest;
322453 if ( !$this->isSomething('country') ){
323454 // If no country was passed, try to do GeoIP lookup
@@ -332,10 +463,12 @@
333464 }
334465
335466 /**
336 - * normalizeAndSanitize helper function
 467+ * normalize helper function
337468 * Setting the currency code correctly.
 469+ * Historically, this value could come in through 'currency' or
 470+ * 'currency_code'. After this fires, we will only have 'currency_code'.
338471 */
339 - function setCurrencyCode() {
 472+ protected function setCurrencyCode() {
340473 global $wgRequest;
341474
342475 //at this point, we can have either currency, or currency_code.
@@ -359,14 +492,14 @@
360493 }
361494
362495 /**
363 - * normalizeAndSanitize helper function.
 496+ * normalize helper function.
364497 * Assures that if no contribution_tracking_id is present, a row is created
365498 * in the Contribution tracking table, and that row is assigned to the
366499 * current contribution we're tracking.
367500 * If a contribution tracking id is already present, no new rows will be
368501 * assigned.
369502 */
370 - function handleContributionTrackingID(){
 503+ protected function handleContributionTrackingID(){
371504 if ( !$this->isSomething( 'contribution_tracking_id' ) &&
372505 ( !$this->isCaching() ) ){
373506 $this->saveContributionTracking();
@@ -379,7 +512,7 @@
380513 * calculate it from the data fields more than once.
381514 * @return boolean true if we are going to be caching, false if we aren't.
382515 */
383 - function isCaching(){
 516+ public function isCaching(){
384517
385518 static $cache = null;
386519
@@ -404,11 +537,11 @@
405538 }
406539
407540 /**
408 - * normalizeAndSanitize helper function.
 541+ * normalize helper function.
409542 * Takes all possible sources for the intended donation amount, and
410543 * normalizes them into the 'amount' field.
411544 */
412 - function setNormalizedAmount() {
 545+ protected function setNormalizedAmount() {
413546 if ( !($this->isSomething( 'amount' )) || !(preg_match( '/^\d+(\.(\d+)?)?$/', $this->getVal( 'amount' ) ) ) ) {
414547 if ( $this->isSomething( 'amountGiven' ) && preg_match( '/^\d+(\.(\d+)?)?$/', $this->getVal( 'amountGiven' ) ) ) {
415548 $this->setVal( 'amount', number_format( $this->getVal( 'amountGiven' ), 2, '.', '' ) );
@@ -421,12 +554,12 @@
422555 }
423556
424557 /**
425 - * normalizeAndSanitize helper function.
 558+ * normalize helper function.
426559 * Ensures that order_id and i_order_id are ready to go, depending on what
427560 * comes in populated or not, and where it came from.
428561 * @return null
429562 */
430 - function setNormalizedOrderIDs() {
 563+ protected function setNormalizedOrderIDs() {
431564 //basically, we need a new order_id every time we come through here, but if there's an internal already there,
432565 //we want to use that one internally. So.
433566 //Exception: If we pass in an order ID in the querystring: Don't mess with it.
@@ -446,7 +579,7 @@
447580 /**
448581 * Generate an order id exactly once for this go-round.
449582 */
450 - static function generateOrderId() {
 583+ protected static function generateOrderId() {
451584 static $order_id = null;
452585 if ( $order_id === null ) {
453586 $order_id = ( double ) microtime() * 1000000 . mt_rand( 1000, 9999 );
@@ -464,18 +597,32 @@
465598 * @param $flags The flag constant for htmlspecialchars
466599 * @param $double_encode Whether or not to double-encode strings
467600 */
468 - public function sanitizeInput( &$value, $key, $flags=ENT_COMPAT, $double_encode=false ) {
 601+ protected function sanitizeInput( &$value, $key, $flags=ENT_COMPAT, $double_encode=false ) {
469602 $value = htmlspecialchars( $value, $flags, 'UTF-8', $double_encode );
470603 }
471604
472 - function log( $message, $log_level=LOG_INFO ) {
 605+ /**
 606+ * log: This grabs the adapter class that instantiated DonationData, and
 607+ * uses its log function.
 608+ * @param string $message The message to log.
 609+ * @param type $log_level
 610+ */
 611+ protected function log( $message, $log_level=LOG_INFO ) {
473612 $c = $this->getAdapterClass();
474613 if ( $c && is_callable( array( $c, 'log' ) )){
475614 $c::log( $message, $log_level );
476615 }
477616 }
478617
479 - function getGatewayIdentifier() {
 618+ /**
 619+ * getGatewayIdentifier
 620+ * This grabs the adapter class that instantiated DonationData, and returns
 621+ * the result of its 'getIdentifier' function. Used for normalizing the
 622+ * 'gateway' value, and stashing and retrieving the edit token (and other
 623+ * things, where needed) in the session.
 624+ * @return type
 625+ */
 626+ protected function getGatewayIdentifier() {
480627 $c = $this->getAdapterClass();
481628 if ( $c && is_callable( array( $c, 'getIdentifier' ) ) ){
482629 return $c::getIdentifier();
@@ -484,7 +631,17 @@
485632 }
486633 }
487634
488 - function getGatewayGlobal( $varname ) {
 635+ /**
 636+ * getGatewayGlobal
 637+ * This grabs the adapter class that instantiated DonationData, and returns
 638+ * the result of its 'getGlobal' function for the $varname passed in. Used
 639+ * to determine gateway-specific configuration settings.
 640+ * @param string $varname the global variable (minus prefix) that we want to
 641+ * check.
 642+ * @return mixed The value of the gateway global if it exists. Else, the
 643+ * value of the Donation Interface global if it exists. Else, null.
 644+ */
 645+ protected function getGatewayGlobal( $varname ) {
489646 $c = $this->getAdapterClass();
490647 if ( $c && is_callable( array( $c, 'getGlobal' ) ) ){
491648 return $c::getGlobal( $varname );
@@ -494,24 +651,24 @@
495652 }
496653
497654 /**
498 - * normalizeAndSanitize helper function.
 655+ * normalize helper function.
499656 * Sets the gateway to be the gateway that called this class in the first
500657 * place.
501658 */
502 - function setGateway() {
 659+ protected function setGateway() {
503660 //TODO: Hum. If we have some other gateway in the form data, should we go crazy here? (Probably)
504661 $gateway = $this->gatewayID;
505662 $this->setVal( 'gateway', $gateway );
506663 }
507664
508665 /**
509 - * normalizeAndSanitize helper function.
 666+ * normalize helper function.
510667 * If the language has not yet been set or is not valid, pulls the language code
511668 * from the current global language object.
512669 * Also sets the premium_language as the calculated language if it's not
513670 * already set coming in (had been defaulting to english).
514671 */
515 - function setLanguage() {
 672+ protected function setLanguage() {
516673 global $wgLang;
517674 $language = false;
518675
@@ -546,7 +703,7 @@
547704 * @global bool $wgUseSquid
548705 * @global type $wgOut
549706 */
550 - function doCacheStuff() {
 707+ protected function doCacheStuff() {
551708 //TODO: Wow, name.
552709 // if _cache_ is requested by the user, do not set a session/token; dynamic data will be loaded via ajax
553710 if ( $this->isCaching() ) {
@@ -564,8 +721,18 @@
565722 }
566723 }
567724
568 - function getAnnoyingOrderIDLogLinePrefix() {
569 - //TODO: ...aww. But it's so descriptive.
 725+ /**
 726+ * getAnnoyingOrderIDLogLinePrefix
 727+ * Constructs and returns the annoying order ID log line prefix.
 728+ * This has moved from being annoyingly all over the place in the edit token
 729+ * logging code before it was functionalized, to being annoying to look at
 730+ * in the logs because the two numbers in the prefix are frequently
 731+ * identical (and large).
 732+ * TODO: Determine if anything actually looks at both of those numbers, in
 733+ * order to make this less annoying. Rename on success.
 734+ * @return string Annoying Order ID Log Line Prefix in all its dubious glory.
 735+ */
 736+ protected function getAnnoyingOrderIDLogLinePrefix() {
570737 return $this->getVal( 'order_id' ) . ' ' . $this->getVal( 'i_order_id' ) . ': ';
571738 }
572739
@@ -578,6 +745,8 @@
579746 * a security risk for non-authenticated users. Until this is
580747 * resolved in $wgUser, we'll use our own methods for token
581748 * handling.
 749+ *
 750+ * Public so the api can get to it.
582751 *
583752 * @return string
584753 */
@@ -600,10 +769,12 @@
601770 }
602771
603772 /**
 773+ * token_refreshAllTokenEverything
604774 * In the case where we have an expired session (token mismatch), we go
605 - * ahead and fix it for 'em for their next post.
 775+ * ahead and fix it for 'em for their next post. We do this by refreshing
 776+ * everything that has to do with the edit token.
606777 */
607 - function token_refreshAllTokenEverything(){
 778+ protected function token_refreshAllTokenEverything(){
608779 $unsalted = self::token_generateToken();
609780 $gateway_ident = $this->gatewayID;
610781 self::ensureSession();
@@ -612,7 +783,14 @@
613784 $this->setVal( 'token', $salted );
614785 }
615786
616 - function token_applyMD5AndSalt( $clear_token ){
 787+ /**
 788+ * token_applyMD5AndSalt
 789+ * Takes a clear-text token, and returns the MD5'd result of the token plus
 790+ * the configured gateway salt.
 791+ * @param string $clear_token The original, unsalted, unencoded edit token.
 792+ * @return string The salted and MD5'd token.
 793+ */
 794+ protected function token_applyMD5AndSalt( $clear_token ){
617795 $salt = $this->getGatewayGlobal( 'Salt' );
618796
619797 if ( is_array( $salt ) ) {
@@ -625,9 +803,10 @@
626804
627805
628806 /**
629 - * Generate a token string
630 - *
631 - * @var mixed $padding
 807+ * token_generateToken
 808+ * Generate a random string to be used as an edit token.
 809+ * @var string $padding A string with which we could pad out the random hex
 810+ * further.
632811 * @return string
633812 */
634813 public static function token_generateToken( $padding = '' ) {
@@ -636,12 +815,16 @@
637816 }
638817
639818 /**
640 - * Determine the validity of a token
 819+ * token_matchEditToken
 820+ * Determine the validity of a token by checking it against the salted
 821+ * version of the clear-text token we have already stored in the session.
 822+ * On failure, it resets the edit token both in the session and in the form,
 823+ * so they will match on the user's next load.
641824 *
642825 * @var string $val
643826 * @return bool
644827 */
645 - function token_matchEditToken( $val ) {
 828+ protected function token_matchEditToken( $val ) {
646829 // fetch a salted version of the session token
647830 $sessionSaltedToken = $this->token_getSaltedSessionToken();
648831 if ( $val != $sessionSaltedToken ) {
@@ -653,12 +836,16 @@
654837 }
655838
656839 /**
 840+ * ensureSession
657841 * Ensure that we have a session set for the current user.
658 - *
659842 * If we do not have a session set for the current user,
660843 * start the session.
 844+ * BE CAREFUL with this one, as creating sessions willy-nilly will break
 845+ * squid caching for reasons that are not immediately obvious.
 846+ * (See DonationData::doCacheStuff, and basically everything about setting
 847+ * headers in $wgOut)
661848 */
662 - public static function ensureSession() {
 849+ protected static function ensureSession() {
663850 // if the session is already started, do nothing
664851 if ( self::sessionExists() )
665852 return;
@@ -668,25 +855,40 @@
669856 }
670857
671858 /**
 859+ * sessionExists
672860 * Checks to see if the session exists without actually creating one.
673861 * @return bool true if we have a session, otherwise false.
674862 */
675 - public static function sessionExists() {
 863+ protected static function sessionExists() {
676864 if ( session_id() )
677865 return true;
678866 return false;
679867 }
680868
 869+ /**
 870+ * token_checkTokens
 871+ * The main function to check the salted and MD5'd token we should have
 872+ * saved and gathered from $wgRequest, against the clear-text token we
 873+ * should have saved to the user's session.
 874+ * token_getSaltedSessionToken() will start off the process if this is a
 875+ * first load, and there's no saved token in the session yet.
 876+ * @global Webrequest $wgRequest
 877+ * @staticvar string $match
 878+ * @return type
 879+ */
681880 public function token_checkTokens() {
682881 global $wgRequest;
683 - static $match = null;
 882+ static $match = null; //because we only want to do this once per load.
684883
685884 if ( $match === null ) {
686885 if ( $this->isCaching() ){
687886 //This makes sense.
688887 //If all three conditions for caching are currently true, the
689888 //last thing we want to do is screw it up by setting a session
690 - //token before the page loads.
 889+ //token before the page loads, because sessions break caching.
 890+ //The API will set the session and form token values immediately
 891+ //after that first page load, which is all we care about saving
 892+ //in the cache anyway.
691893 return true;
692894 }
693895
@@ -712,7 +914,7 @@
713915 }
714916
715917 /**
716 - * normalizeAndSanitize helper function.
 918+ * normalize helper function.
717919 *
718920 * Checks to see if the utm_source is set properly for the credit card
719921 * form including any cc form variants (identified by utm_source_id). If
@@ -766,10 +968,14 @@
767969 * because the form elements for comment anonymization and email opt-out
768970 * are backwards (they are really opt-in) relative to contribution_tracking
769971 * (which is opt-out), we need to reverse the values.
 972+ * Difficulty here is compounded by the fact that these values come from
 973+ * checkboxes on forms, which simply don't make it to $wgRequest if they are
 974+ * not checked... or not present in the form at all. In other words, this
 975+ * situation is painful and you probably want to leave it alone.
770976 * NOTE: If you prune here, and there is a paypal redirect, you will have
771977 * problems with the email-opt/optout and comment-option/anonymous.
772978 */
773 - function setNormalizedOptOuts( $prune = false ) {
 979+ protected function setNormalizedOptOuts( $prune = false ) {
774980 $optout['optout'] = ( $this->isSomething( 'email-opt' ) && $this->getVal( 'email-opt' ) == "1" ) ? '0' : '1';
775981 $optout['anonymous'] = ( $this->isSomething( 'comment-option' ) && $this->getVal( 'comment-option' ) == "1" ) ? '0' : '1';
776982 foreach ( $optout as $thing => $stuff ) {
@@ -896,6 +1102,15 @@
8971103 }
8981104 }
8991105
 1106+ /**
 1107+ * addDonorDataToSession
 1108+ * Adds all the fields that are required to make a well-formed stomp
 1109+ * message, to the user's session for later use. This mechanism is used by gateways that
 1110+ * have a user being directed somewhere out of our control, and then coming
 1111+ * back to complete a transaction. (Globalcollect Hosted Credit Card, for
 1112+ * example)
 1113+ *
 1114+ */
9001115 public function addDonorDataToSession() {
9011116 self::ensureSession();
9021117 $donordata = $this->getStompMessageFields();
@@ -962,6 +1177,15 @@
9631178 session_destroy(); //killed on the server.
9641179 }
9651180
 1181+ /**
 1182+ * addData
 1183+ * Adds an array of data to the normalized array, and then re-normalizes it.
 1184+ * NOTE: If any gateway is using this function, it should then immediately
 1185+ * repopulate its own data set with the DonationData source, and then
 1186+ * re-stage values as necessary.
 1187+ * @param array $newdata An array of data to integrate with the existing
 1188+ * data held by the DonationData object.
 1189+ */
9661190 public function addData( $newdata ) {
9671191 if ( is_array( $newdata ) && !empty( $newdata ) ) {
9681192 foreach ( $newdata as $key => $val ) {
@@ -970,9 +1194,14 @@
9711195 }
9721196 }
9731197 }
974 - $this->normalizeAndSanitize();
 1198+ $this->normalize();
9751199 }
9761200
 1201+ /**
 1202+ * incrementNumAttempt
 1203+ * Adds one to the 'numAttempt' field we use to keep track of how many times
 1204+ * a donor has tried to do something.
 1205+ */
9771206 public function incrementNumAttempt() {
9781207 if ( $this->isSomething( 'numAttempt' ) ) {
9791208 $attempts = $this->getVal( 'numAttempt' );
@@ -985,7 +1214,11 @@
9861215 }
9871216 }
9881217
989 - function getAdapterClass(){
 1218+ /**
 1219+ * Gets the name of the adapter class that instantiated DonationData.
 1220+ * @return mixed The name of the class if it exists, or false.
 1221+ */
 1222+ protected function getAdapterClass(){
9901223 if ( class_exists( $this->boss ) ) {
9911224 return $this->boss;
9921225 } else {
@@ -1001,7 +1234,7 @@
10021235 * /extensions/DonationData/activemq_stomp/activemq_stomp.php
10031236 * to somewhere in DonationData. *
10041237 */
1005 - function getStompMessageFields(){
 1238+ public function getStompMessageFields(){
10061239 $stomp_fields = array(
10071240 'contribution_tracking_id',
10081241 'optout',
@@ -1059,6 +1292,37 @@
10601293 }
10611294 return $posted;
10621295 }
 1296+
 1297+ /**
 1298+ * getValidationErrors
 1299+ * This function will go through all the data we have pulled from wherever
 1300+ * we've pulled it, and make sure it's safe and expected and everything.
 1301+ * If it is not, it will return an array of errors ready for any
 1302+ * DonationInterface form class derivitive to display.
 1303+ */
 1304+ public function getValidationErrors( $recalculate = false, $check_not_empty = array() ){
 1305+ if ( is_null( $this->validationErrors ) || $recalculate ) {
 1306+ $this->validationErrors = DataValidator::validate( $this->normalized, $check_not_empty );
 1307+ }
 1308+ return $this->validationErrors;
 1309+ }
 1310+
 1311+ /**
 1312+ * validatedOK
 1313+ * Checks to see if the data validated ok (no errors).
 1314+ * @return boolean True if no errors, false if errors exist.
 1315+ */
 1316+ public function validatedOK() {
 1317+ if ( is_null( $this->validationErrors ) ){
 1318+ $this->getValidationErrors();
 1319+ }
 1320+
 1321+ if ( count( $this->validationErrors ) === 0 ){
 1322+ return true;
 1323+ }
 1324+ return false;
 1325+ }
 1326+
10631327 }
10641328
10651329 ?>
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/DonationData.php
___________________________________________________________________
Modified: svn:mergeinfo
10661330 Merged /trunk/extensions/DonationInterface/gateway_common/DonationData.php:r105938,105941,105953,106109,106158,106259,106493,106495,106836,107609
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php
@@ -18,354 +18,132 @@
1919
2020 /**
2121 * GatewayForm
 22+ * This class is the generic unlisted special page in charge of actually
 23+ * displaying the form. Each gateway will have one or more direct descendants of
 24+ * this class, with most of the gateway-specific control logic in its execute
 25+ * function. For instance: extensions/DonationInterface/globalcollect_gateway/globalcollect_gateway.body.php
2226 *
2327 */
2428 class GatewayForm extends UnlistedSpecialPage {
2529
2630 /**
27 - * A container for the form class
28 - *
29 - * Used to loard the form object to display the CC form
30 - * @var object
31 - */
32 - public $form_class;
33 -
34 - /**
3531 * An array of form errors
3632 * @var array $errors
3733 */
3834 public $errors = array( );
3935
4036 /**
41 - * The adapter object
 37+ * The gateway adapter object
4238 * @var object $adapter
4339 */
4440 public $adapter;
4541
4642 /**
47 - * The form is assumed to be successful. Errors in the form must set this to
48 - * false.
49 - *
50 - * @var boolean
51 - */
52 - public $validateFormResult = true;
53 -
54 - /**
5543 * Constructor
5644 */
5745 public function __construct() {
5846 $me = get_called_class();
5947 parent::__construct( $me );
60 - $this->errors = $this->getPossibleErrors();
61 - $this->setFormClass();
6248 }
6349
6450 /**
65 - * Checks posted form data for errors and returns array of messages
66 - *
67 - * @param array $data Reference to the data of the form
68 - * @param array $error Reference to the error messages of the form
 51+ * Checks current dataset for validation errors
 52+ * TODO: As with every other bit of gateway-related logic that should
 53+ * definitely be available to every entry point, and functionally has very
 54+ * little to do with being contained within what in an ideal world would be
 55+ * a piece of mostly UI, this function needs to be moved inside the gateway
 56+ * adapter class.
6957 * @param array $options
70 - * OPTIONAL - You may require certain field groups to be validated
71 - * - address - Validates: street, city, state, zip
72 - * - amount - Validates: amount
73 - * - creditCard - Validates: card_num, cvv, expiration and sets the card
74 - * - email - Validates: email
75 - * - name - Validates: fname, lname
 58+ * OPTIONAL - In addition to all non-optional validation which verifies
 59+ * that all populated fields contain an appropriate data type, you may
 60+ * require certain field groups to be non-empty.
 61+ * - address - Validation requires non-empty: street, city, state, zip
 62+ * - amount - Validation requires non-empty: amount
 63+ * - creditCard - Validation requires non-empty: card_num, cvv, expiration and card_type
 64+ * - email - Validation requires non-empty: email
 65+ * - name - Validation requires non-empty: fname, lname
7666 *
77 - * @return 0|1 Returns 0 on success and 1 on failure
 67+ * @return boolean Returns true on an error-free validation, otherwise false.
7868 */
79 - public function validateForm( &$error, $options = array() ) {
 69+ public function validateForm( $options = array() ) {
8070
81 - $data = $this->adapter->getData_Raw();
 71+ $check_not_empty = array();
8272
83 - extract( $options );
84 -
85 - // Set which items will be validated
86 - $address = isset( $address ) ? ( boolean ) $address : true;
87 - $amount = isset( $amount ) ? ( boolean ) $amount : true;
88 - $creditCard = isset( $creditCard ) ? ( boolean ) $creditCard : false;
89 - $email = isset( $email ) ? ( boolean ) $email : true;
90 - $name = isset( $name ) ? ( boolean ) $name : true;
91 -
92 - // These are set in the order they will most likely appear on the form.
93 -
94 - if ( $name ) {
95 - $this->validateName( $data, $error );
 73+ foreach ( $options as $option ){
 74+ $add_checks = array();
 75+ switch( $option ){
 76+ case 'address' :
 77+ $add_checks = array(
 78+ 'street',
 79+ 'city',
 80+ 'state',
 81+ 'country',
 82+ 'zip', //this should really be added or removed, depending on the country and/or gateway requirements.
 83+ //however, that's not happening in this class in the code I'm replacing, so...
 84+ //TODO: Something clever in the DataValidator with data groups like these.
 85+ );
 86+ break;
 87+ case 'amount' :
 88+ $add_checks[] = 'amount';
 89+ break;
 90+ case 'creditCard' :
 91+ $add_checks = array(
 92+ 'card_num',
 93+ 'cvv',
 94+ 'expiration',
 95+ 'card_type'
 96+ );
 97+ break;
 98+ case 'email' :
 99+ $add_checks[] = 'email';
 100+ break;
 101+ case 'name' :
 102+ $add_checks = array(
 103+ 'fname',
 104+ 'lname'
 105+ );
 106+ break;
 107+ }
 108+ $check_not_empty = array_merge( $check_not_empty, $add_checks );
96109 }
97 -
98 - if ( $address ) {
99 - $this->validateAddress( $data, $error );
100 - }
101 -
102 - if ( $amount ) {
103 - $this->validateAmount( $data, $error );
104 - }
105 -
106 - if ( $email ) {
107 - $this->validateEmail( $data, $error );
108 - }
109 -
110 - if ( $creditCard ) {
111 - $this->validateCreditCard( $data, $error );
112 - }
113 -
114 - /*
115 - * $error_result would return 0 on success, 1 on failure.
116 - *
117 - * This is done for backward compatibility.
118 - */
119 - return $this->getValidateFormResult() ? 0 : 1;
120 - }
121 -
122 - /**
123 - * Validates the address
124 - *
125 - * Required:
126 - * - street
127 - * - city
128 - * - state
129 - * - zip
130 - * - country
131 - *
132 - * @param array $data Reference to the data of the form
133 - * @param array $error Reference to the error messages of the form
134 - *
135 - * @see GatewayForm::validateForm()
136 - */
137 - public function validateAddress( &$data, &$error ) {
138 -
139 - if ( empty( $data['street'] ) ) {
140 -
141 - $error['street'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-street' ) );
142 -
143 - $this->setValidateFormResult( false );
144 - }
145 -
146 - if ( empty( $data['city'] ) ) {
147 -
148 - $error['city'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-city' ) );
149 -
150 - $this->setValidateFormResult( false );
151 - }
152 -
153 - if ( empty( $data['state'] ) || $data['state'] == 'YY' ) {
154 -
155 - $error['state'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-state-province' ) );
156 -
157 - $this->setValidateFormResult( false );
158 - }
159 -
160 - if ( empty( $data['country'] ) || !array_key_exists( $data['country'], $this->getCountries() )) {
161 -
162 - $error['country'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-country' ) );
163 -
164 - $this->setValidateFormResult( false );
165 - }
166 -
167 - $ignoreCountries = array();
168110
169 - if ( empty( $data['zip'] ) && !in_array( $data['country'], $ignoreCountries ) ) {
 111+ $validated_ok = $this->adapter->revalidate( $check_not_empty );
170112
171 - $error['zip'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-zip' ) );
172 -
173 - $this->setValidateFormResult( false );
174 - }
 113+ return !$validated_ok;
175114 }
176115
177116 /**
178 - * Validates the amount contributed
179 - *
180 - * @param array $data Reference to the data of the form
181 - * @param array $error Reference to the error messages of the form
182 - *
183 - * @see GatewayForm::validateForm()
184 - */
185 - public function validateAmount( &$data, &$error ) {
186 -
187 - if ( empty( $data['amount'] ) ) {
188 -
189 - $error['amount'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-amount' ) );
190 -
191 - $this->setValidateFormResult( false );
192 - }
193 -
194 - // check amount
195 - $priceFloor = $this->adapter->getGlobal( 'PriceFloor' );
196 - $priceCeiling = $this->adapter->getGlobal( 'PriceCeiling' );
197 - if ( !preg_match( '/^\d+(\.(\d+)?)?$/', $data['amount'] ) ||
198 - ( ( float ) $this->convert_to_usd( $data['currency_code'], $data['amount'] ) < ( float ) $priceFloor ||
199 - ( float ) $this->convert_to_usd( $data['currency_code'], $data['amount'] ) > ( float ) $priceCeiling ) ) {
200 -
201 - $error['invalidamount'] = wfMsg( 'donate_interface-error-msg-invalid-amount' );
202 -
203 - $this->setValidateFormResult( false );
204 - }
205 - }
206 -
207 - /**
208 - * Validates a credit card
209 - *
210 - * @param array $data Reference to the data of the form
211 - * @param array $error Reference to the error messages of the form
212 - *
213 - * @see GatewayForm::validateForm()
214 - */
215 - public function validateCreditCard( &$data, &$error ) {
216 -
217 - if ( empty( $data['card_num'] ) ) {
218 -
219 - $error['card_num'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-card_num' ) );
220 -
221 - $this->setValidateFormResult( false );
222 - }
223 -
224 - if ( empty( $data['cvv'] ) ) {
225 -
226 - $error['cvv'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-cvv' ) );
227 -
228 - $this->setValidateFormResult( false );
229 - }
230 -
231 - if ( empty( $data['expiration'] ) ) {
232 -
233 - $error['expiration'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-expiration' ) );
234 -
235 - $this->setValidateFormResult( false );
236 - }
237 -
238 - // validate that credit card number entered is correct and set the card type
239 - if ( preg_match( '/^3[47][0-9]{13}$/', $data['card_num'] ) ) { // american express
240 - $data['card'] = 'american';
241 - } elseif ( preg_match( '/^5[1-5][0-9]{14}$/', $data['card_num'] ) ) { // mastercard
242 - $data['card'] = 'mastercard';
243 - } elseif ( preg_match( '/^4[0-9]{12}(?:[0-9]{3})?$/', $data['card_num'] ) ) {// visa
244 - $data['card'] = 'visa';
245 - } elseif ( preg_match( '/^6(?:011|5[0-9]{2})[0-9]{12}$/', $data['card_num'] ) ) { // discover
246 - $data['card'] = 'discover';
247 - } else { // an invalid credit card number was entered
248 - $error['card_num'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-card-num' ) );
249 -
250 - $this->setValidateFormResult( false );
251 - }
252 - }
253 -
254 - /**
255 - * Validates an email address.
256 - *
257 - * @param array $data Reference to the data of the form
258 - * @param array $error Reference to the error messages of the form
259 - *
260 - * @see GatewayForm::validateForm()
261 - */
262 - public function validateEmail( &$data, &$error ) {
263 -
264 - if ( empty( $data['email'] ) ) {
265 -
266 - $error['email'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-email-empty' ) );
267 -
268 - $this->setValidateFormResult( false );
269 - }
270 -
271 - // is email address valid?
272 - $isEmail = User::isValidEmailAddr( $data['email'] );
273 -
274 - // create error message (supercedes empty field message)
275 - if ( !$isEmail ) {
276 - $error['email'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-email' ) );
277 -
278 - $this->setValidateFormResult( false );
279 - }
280 - }
281 -
282 - /**
283 - * Validates the name
284 - *
285 - * @param array $data Reference to the data of the form
286 - * @param array $error Reference to the error messages of the form
287 - *
288 - * @see GatewayForm::validateForm()
289 - */
290 - public function validateName( &$data, &$error ) {
291 -
292 - if ( empty( $data['fname'] ) ) {
293 -
294 - $error['fname'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-fname' ) );
295 -
296 - $this->setValidateFormResult( false );
297 - }
298 -
299 - if ( empty( $data['lname'] ) ) {
300 -
301 - $error['lname'] = wfMsg( 'donate_interface-error-msg', wfMsg( 'donate_interface-error-msg-lname' ) );
302 -
303 - $this->setValidateFormResult( false );
304 - }
305 - }
306 -
307 - /**
308117 * Build and display form to user
309118 *
310 - * @param $error Array: array of error messages returned by validate_form function
311 - *
312119 * The message at the top of the form can be edited in the payflow_gateway.i18n.php file
313120 */
314 - public function displayForm( &$error ) {
 121+ public function displayForm() {
315122 global $wgOut;
316123
317124 $form_class = $this->getFormClass();
318 - $form_obj = new $form_class( $this->adapter, $error );
319 - $form = $form_obj->getForm();
320 - $wgOut->addHTML( $form );
321 - }
322 -
323 - /**
324 - * Set the form class to use to generate the CC form
325 - *
326 - * @param string $class_name The class name of the form to use
327 - */
328 - public function setFormClass( $class_name = NULL ) {
329 - if ( !$class_name ) {
330 - global $wgRequest;
331 - $defaultForm = $this->adapter->getGlobal( 'DefaultForm' );
332 - $form_class = $wgRequest->getText( 'form_name', $defaultForm );
333 -
334 - // make sure our form class exists before going on, if not try loading default form class
335 - $class_name = "Gateway_Form_" . $form_class;
336 - if ( !class_exists( $class_name ) ) {
337 - $class_name_orig = $class_name;
338 - $class_name = "Gateway_Form_" . $defaultForm;
339 - if ( !class_exists( $class_name ) ) {
340 - throw new MWException( 'Could not load form ' . $class_name_orig . ' nor default form ' . $class_name );
341 - }
342 - }
 125+ if ( $form_class && class_exists( $form_class ) ){
 126+ $form_obj = new $form_class( $this->adapter );
 127+ $form = $form_obj->getForm();
 128+ $wgOut->addHTML( $form );
 129+ } else {
 130+ throw new MWException( 'No valid form to load.' );
343131 }
344 - $this->form_class = $class_name;
345 -
346 - //this should... maybe replace the other thing? I need it in the adapter so reCaptcha can get to it.
347 - $this->adapter->setFormClass( $class_name );
348132 }
349133
350134 /**
351135 * Get the currently set form class
352 - *
353 - * Will set the form class if the form class not already set
354 - * Using logic in setFormClass()
355 - * @return string
 136+ * @return mixed string containing the valid and enabled form class, otherwise false.
356137 */
357138 public function getFormClass() {
358 - if ( !isset( $this->form_class ) ) {
359 - $this->setFormClass();
360 - }
361 - return $this->form_class;
 139+ return $this->adapter->getFormClass();
362140 }
363141
364142 /**
365 - * Get the currently set form class
 143+ * displayResultsForDebug
366144 *
367 - * Will set the form class if the form class not already set
368 - * Using logic in setFormClass()
369 - * @return string
 145+ * Displays useful information for debugging purposes.
 146+ * Enable with $wgDonationInterfaceDisplayDebug, or the adapter equivalent.
 147+ * @return null
370148 */
371149 protected function displayResultsForDebug( $results = array() ) {
372150 global $wgOut;
@@ -423,54 +201,11 @@
424202 }
425203 }
426204
427 - public function getPossibleErrors() {
428 - return array(
429 - 'general' => '',
430 - 'retryMsg' => '',
431 - 'invalidamount' => '',
432 - 'card_num' => '',
433 - 'card_type' => '',
434 - 'cvv' => '',
435 - 'fname' => '',
436 - 'lname' => '',
437 - 'city' => '',
438 - 'country' => '',
439 - 'street' => '',
440 - 'state' => '',
441 - 'zip' => '',
442 - 'emailAdd' => '',
443 - );
444 - }
445 -
446205 /**
447 - * Convert an amount for a particular currency to an amount in USD
448 - *
449 - * This is grosley rudimentary and likely wildly inaccurate.
450 - * This mimicks the hard-coded values used by the WMF to convert currencies
451 - * for validatoin on the front-end on the first step landing pages of their
452 - * donation process - the idea being that we can get a close approximation
453 - * of converted currencies to ensure that contributors are not going above
454 - * or below the price ceiling/floor, even if they are using a non-US currency.
455 - *
456 - * In reality, this probably ought to use some sort of webservice to get real-time
457 - * conversion rates.
458 - *
459 - * @param string $currency_code
460 - * @param float $amount
461 - * @return float
 206+ * logs messages to the current gateway adapter's configured log location
 207+ * @param string $msg The message to log
 208+ * @param string $log_level The severity level of the message.
462209 */
463 - static function convert_to_usd( $currency_code, $amount ) {
464 - require_once( dirname( __FILE__ ) . '/currencyRates.inc' );
465 - $rates = getCurrencyRates();
466 - $code = strtoupper( $currency_code );
467 - if ( array_key_exists( $code, $rates ) ) {
468 - $usd_amount = $amount / $rates[$code];
469 - } else {
470 - $usd_amount = $amount;
471 - }
472 - return $usd_amount;
473 - }
474 -
475210 public function log( $msg, $log_level=LOG_INFO ) {
476211 $this->adapter->log( $msg, $log_level );
477212 }
@@ -489,7 +224,8 @@
490225 // if we don't have a URL enabled throw a graceful error to the user
491226 if ( !strlen( $this->adapter->getGlobal( 'PaypalURL' ) ) ) {
492227 $gateway_identifier = $this->adapter->getIdentifier();
493 - $this->errors['general']['nopaypal'] = wfMsg( $gateway_identifier . '_gateway-error-msg-nopaypal' );
 228+ $error['general']['nopaypal'] = wfMsg( $gateway_identifier . '_gateway-error-msg-nopaypal' );
 229+ $this->adapter->addManualError( $error );
494230 return;
495231 }
496232 // submit the data to the paypal redirect URL
@@ -506,26 +242,6 @@
507243 }
508244
509245 /**
510 - * Get validate form result
511 - *
512 - * @return boolean
513 - */
514 - public function getValidateFormResult() {
515 -
516 - return ( boolean ) $this->validateFormResult;
517 - }
518 -
519 - /**
520 - * Set validate form result
521 - *
522 - * @param boolean $validateFormResult
523 - */
524 - public function setValidateFormResult( $validateFormResult ) {
525 -
526 - $this->validateFormResult = empty( $validateFormResult ) ? false : ( boolean ) $validateFormResult;
527 - }
528 -
529 - /**
530246 * Handle the result from the gateway
531247 *
532248 * If there are errors, then this will return to the form.
@@ -572,21 +288,19 @@
573289 // Display debugging results
574290 $this->displayResultsForDebug();
575291
576 - $this->errors['general'] = ( !isset( $this->errors['general'] ) || empty( $this->errors['general'] ) ) ? array() : (array) $this->errors['general'];
577 -
578 - $this->errors['retryMsg'] = ( !isset( $this->errors['retryMsg'] ) || empty( $this->errors['retryMsg'] ) ) ? array() : (array) $this->errors['retryMsg'];
579 -
580292 foreach ( $this->adapter->getTransactionErrors() as $code => $message ) {
581293
 294+ $error = array();
582295 if ( strpos( $code, 'internal' ) === 0 ) {
583 - $this->errors['retryMsg'][ $code ] = $message;
 296+ $error['retryMsg'][ $code ] = $message;
584297 }
585298 else {
586 - $this->errors['general'][ $code ] = $message;
 299+ $error['general'][ $code ] = $message;
587300 }
 301+ $this->adapter->addManualError( $error );
588302 }
589303
590 - return $this->displayForm( $this->errors );
 304+ return $this->displayForm();
591305 }
592306
593307 }
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php
___________________________________________________________________
Added: svn:mergeinfo
594308 Merged /trunk/extensions/DonationInterface/gateway_common/GatewayForm.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,99570-101026,101056,101060,101063-101064,101071-101074,101076,101099,101109,101112,101163,101180,101192,101200,101205,101207,101217,101230,101232,101236,101335,101382,101399,101441,101501-101504,101512,101541,101547,101549,101553-101555,101557,101559,101561,101563,101576,101578-101579,101631,101633,101638,101669,101676,101679,101689,101700,101706,101719,101740,101747,101757,101764,101778-101779,101781,101785-101789,101798,101823,101826,101837,101846,101852,101870-101872,101878,101882,101890,101892,101910,101917,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102003,102011-102012,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102252,102258-102261,102263,102267,102269,102307-102309,102313,102318,102332,102338,102341-102342,102345,102364,102419,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681-102682,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102733,102736,102740,102752,102763,102805,102807,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102878,102915,102921-102923,102926-102928,102932,102936,102938,102942-102943,102946,102953,102960-102961,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103050,103058,103067,103077,103080,103130,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103411,103413,103421,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,104065,104194,104210,104243,104298,104362,104485,104539,104587,104611,105534,105584,105593-105594,105600,105611,105938,106109,106158,106954,107106,107182,107261,107287,107342,107412,107536,107544,107609,107981,108522
595309 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/GatewayForm.php:r99568
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php
@@ -33,6 +33,9 @@
3434 $messages['pt']['donate_interface-donor-fname-gq'] = 'Nome';
3535 $messages['pt']['donate_interface-donor-lname-gq'] = 'Apelido';
3636
 37+/* KE - Kenya */
 38+$messages['en']['donate_interface-donor-lname-ke'] = 'Surname';
 39+
3740 /* TZ - Tanzania */
3841 $messages['en']['donate_interface-donor-lname-tz'] = 'Surname';
3942
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php
___________________________________________________________________
Added: svn:mergeinfo
4043 Merged /trunk/extensions/DonationInterface/gateway_common/country.specific.i18n.php:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,99570-101026,101056,101060,101063-101064,101071-101074,101076,101099,101109,101112,101163,101180,101192,101200,101205,101207,101217,101230,101232,101236,101335,101382,101399,101441,101501-101504,101512,101541,101547,101549,101553-101555,101557,101559,101561,101563,101576,101578-101579,101631,101633,101638,101669,101676,101679,101689,101700,101706,101719,101740,101747,101757,101764,101778-101779,101781,101785-101789,101798,101823,101826,101837,101846,101852,101870-101872,101878,101882,101890,101892,101910,101917,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102003,102011-102012,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102252,102258-102261,102263,102267,102269,102307-102309,102313,102318,102332,102338,102341-102342,102345,102364,102419,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102681-102682,102685,102689,102698,102700-102703,102707,102711-102712,102714,102729,102733,102736,102740,102752,102763,102805,102807,102809-102810,102812,102819-102824,102826,102828-102833,102835-102836,102841,102872,102878,102915,102921-102923,102926-102928,102932,102936,102938,102942-102943,102946,102953,102960-102961,103009,103023-103024,103026-103027,103032,103036-103038,103040,103044,103050,103058,103067,103077,103080,103130,103219,103223,103229,103235,103237-103239,103243-103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103411,103413,103421,103434-103435,103481,103500,103503,103515,103519,103537,103541,103548,103591,103607-103608,103633,103680,103775,103784,103837,103839,103863,103866,104065,104194,104210,104243,104298,104362,104485,104539,104587,104611,105534,105584,105593-105594,105600,105611,106954,107106,107182,107261,107287,107342,107412,107536,107544,112188
4144 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/gateway_common/country.specific.i18n.php:r99568

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101785Lots going on here, in preparation for re-designing the way we validate and a...khorn04:15, 3 November 2011
r105938Data handling cleanup in DonationInterface, part 1 of [some]....khorn22:12, 12 December 2011
r105941followup r105938...khorn22:22, 12 December 2011
r105953followup r105938...khorn23:07, 12 December 2011
r106109Data handling cleanup in DonationInterface, part 2 of [some]....khorn21:53, 13 December 2011
r106158Data handling cleanup in DonationInterface, part 3 of [some]....khorn01:35, 14 December 2011
r106259Lots of comments for DonationData.php (and protected some of the functions).khorn22:16, 14 December 2011
r106366Removing commented-out lines referencing TwoStepAmountkhorn20:51, 15 December 2011
r106493followup r106158...khorn01:22, 17 December 2011
r106495The beginnings of input validation in DonationData....khorn01:34, 17 December 2011
r106836More work on moving the input validation functions from GatewayForm to Donati...khorn19:11, 20 December 2011
r106902Renamed and moved TwoStepAmount to UniversalTestForm into tests.jpostlethwaite00:27, 21 December 2011
r107299Bye, bye $wgExtensionAliasesFiles (deprecated in 1.16).siebrand23:09, 25 December 2011
r107322Kill some <= 1.15 back compat...reedy15:13, 26 December 2011
r107609Replacing most of the haphazard validation found throughout DonationInterface...khorn01:05, 30 December 2011
r107690followup r107609...khorn01:56, 31 December 2011
r107981followup r107609...khorn01:16, 4 January 2012
r108522Cleanup: Added a tiny bit of documentation and removed code that is either no...khorn17:41, 10 January 2012
r108541Cleanup: Added a tiny bit of documentation and removed code that is either no...khorn20:06, 10 January 2012
r112188Tiny FU to r112187 fixing message for KEpgehres06:36, 23 February 2012

Status & tagging log