Commit | Line | Data |
---|---|---|
71a6ba5c LMM |
1 | <?php |
2 | /* | |
93b42747 LMM |
3 | * This file is part of CiviCRM. |
4 | * | |
5 | * CiviCRM is free software: you can redistribute it and/or modify | |
6 | * it under the terms of the GNU General Public License as published by | |
7 | * the Free Software Foundation, either version 3 of the License, or | |
8 | * (at your option) any later version. | |
9 | * | |
10 | * CiviCRM is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with CiviCRM. If not, see <http://www.gnu.org/licenses/>. | |
17 | * | |
71a6ba5c LMM |
18 | * Copyright (C) 2012 |
19 | * Licensed to CiviCRM under the GPL v3 or higher | |
20 | * | |
21 | * Written and contributed by Ward Vandewege <ward@fsf.org> (http://www.fsf.org) | |
68f3cf09 | 22 | * Modified by Lisa Marie Maginnis <lisa@fsf.org> (http://www.fsf.org) |
4efc3ebe | 23 | * Copyright © 2015 David Thompson <davet@gnu.org> |
71a6ba5c LMM |
24 | * |
25 | */ | |
26 | ||
27 | // Define logging level (0 = off, 4 = log everything) | |
28 | define('TRUSTCOMMERCE_LOGGING_LEVEL', 4); | |
29 | ||
30 | require_once 'CRM/Core/Payment.php'; | |
31 | class org_fsf_payment_trustcommerce extends CRM_Core_Payment { | |
32 | CONST CHARSET = 'iso-8859-1'; | |
33 | CONST AUTH_APPROVED = 'approve'; | |
34 | CONST AUTH_DECLINED = 'decline'; | |
35 | CONST AUTH_BADDATA = 'baddata'; | |
36 | CONST AUTH_ERROR = 'error'; | |
4d58ae2f | 37 | CONST AUTH_BLACKLIST = 'blacklisted'; |
71a6ba5c LMM |
38 | |
39 | static protected $_mode = NULL; | |
40 | ||
41 | static protected $_params = array(); | |
42 | ||
43 | /** | |
44 | * We only need one instance of this object. So we use the singleton | |
45 | * pattern and cache the instance in this variable | |
46 | * | |
47 | * @var object | |
48 | * @static | |
49 | */ | |
50 | static private $_singleton = NULL; | |
51 | ||
52 | /** | |
53 | * Constructor | |
54 | * | |
55 | * @param string $mode the mode of operation: live or test | |
56 | * | |
57 | * @return void | |
58 | */ function __construct($mode, &$paymentProcessor) { | |
59 | $this->_mode = $mode; | |
60 | ||
61 | $this->_paymentProcessor = $paymentProcessor; | |
62 | ||
63 | $this->_processorName = ts('TrustCommerce'); | |
64 | ||
65 | $config = CRM_Core_Config::singleton(); | |
66 | $this->_setParam('user_name', $paymentProcessor['user_name']); | |
67 | $this->_setParam('password', $paymentProcessor['password']); | |
68 | ||
69 | $this->_setParam('timestamp', time()); | |
70 | srand(time()); | |
71 | $this->_setParam('sequence', rand(1, 1000)); | |
72 | $this->logging_level = TRUSTCOMMERCE_LOGGING_LEVEL; | |
4d58ae2f | 73 | |
71a6ba5c LMM |
74 | } |
75 | ||
76 | /** | |
77 | * singleton function used to manage this object | |
78 | * | |
79 | * @param string $mode the mode of operation: live or test | |
80 | * | |
81 | * @return object | |
82 | * @static | |
83 | * | |
84 | */ | |
85 | static | |
86 | function &singleton($mode, &$paymentProcessor) { | |
87 | $processorName = $paymentProcessor['name']; | |
88 | if (self::$_singleton[$processorName] === NULL) { | |
89 | self::$_singleton[$processorName] = new org_fsf_payment_trustcommerce($mode, $paymentProcessor); | |
90 | } | |
91 | return self::$_singleton[$processorName]; | |
92 | } | |
93 | ||
94 | /** | |
e0273c0a LMM |
95 | * Submit a payment using the TC API |
96 | * @param array $params The params we will be sending to tclink_send() | |
97 | * @return mixed An array of our results, or an error object if the transaction fails. | |
71a6ba5c LMM |
98 | * @public |
99 | */ | |
100 | function doDirectPayment(&$params) { | |
101 | if (!extension_loaded("tclink")) { | |
102 | return self::error(9001, 'TrustCommerce requires that the tclink module is loaded'); | |
103 | } | |
104 | ||
f322addf LMM |
105 | /* Copy our paramaters to ourself */ |
106 | foreach ($params as $field => $value) { | |
71a6ba5c LMM |
107 | $this->_setParam($field, $value); |
108 | } | |
109 | ||
f322addf LMM |
110 | /* Get our fields to pass to tclink_send() */ |
111 | $tc_params = $this->_getTrustCommerceFields(); | |
71a6ba5c | 112 | |
f322addf | 113 | /* Are we recurring? If so add the extra API fields. */ |
7d2018fa | 114 | if (CRM_Utils_Array::value('is_recur', $params) == 1) { |
f322addf | 115 | $tc_params = $this->_getRecurPaymentFields($tc_params); |
7d2018fa | 116 | $recur=1; |
f322addf | 117 | } |
71a6ba5c | 118 | |
f322addf | 119 | /* Pass our cooked params to the alter hook, per Core/Payment/Dummy.php */ |
32bf0975 | 120 | CRM_Utils_Hook::alterPaymentProcessorParams($this, $params, $tc_params); |
71a6ba5c LMM |
121 | |
122 | // TrustCommerce will not refuse duplicates, so we should check if the user already submitted this transaction | |
f322addf | 123 | if ($this->_checkDupe($tc_params['ticket'])) { |
71a6ba5c LMM |
124 | return self::error(9004, 'It appears that this transaction is a duplicate. Have you already submitted the form once? If so there may have been a connection problem. You can try your transaction again. If you continue to have problems please contact the site administrator.'); |
125 | } | |
126 | ||
4d58ae2f LMM |
127 | /* This implements a local blacklist, and passes us though as a normal failure |
128 | * if the luser is on the blacklist. */ | |
129 | if(!$this->_isBlacklisted()) { | |
130 | /* Call the TC API, and grab the reply */ | |
131 | $reply = $this->_sendTCRequest($tc_params); | |
132 | } else { | |
133 | $this->_logger($tc_params); | |
134 | $reply['status'] = self::AUTH_BLACKLIST; | |
135 | } | |
71a6ba5c | 136 | |
f322addf | 137 | /* Parse our reply */ |
5efae07f | 138 | $result = $this->_getTCReply($reply); |
71a6ba5c | 139 | |
f322addf LMM |
140 | if($result == 0) { |
141 | /* We were successful, congrats. Lets wrap it up: | |
142 | * Convert back to dollars | |
143 | * Save the transaction ID | |
144 | */ | |
06f2e425 | 145 | |
7d2018fa DT |
146 | if (array_key_exists('billingid', $reply)) { |
147 | $params['recurr_profile_id'] = $reply['billingid']; | |
148 | CRM_Core_DAO::setFieldValue( | |
149 | 'CRM_Contribute_DAO_ContributionRecur', | |
150 | $this->_getParam('contributionRecurID'), | |
151 | 'processor_id', $reply['billingid'] | |
152 | ); | |
153 | } | |
f322addf | 154 | $params['trxn_id'] = $reply['transid']; |
06f2e425 | 155 | |
f322addf | 156 | $params['gross_amount'] = $tc_params['amount'] / 100; |
71a6ba5c | 157 | |
f322addf | 158 | return $params; |
71a6ba5c | 159 | |
f322addf LMM |
160 | } else { |
161 | /* Otherwise we return the error object */ | |
162 | return $result; | |
163 | } | |
71a6ba5c LMM |
164 | } |
165 | ||
4efc3ebe DT |
166 | /** |
167 | * Update CC info for a recurring contribution | |
168 | */ | |
169 | function updateSubscriptionBillingInfo(&$message = '', $params = array()) { | |
170 | $expYear = $params['credit_card_exp_date']['Y']; | |
171 | $expMonth = $params['credit_card_exp_date']['M']; | |
172 | ||
173 | $tc_params = array( | |
174 | 'custid' => $this->_paymentProcessor['user_name'], | |
175 | 'password' => $this->_paymentProcessor['password'], | |
176 | 'action' => 'store', | |
177 | 'billingid' => $params['subscriptionId'], | |
178 | 'avs' => 'y', // Enable address verification | |
179 | 'address1' => $params['street_address'], | |
180 | 'zip' => $params['postal_code'], | |
181 | 'name' => $this->_formatBillingName($params['first_name'], | |
182 | $params['last_name']), | |
183 | 'cc' => $params['credit_card_number'], | |
184 | 'cvv' => $params['cvv2'], | |
185 | 'exp' => $this->_formatExpirationDate($expYear, $expMonth), | |
186 | 'amount' => $this->_formatAmount($params['amount']), | |
187 | ); | |
188 | ||
189 | CRM_Utils_Hook::alterPaymentProcessorParams($this, $params, $tc_params); | |
190 | ||
191 | $reply = $this->_sendTCRequest($tc_params); | |
192 | $result = $this->_getTCReply($reply); | |
193 | ||
194 | if($result === 0) { | |
195 | $message = 'Successfully updated TC billing id ' . $tc_params['billingid']; | |
196 | ||
197 | return TRUE; | |
198 | } else { | |
199 | return FALSE; | |
200 | } | |
201 | } | |
202 | ||
203 | // TODO: Use the formatting functions throughout the entire class to | |
204 | // dedupe the conversions done elsewhere in a less reusable way. | |
205 | function _formatAmount($amount) { | |
206 | return $amount * 100; | |
207 | } | |
208 | ||
209 | function _formatBillingName($firstName, $lastName) { | |
210 | return "$firstName $lastName"; | |
211 | } | |
212 | ||
213 | function _formatExpirationDate($year, $month) { | |
214 | $exp_month = str_pad($month, 2, '0', STR_PAD_LEFT); | |
215 | $exp_year = substr($year, -2); | |
216 | ||
217 | return "$exp_month$exp_year"; | |
218 | } | |
219 | ||
4d58ae2f | 220 | function _isBlacklisted() { |
d5e500b0 LMM |
221 | if($this->_isIPBlacklisted()) { |
222 | return TRUE; | |
223 | } else if($this->_IsAgentBlacklisted()) { | |
224 | return TRUE; | |
225 | } | |
226 | return FALSE; | |
4d58ae2f LMM |
227 | } |
228 | ||
229 | function _isAgentBlacklisted() { | |
230 | $ip = $_SERVER['REMOTE_ADDR']; | |
231 | $agent = $_SERVER['HTTP_USER_AGENT']; | |
232 | $dao = CRM_Core_DAO::executeQuery('SELECT * FROM `trustcommerce_useragent_blacklist`'); | |
233 | while($dao->fetch()) { | |
234 | if(preg_match('/'.$dao->name.'/', $agent) === 1) { | |
d5e500b0 LMM |
235 | error_log(' [client '.$ip.'] [agent '.$agent.'] - Blacklisted by USER_AGENT rule #'.$dao->id); |
236 | return TRUE; | |
4d58ae2f LMM |
237 | } |
238 | } | |
239 | return FALSE; | |
240 | } | |
241 | ||
242 | function _isIPBlacklisted() { | |
243 | $ip = $_SERVER['REMOTE_ADDR']; | |
c389ccec | 244 | $agent = $_SERVER['HTTP_USER_AGENT']; |
4d58ae2f LMM |
245 | $ip = ip2long($ip); |
246 | $blacklist = array(); | |
247 | $dao = CRM_Core_DAO::executeQuery('SELECT * FROM `trustcommerce_blacklist`'); | |
248 | while($dao->fetch()) { | |
249 | if($ip >= $dao->start && $ip <= $dao->end) { | |
d5e500b0 LMM |
250 | error_log('[client '.long2ip($ip).'] [agent '.$agent.'] Blacklisted by IP rule #'.$dao->id); |
251 | return TRUE; | |
4d58ae2f LMM |
252 | } |
253 | } | |
254 | return FALSE; | |
255 | } | |
256 | ||
e055e8ef LMM |
257 | function _sendTCRequest($request) { |
258 | $this->_logger($request); | |
259 | return tclink_send($request); | |
260 | } | |
261 | ||
262 | function _logger($params) { | |
e990a9a5 | 263 | $msg = ''; |
69a1e975 | 264 | foreach ($params as $key => $data) { |
e055e8ef LMM |
265 | /* Delete any data we should not be writing to disk. This includes: |
266 | * custid, password, cc, exp, and cvv | |
267 | */ | |
e055e8ef | 268 | switch($key) { |
e990a9a5 LMM |
269 | case 'custid': |
270 | case 'password': | |
271 | case 'cc': | |
272 | case 'exp': | |
273 | case 'cvv': | |
e055e8ef LMM |
274 | break; |
275 | default: | |
e990a9a5 | 276 | $msg .= ' '.$key.' => '.$data; |
e055e8ef LMM |
277 | } |
278 | } | |
4d58ae2f | 279 | error_log('[client '.$_SERVER['REMOTE_ADDR'].'] TrustCommerce:'.$msg); |
e055e8ef LMM |
280 | } |
281 | ||
71a6ba5c | 282 | /** |
f322addf LMM |
283 | * Gets the recurring billing fields for the TC API |
284 | * @param array $fields The fields to modify. | |
285 | * @return array The fields for tclink_send(), modified for recurring billing. | |
71a6ba5c LMM |
286 | * @public |
287 | */ | |
f322addf | 288 | function _getRecurPaymentFields($fields) { |
285eaf25 LMM |
289 | $payments = $this->_getParam('frequency_interval'); |
290 | $cycle = $this->_getParam('frequency_unit'); | |
71a6ba5c | 291 | |
f322addf | 292 | /* Translate billing cycle from CiviCRM -> TC */ |
285eaf25 LMM |
293 | switch($cycle) { |
294 | case 'day': | |
295 | $cycle = 'd'; | |
296 | break; | |
297 | case 'week': | |
298 | $cycle = 'w'; | |
299 | break; | |
300 | case 'month': | |
301 | $cycle = 'm'; | |
302 | break; | |
303 | case 'year': | |
304 | $cycle = 'y'; | |
305 | break; | |
71a6ba5c | 306 | } |
bc323ec4 LMM |
307 | |
308 | /* Translate frequency interval from CiviCRM -> TC | |
309 | * Payments are the same, HOWEVER a payment of 1 (forever) should be 0 in TC */ | |
310 | if($payments == 1) { | |
311 | $payments = 0; | |
71a6ba5c | 312 | } |
71a6ba5c | 313 | |
bc323ec4 LMM |
314 | $fields['cycle'] = '1'.$cycle; /* The billing cycle in years, months, weeks, or days. */ |
315 | $fields['payments'] = $payments; | |
06f2e425 | 316 | $fields['authnow'] = 'y'; |
d8448c78 | 317 | $fields['start'] = date("Y-m-d"); /* Start date is required when 'authnow' is used. */ |
bc323ec4 | 318 | $fields['action'] = 'store'; /* Change our mode to `store' mode. */ |
71a6ba5c | 319 | |
bc323ec4 | 320 | return $fields; |
a79ba043 LMM |
321 | } |
322 | ||
323 | /* Parses a response from TC via the tclink_send() command. | |
324 | * @param $reply array The result of a call to tclink_send(). | |
325 | * @return mixed self::error() if transaction failed, otherwise returns 0. | |
326 | */ | |
5efae07f | 327 | function _getTCReply($reply) { |
71a6ba5c | 328 | |
285eaf25 | 329 | /* DUPLIATE CODE, please refactor. ~lisa */ |
bc323ec4 | 330 | if (!$reply) { |
285eaf25 | 331 | return self::error(9002, 'Could not initiate connection to payment gateway'); |
71a6ba5c LMM |
332 | } |
333 | ||
4d58ae2f LMM |
334 | $this->_logger($reply); |
335 | ||
bc323ec4 | 336 | switch($reply['status']) { |
4d58ae2f LMM |
337 | case self::AUTH_BLACKLIST: |
338 | return self::error(9001, "Your transaction was declined: error #90210"); | |
339 | break; | |
285eaf25 LMM |
340 | case self::AUTH_APPROVED: |
341 | // It's all good | |
342 | break; | |
343 | case self::AUTH_DECLINED: | |
344 | // TODO FIXME be more or less specific? | |
345 | // declinetype can be: decline, avs, cvv, call, expiredcard, carderror, authexpired, fraud, blacklist, velocity | |
346 | // See TC documentation for more info | |
da1932b6 LMM |
347 | switch($reply['declinetype']) { |
348 | case 'avs': | |
78390e15 | 349 | return self::error(9009, "Your transaction was declined for address verification reasons. If your address was correct please contact us at donate@fsf.org before attempting to retry your transaction."); |
da1932b6 LMM |
350 | break; |
351 | } | |
a8c5366f | 352 | return self::error(9009, "Your transaction was declined: {$reply['declinetype']}"); |
285eaf25 LMM |
353 | break; |
354 | case self::AUTH_BADDATA: | |
a8c5366f LMM |
355 | // TODO FIXME do something with $reply['error'] and $reply['offender'] |
356 | return self::error(9011, "Invalid credit card information. The following fields were invalid: {$reply['offenders']}."); | |
285eaf25 LMM |
357 | break; |
358 | case self::AUTH_ERROR: | |
359 | return self::error(9002, 'Could not initiate connection to payment gateway'); | |
360 | break; | |
71a6ba5c | 361 | } |
a79ba043 | 362 | return 0; |
71a6ba5c LMM |
363 | } |
364 | ||
365 | function _getTrustCommerceFields() { | |
366 | // Total amount is from the form contribution field | |
367 | $amount = $this->_getParam('total_amount'); | |
368 | // CRM-9894 would this ever be the case?? | |
369 | if (empty($amount)) { | |
370 | $amount = $this->_getParam('amount'); | |
371 | } | |
372 | $fields = array(); | |
373 | $fields['custid'] = $this->_getParam('user_name'); | |
374 | $fields['password'] = $this->_getParam('password'); | |
375 | $fields['action'] = 'sale'; | |
376 | ||
377 | // Enable address verification | |
378 | $fields['avs'] = 'y'; | |
379 | ||
380 | $fields['address1'] = $this->_getParam('street_address'); | |
381 | $fields['zip'] = $this->_getParam('postal_code'); | |
382 | ||
383 | $fields['name'] = $this->_getParam('billing_first_name') . ' ' . $this->_getParam('billing_last_name'); | |
384 | ||
385 | // This assumes currencies where the . is used as the decimal point, like USD | |
386 | $amount = preg_replace("/([^0-9\\.])/i", "", $amount); | |
387 | ||
388 | // We need to pass the amount to TrustCommerce in dollar cents | |
389 | $fields['amount'] = $amount * 100; | |
390 | ||
391 | // Unique identifier | |
392 | $fields['ticket'] = substr($this->_getParam('invoiceID'), 0, 20); | |
393 | ||
394 | // cc info | |
395 | $fields['cc'] = $this->_getParam('credit_card_number'); | |
396 | $fields['cvv'] = $this->_getParam('cvv2'); | |
397 | $exp_month = str_pad($this->_getParam('month'), 2, '0', STR_PAD_LEFT); | |
398 | $exp_year = substr($this->_getParam('year'),-2); | |
399 | $fields['exp'] = "$exp_month$exp_year"; | |
400 | ||
401 | if ($this->_mode != 'live') { | |
402 | $fields['demo'] = 'y'; | |
403 | } | |
71a6ba5c LMM |
404 | return $fields; |
405 | } | |
406 | ||
407 | /** | |
408 | * Checks to see if invoice_id already exists in db | |
409 | * | |
410 | * @param int $invoiceId The ID to check | |
411 | * | |
412 | * @return bool True if ID exists, else false | |
413 | */ | |
414 | function _checkDupe($invoiceId) { | |
415 | require_once 'CRM/Contribute/DAO/Contribution.php'; | |
416 | $contribution = new CRM_Contribute_DAO_Contribution(); | |
417 | $contribution->invoice_id = $invoiceId; | |
418 | return $contribution->find(); | |
419 | } | |
420 | ||
421 | /** | |
422 | * Get the value of a field if set | |
423 | * | |
424 | * @param string $field the field | |
425 | * | |
426 | * @return mixed value of the field, or empty string if the field is | |
427 | * not set | |
428 | */ | |
429 | function _getParam($field) { | |
430 | return CRM_Utils_Array::value($field, $this->_params, ''); | |
431 | } | |
432 | ||
433 | function &error($errorCode = NULL, $errorMessage = NULL) { | |
434 | $e = CRM_Core_Error::singleton(); | |
435 | if ($errorCode) { | |
436 | $e->push($errorCode, 0, NULL, $errorMessage); | |
437 | } | |
438 | else { | |
439 | $e->push(9001, 0, NULL, 'Unknown System Error.'); | |
440 | } | |
441 | return $e; | |
442 | } | |
443 | ||
444 | /** | |
445 | * Set a field to the specified value. Value must be a scalar (int, | |
446 | * float, string, or boolean) | |
447 | * | |
448 | * @param string $field | |
449 | * @param mixed $value | |
450 | * | |
451 | * @return bool false if value is not a scalar, true if successful | |
452 | */ | |
453 | function _setParam($field, $value) { | |
454 | if (!is_scalar($value)) { | |
455 | return FALSE; | |
456 | } | |
457 | else { | |
458 | $this->_params[$field] = $value; | |
459 | } | |
460 | } | |
461 | ||
462 | /** | |
463 | * This function checks to see if we have the right config values | |
464 | * | |
465 | * @return string the error message if any | |
466 | * @public | |
467 | */ | |
468 | function checkConfig() { | |
469 | $error = array(); | |
470 | if (empty($this->_paymentProcessor['user_name'])) { | |
471 | $error[] = ts('Customer ID is not set for this payment processor'); | |
472 | } | |
473 | ||
474 | if (empty($this->_paymentProcessor['password'])) { | |
475 | $error[] = ts('Password is not set for this payment processor'); | |
476 | } | |
477 | ||
478 | if (!empty($error)) { | |
479 | return implode('<p>', $error); | |
480 | } else { | |
481 | return NULL; | |
482 | } | |
483 | } | |
484 | ||
14f15ff3 | 485 | function cancelSubscription(&$message = '', $params = array()) { |
7964e0e9 LMM |
486 | $tc_params['custid'] = $this->_getParam('user_name'); |
487 | $tc_params['password'] = $this->_getParam('password'); | |
488 | $tc_params['action'] = 'unstore'; | |
cbf5200e | 489 | $tc_params['billingid'] = CRM_Utils_Array::value('trxn_id', $params); |
e055e8ef | 490 | |
e990a9a5 | 491 | $result = $this->_sendTCRequest($tc_params); |
71a6ba5c | 492 | |
7964e0e9 LMM |
493 | /* Test if call failed */ |
494 | if(!$result) { | |
71a6ba5c LMM |
495 | return self::error(9002, 'Could not initiate connection to payment gateway'); |
496 | } | |
7964e0e9 | 497 | /* We are done, pass success */ |
71a6ba5c LMM |
498 | return TRUE; |
499 | } | |
2ff31643 DT |
500 | |
501 | function changeSubscriptionAmount(&$message = '', $params = array()) { | |
502 | $tc_params['custid'] = $this->_getParam('user_name'); | |
503 | $tc_params['password'] = $this->_getParam('password'); | |
504 | $tc_params['action'] = 'store'; | |
505 | ||
506 | $tc_params['billingid'] = CRM_Utils_Array::value('subscriptionId', $params); | |
507 | $tc_params['payments'] = CRM_Utils_Array::value('installments', $params); | |
508 | $tc_params['amount'] = CRM_Utils_Array::value('amount', $params) * 100; | |
509 | ||
510 | if($tc_params['payments'] == 1) { | |
511 | $tc_params['payments'] = 0; | |
512 | } | |
513 | $reply = $this->_sendTCRequest($tc_params); | |
514 | $result = $this->_getTCReply($reply); | |
515 | ||
516 | /* Test if call failed */ | |
517 | if(!$result) { | |
518 | return self::error(9002, 'Could not initiate connection to payment gateway'); | |
519 | } | |
520 | ||
521 | /* We are done, pass success */ | |
522 | return TRUE; | |
523 | ||
524 | } | |
525 | ||
71a6ba5c LMM |
526 | public function install() { |
527 | return TRUE; | |
528 | } | |
529 | ||
530 | public function uninstall() { | |
531 | return TRUE; | |
532 | } | |
533 | ||
534 | } |