Completed
Pull Request — develop (#34)
by Mario
03:14
created
controller/ipn_listener.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
 			foreach ($args as $key => $value)
264 264
 			{
265 265
 				$value = urlencode($value);
266
-				$message .= $key . ' = ' . $value . ";\n";
266
+				$message .= $key.' = '.$value.";\n";
267 267
 			}
268 268
 			unset($value);
269 269
 		}
270 270
 
271 271
 		if ($log_in_file)
272 272
 		{
273
-			error_log(sprintf('[%s] %s %s', $error_timestamp, $message, $backtrace), 3, $this->root_path . 'store/ppde_transactions.log');
273
+			error_log(sprintf('[%s] %s %s', $error_timestamp, $message, $backtrace), 3, $this->root_path.'store/ppde_transactions.log');
274 274
 		}
275 275
 
276 276
 		if ($exit)
@@ -489,13 +489,13 @@  discard block
 block discarded – undo
489 489
 		foreach ($this->get_post_data() as $key => $value)
490 490
 		{
491 491
 			$encoded = urlencode(stripslashes($value));
492
-			$values[] = $key . '=' . $encoded;
492
+			$values[] = $key.'='.$encoded;
493 493
 
494 494
 			$this->transaction_data[$key] = $value;
495 495
 		}
496 496
 
497 497
 		// implode the array into a string URI
498
-		$this->args_return_uri .= '&' . implode('&', $values);
498
+		$this->args_return_uri .= '&'.implode('&', $values);
499 499
 	}
500 500
 
501 501
 	/**
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 		if (curl_errno($ch) != 0)
557 557
 		{
558 558
 			// cURL error
559
-			$this->log_error($this->user->lang['CURL_ERROR'] . curl_errno($ch) . ' (' . curl_error($ch) . ')', $this->use_log_error);
559
+			$this->log_error($this->user->lang['CURL_ERROR'].curl_errno($ch).' ('.curl_error($ch).')', $this->use_log_error);
560 560
 			curl_close($ch);
561 561
 		}
562 562
 		else
@@ -593,20 +593,20 @@  discard block
 block discarded – undo
593 593
 		// post back to PayPal system to validate
594 594
 		$header = "POST /cgi-bin/webscr HTTP/1.1\r\n";
595 595
 		$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
596
-		$header .= 'Host: ' . $parse_url['host'] . "\r\n";
597
-		$header .= 'Content-Length: ' . strlen($encoded_data) . "\r\n";
596
+		$header .= 'Host: '.$parse_url['host']."\r\n";
597
+		$header .= 'Content-Length: '.strlen($encoded_data)."\r\n";
598 598
 		$header .= "Connection: Close\r\n\r\n";
599 599
 
600
-		$fp = fsockopen('ssl://' . $parse_url['host'], 443, $errno, $errstr, $this->timeout);
600
+		$fp = fsockopen('ssl://'.$parse_url['host'], 443, $errno, $errstr, $this->timeout);
601 601
 
602 602
 		if (!$fp)
603 603
 		{
604
-			$this->log_error($this->user->lang['FSOCK_ERROR'] . $errno . ' (' . $errstr . ')', $this->use_log_error);
604
+			$this->log_error($this->user->lang['FSOCK_ERROR'].$errno.' ('.$errstr.')', $this->use_log_error);
605 605
 		}
606 606
 		else
607 607
 		{
608 608
 			// Send the data to PayPal
609
-			fputs($fp, $header . $encoded_data);
609
+			fputs($fp, $header.$encoded_data);
610 610
 
611 611
 			// Loop through the response
612 612
 			while (!feof($fp))
@@ -641,17 +641,17 @@  discard block
 block discarded – undo
641 641
 		if ($this->txn_is_verified())
642 642
 		{
643 643
 			$this->verified = $this->transaction_data['confirmed'] = true;
644
-			$this->log_error("DEBUG VERIFIED:\n" . $this->get_text_report(), $this->use_log_error);
644
+			$this->log_error("DEBUG VERIFIED:\n".$this->get_text_report(), $this->use_log_error);
645 645
 		}
646 646
 		else if ($this->txn_is_invalid())
647 647
 		{
648 648
 			$this->verified = $this->transaction_data['confirmed'] = false;
649
-			$this->log_error("DEBUG INVALID:\n" . $this->get_text_report(), $this->use_log_error, true);
649
+			$this->log_error("DEBUG INVALID:\n".$this->get_text_report(), $this->use_log_error, true);
650 650
 		}
651 651
 		else
652 652
 		{
653 653
 			$this->verified = $this->transaction_data['confirmed'] = false;
654
-			$this->log_error("DEBUG OTHER:\n" . $this->get_text_report(), $this->use_log_error);
654
+			$this->log_error("DEBUG OTHER:\n".$this->get_text_report(), $this->use_log_error);
655 655
 			$this->log_error($this->user->lang['UNEXPECTED_RESPONSE'], $this->use_log_error, true);
656 656
 		}
657 657
 
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
 
712 712
 		// Date and POST url
713 713
 		$this->text_report_insert_line($r);
714
-		$r .= "\n[" . date('m/d/Y g:i A') . '] - ' . $this->u_paypal . ' ( ' . $this->get_curl_fsock() . " )\n";
714
+		$r .= "\n[".date('m/d/Y g:i A').'] - '.$this->u_paypal.' ( '.$this->get_curl_fsock()." )\n";
715 715
 
716 716
 		// HTTP Response
717 717
 		$this->text_report_insert_line($r);
718
-		$r .= "\n" . $this->get_report_response() . "\n";
719
-		$r .= "\n" . $this->get_response_status() . "\n";
718
+		$r .= "\n".$this->get_report_response()."\n";
719
+		$r .= "\n".$this->get_response_status()."\n";
720 720
 		$this->text_report_insert_line($r);
721 721
 
722 722
 		// POST vars
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
 	{
783 783
 		foreach ($this->transaction_data as $key => $value)
784 784
 		{
785
-			$r .= str_pad($key, 25) . $value . "\n";
785
+			$r .= str_pad($key, 25).$value."\n";
786 786
 		}
787 787
 	}
788 788
 
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
 		{
961 961
 			if (!function_exists('group_user_add'))
962 962
 			{
963
-				include($this->root_path . 'includes/functions_user.' . $this->php_ext);
963
+				include($this->root_path.'includes/functions_user.'.$this->php_ext);
964 964
 			}
965 965
 
966 966
 			// add the user to the donors group and set as default.
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 	private function update_raised_amount()
1055 1055
 	{
1056 1056
 		$ipn_suffix = $this->ppde_controller_transactions_admin->get_suffix_ipn();
1057
-		$this->config->set('ppde_raised' . $ipn_suffix, (float) $this->config['ppde_raised' . $ipn_suffix] + (float) $this->net_amount($this->transaction_data['mc_gross'], $this->transaction_data['mc_fee']), true);
1057
+		$this->config->set('ppde_raised'.$ipn_suffix, (float) $this->config['ppde_raised'.$ipn_suffix] + (float) $this->net_amount($this->transaction_data['mc_gross'], $this->transaction_data['mc_fee']), true);
1058 1058
 	}
1059 1059
 
1060 1060
 	/**
Please login to merge, or discard this patch.
controller/admin_overview_controller.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 			'S_FSOCKOPEN'               => $this->config['ppde_fsock_detected'],
98 98
 			'TRANSACTIONS_COUNT'        => $this->config['ppde_transactions_count'],
99 99
 			'TRANSACTIONS_PER_DAY'      => $this->per_day_stats('ppde_transactions_count'),
100
-			'U_PPDE_MORE_INFORMATION'   => append_sid("index.$this->php_ext", 'i=acp_extensions&mode=main&action=details&ext_name=' . urlencode($this->ext_meta['name'])),
101
-			'U_PPDE_VERSIONCHECK_FORCE' => $this->u_action . '&versioncheck_force=1',
100
+			'U_PPDE_MORE_INFORMATION'   => append_sid("index.$this->php_ext", 'i=acp_extensions&mode=main&action=details&ext_name='.urlencode($this->ext_meta['name'])),
101
+			'U_PPDE_VERSIONCHECK_FORCE' => $this->u_action.'&versioncheck_force=1',
102 102
 			'U_ACTION'                  => $this->u_action,
103 103
 		));
104 104
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	{
192 192
 		if (!$this->auth->acl_get('a_ppde_manage'))
193 193
 		{
194
-			trigger_error($this->user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
194
+			trigger_error($this->user->lang['NO_AUTH_OPERATION'].adm_back_link($this->u_action), E_USER_WARNING);
195 195
 		}
196 196
 
197 197
 		switch ($action)
Please login to merge, or discard this patch.
controller/admin_transactions_controller.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		$this->template = $template;
72 72
 		$this->user = $user;
73 73
 		$this->adm_relative_path = $adm_relative_path;
74
-		$this->phpbb_admin_path = $phpbb_root_path . $adm_relative_path;
74
+		$this->phpbb_admin_path = $phpbb_root_path.$adm_relative_path;
75 75
 		$this->phpbb_root_path = $phpbb_root_path;
76 76
 		$this->php_ext = $php_ext;
77 77
 		$this->table_ppde_transactions = $table_ppde_transactions;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 					$entity->delete(0, '', $where_sql);
126 126
 					$this->update_stats();
127 127
 					$this->update_stats(true);
128
-					$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_' . $this->lang_key_prefix . '_PURGED', time());
128
+					$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_'.$this->lang_key_prefix.'_PURGED', time());
129 129
 				}
130 130
 			}
131 131
 			else
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 
163 163
 			// Define where and sort sql for use in displaying transactions
164 164
 			$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
165
-			$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
165
+			$sql_sort = $sort_by_sql[$sort_key].' '.(($sort_dir == 'd') ? 'DESC' : 'ASC');
166 166
 
167 167
 			$keywords = utf8_normalize_nfc($this->request->variable('keywords', '', true));
168
-			$keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
168
+			$keywords_param = !empty($keywords) ? '&keywords='.urlencode(htmlspecialchars_decode($keywords)) : '';
169 169
 
170 170
 			// Grab log data
171 171
 			$log_data = array();
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
 			$this->view_txn_log($log_data, $log_count, $this->config['topics_per_page'], $start, $sql_where, $sql_sort, $keywords);
175 175
 
176
-			$base_url = $this->u_action . '&' . $u_sort_param . $keywords_param;
176
+			$base_url = $this->u_action.'&'.$u_sort_param.$keywords_param;
177 177
 			$pagination->generate_template_pagination($base_url, 'pagination', 'start', $log_count, $this->config['topics_per_page'], $start);
178 178
 
179 179
 			$this->template->assign_vars(array(
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 				'S_SORT_KEY'   => $s_sort_key,
184 184
 				'S_SORT_DIR'   => $s_sort_dir,
185 185
 				'S_TXN'        => $mode,
186
-				'U_ACTION'     => $this->u_action . '&' . $u_sort_param . $keywords_param . '&start=' . $start,
186
+				'U_ACTION'     => $this->u_action.'&'.$u_sort_param.$keywords_param.'&start='.$start,
187 187
 			));
188 188
 
189 189
 			foreach ($log_data as $row)
@@ -215,9 +215,9 @@  discard block
 block discarded – undo
215 215
 	public function update_stats($ipn_stats = false)
216 216
 	{
217 217
 		$this->set_ipn_test_properties($ipn_stats);
218
-		$this->config->set('ppde_known_donors_count' . $this->suffix_ipn, $this->sql_query_update_stats('ppde_known_donors_count' . $this->suffix_ipn), true);
219
-		$this->config->set('ppde_anonymous_donors_count' . $this->suffix_ipn, $this->sql_query_update_stats('ppde_anonymous_donors_count' . $this->suffix_ipn));
220
-		$this->config->set('ppde_transactions_count' . $this->suffix_ipn, $this->sql_query_update_stats('ppde_transactions_count' . $this->suffix_ipn), true);
218
+		$this->config->set('ppde_known_donors_count'.$this->suffix_ipn, $this->sql_query_update_stats('ppde_known_donors_count'.$this->suffix_ipn), true);
219
+		$this->config->set('ppde_anonymous_donors_count'.$this->suffix_ipn, $this->sql_query_update_stats('ppde_anonymous_donors_count'.$this->suffix_ipn));
220
+		$this->config->set('ppde_transactions_count'.$this->suffix_ipn, $this->sql_query_update_stats('ppde_transactions_count'.$this->suffix_ipn), true);
221 221
 	}
222 222
 
223 223
 	/**
@@ -293,21 +293,21 @@  discard block
 block discarded – undo
293 293
 			case 'ppde_transactions_count':
294 294
 			case 'ppde_transactions_count_ipn':
295 295
 				$sql = $this->make_stats_sql_select('txn_id');
296
-				$sql .= " WHERE confirmed = 1 AND payment_status = 'Completed' AND txn.test_ipn = " . (int) $this->is_ipn_test;
296
+				$sql .= " WHERE confirmed = 1 AND payment_status = 'Completed' AND txn.test_ipn = ".(int) $this->is_ipn_test;
297 297
 
298 298
 				return $sql;
299 299
 			case 'ppde_known_donors_count':
300 300
 			case 'ppde_known_donors_count_ipn':
301 301
 				$sql = $this->make_stats_sql_select('payer_id');
302
-				$sql .= ' LEFT JOIN ' . USERS_TABLE . ' u
302
+				$sql .= ' LEFT JOIN '.USERS_TABLE.' u
303 303
 				 					ON txn.user_id = u.user_id
304
-								WHERE (u.user_type = ' . USER_NORMAL . ' OR u.user_type = ' . USER_FOUNDER . ") AND txn.test_ipn = " . (int) $this->is_ipn_test;
304
+								WHERE (u.user_type = ' . USER_NORMAL.' OR u.user_type = '.USER_FOUNDER.") AND txn.test_ipn = ".(int) $this->is_ipn_test;
305 305
 
306 306
 				return $sql;
307 307
 			case 'ppde_anonymous_donors_count':
308 308
 			case 'ppde_anonymous_donors_count_ipn':
309 309
 				$sql = $this->make_stats_sql_select('payer_id');
310
-				$sql .= ' WHERE txn.user_id = ' . ANONYMOUS . ' AND txn.test_ipn = ' . (int) $this->is_ipn_test;
310
+				$sql .= ' WHERE txn.user_id = '.ANONYMOUS.' AND txn.test_ipn = '.(int) $this->is_ipn_test;
311 311
 
312 312
 				return $sql;
313 313
 			default:
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
 	 */
326 326
 	private function make_stats_sql_select($field_name)
327 327
 	{
328
-		return 'SELECT COUNT(DISTINCT txn.' . $field_name . ') AS count_result
329
-				FROM ' . $this->table_ppde_transactions . ' txn';
328
+		return 'SELECT COUNT(DISTINCT txn.'.$field_name.') AS count_result
329
+				FROM ' . $this->table_ppde_transactions.' txn';
330 330
 	}
331 331
 
332 332
 	/**
@@ -362,14 +362,14 @@  discard block
 block discarded – undo
362 362
 
363 363
 				$this->template->assign_vars(array(
364 364
 					'BOARD_USERNAME' => $data['username'],
365
-					'EXCHANGE_RATE'  => '1 ' . $data['mc_currency'] . ' = ' . $data['exchange_rate'] . ' ' . $data['settle_currency'],
365
+					'EXCHANGE_RATE'  => '1 '.$data['mc_currency'].' = '.$data['exchange_rate'].' '.$data['settle_currency'],
366 366
 					'ITEM_NAME'      => $data['item_name'],
367 367
 					'ITEM_NUMBER'    => $data['item_number'],
368
-					'MC_CURRENCY'    => $data['net_amount'] . ' ' . $data['mc_currency'],
369
-					'MC_GROSS'       => $data['mc_gross'] . ' ' . $data['mc_currency'],
370
-					'MC_FEE'         => '-' . $data['mc_fee'] . ' ' . $data['mc_currency'],
371
-					'MC_NET'         => $data['net_amount'] . ' ' . $data['mc_currency'],
372
-					'NAME'           => $data['first_name'] . ' ' . $data['last_name'],
368
+					'MC_CURRENCY'    => $data['net_amount'].' '.$data['mc_currency'],
369
+					'MC_GROSS'       => $data['mc_gross'].' '.$data['mc_currency'],
370
+					'MC_FEE'         => '-'.$data['mc_fee'].' '.$data['mc_currency'],
371
+					'MC_NET'         => $data['net_amount'].' '.$data['mc_currency'],
372
+					'NAME'           => $data['first_name'].' '.$data['last_name'],
373 373
 					'PAYER_EMAIL'    => $data['payer_email'],
374 374
 					'PAYER_ID'       => $data['payer_id'],
375 375
 					'PAYER_STATUS'   => ($data['payer_status']) ? $this->user->lang['PPDE_DT_VERIFIED'] : $this->user->lang['PPDE_DT_UNVERIFIED'],
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 					'PAYMENT_STATUS' => $payment_status_ary[strtolower($data['payment_status'])],
378 378
 					'RECEIVER_EMAIL' => $data['receiver_email'],
379 379
 					'RECEIVER_ID'    => $data['receiver_id'],
380
-					'SETTLE_AMOUNT'  => $data['settle_amount'] . ' ' . $data['settle_currency'],
380
+					'SETTLE_AMOUNT'  => $data['settle_amount'].' '.$data['settle_currency'],
381 381
 					'TXN_ID'         => $data['txn_id'],
382 382
 
383 383
 					'L_PPDE_DT_SETTLE_AMOUNT'         => $this->user->lang('PPDE_DT_SETTLE_AMOUNT', $data['settle_currency']),
@@ -439,13 +439,13 @@  discard block
 block discarded – undo
439 439
 
440 440
 		if ($this->get_container_entity()->is_in_admin() && $this->phpbb_admin_path)
441 441
 		{
442
-			$url_ary['profile_url'] = append_sid($this->phpbb_admin_path . 'index.' . $this->php_ext, 'i=users&mode=overview');
443
-			$url_ary['txn_url'] = append_sid($this->phpbb_admin_path . 'index.' . $this->php_ext, 'i=-skouat-ppde-acp-ppde_module&mode=transactions');
442
+			$url_ary['profile_url'] = append_sid($this->phpbb_admin_path.'index.'.$this->php_ext, 'i=users&mode=overview');
443
+			$url_ary['txn_url'] = append_sid($this->phpbb_admin_path.'index.'.$this->php_ext, 'i=-skouat-ppde-acp-ppde_module&mode=transactions');
444 444
 
445 445
 		}
446 446
 		else
447 447
 		{
448
-			$url_ary['profile_url'] = append_sid($this->phpbb_root_path . 'memberlist.' . $this->php_ext, 'mode=viewprofile');
448
+			$url_ary['profile_url'] = append_sid($this->phpbb_root_path.'memberlist.'.$this->php_ext, 'mode=viewprofile');
449 449
 			$url_ary['txn_url'] = '';
450 450
 		}
451 451
 
Please login to merge, or discard this patch.