<commit_before><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

// @param numeric $id: id of the payment
// @params url $returnurl: optional return url
function smarty_function_payment( $params, $smarty ) {
	global $tikilib, $prefs;
	global $paymentlib; require_once 'lib/payment/paymentlib.php';
	$invoice = (int) $params['id'];

	$objectperms = Perms::get( 'payment', $invoice );
	$info = $paymentlib->get_payment( $invoice );
	$smarty->assign('ccresult_ok', false);
	
	// Unpaid payments can be seen by anyone as long as they know the number
	// Just like your bank account, anyone can drop money in it.
	if( $info && $info['state'] == 'outstanding' || $info['state'] == 'overdue' || $objectperms->payment_view ) {
		if ($prefs['payment_system'] == 'cclite' && isset($_POST['cclite_payment_amount']) && $_POST['cclite_payment_amount'] == $info['amount_remaining']) {
			global $access, $cclitelib, $cartlib;
			require_once 'lib/payment/cclitelib.php';
			require_once 'lib/payment/cartlib.php';
			
			//$access->check_authenticity( tr('Transfer currency? %0 %1?', $info['amount'], $info['currency'] ));
			
			$result = $cclitelib->pay_invoice($invoice, $info['amount'], $info['currency']);
			if (!empty($result)) {
				$smarty->assign('ccresult', $result);
				$smarty->assign('ccresult_ok', (strpos($result, 'Transaction Accepted') !== false));
				$cartlib->empty_cart();
			} else {
				$smarty->assign('ccresult', tr('Payment sent but verification not currently available. (Work in progress)'));<commit_msg>[FIX]payment: let also the creator of the payment to see hos payment<commit_after><?php
// (c) Copyright 2002-2010 by authors of the Tiki Wiki/CMS/Groupware Project
// 
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

// @param numeric $id: id of the payment
// @params url $returnurl: optional return url
function smarty_function_payment( $params, $smarty ) {
	global $tikilib, $prefs, $userlib, $user;
	global $paymentlib; require_once 'lib/payment/paymentlib.php';
	$invoice = (int) $params['id'];

	$objectperms = Perms::get( 'payment', $invoice );
	$info = $paymentlib->get_payment( $invoice );
	$smarty->assign('ccresult_ok', false);
	
	// Unpaid payments can be seen by anyone as long as they know the number
	// Just like your bank account, anyone can drop money in it.
	if( $info && $info['state'] == 'outstanding' || $info['state'] == 'overdue' || $objectperms->payment_view || $info['userId'] == $userlib->get_user_id($user) ) {
		if ($prefs['payment_system'] == 'cclite' && isset($_POST['cclite_payment_amount']) && $_POST['cclite_payment_amount'] == $info['amount_remaining']) {
			global $access, $cclitelib, $cartlib;
			require_once 'lib/payment/cclitelib.php';
			require_once 'lib/payment/cartlib.php';
			
			//$access->check_authenticity( tr('Transfer currency? %0 %1?', $info['amount'], $info['currency'] ));
			
			$result = $cclitelib->pay_invoice($invoice, $info['amount'], $info['currency']);
			if (!empty($result)) {
				$smarty->assign('ccresult', $result);
				$smarty->assign('ccresult_ok', (strpos($result, 'Transaction Accepted') !== false));
				$cartlib->empty_cart();
			} else {
				$smarty->assign('ccresult', tr('Payment sent but verification not currently available. (Work in progress)'));
{'fraction_non_alphanumeric': 0.1701417848206839, 'fraction_numerical': 0.005560189046427579, 'mean_word_length': 4.908045977011494, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4608986', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1140, 'n_words': 318}