<?php
/**
 * Transfer Credits
 * https://webenginecms.org/
 * 
 * @version 1.4.0
 * @author Lautaro Angelico <http://lautaroangelico.com/>
 * @copyright (c) 2013-2025 Lautaro Angelico, All Rights Reserved
 * @build w641ba01901cb0925ec50f543e59acbd
 */

if(!isLoggedIn()) redirect(1,'login');

echo '<div class="page-title"><span>'.lang('transfercredits_title',true).'</span></div>';

try {
	
	if(isset($_GET['success'])) {
		
		message('success', lang('transfercredits_success_2',true));
		
	} else {
	
		if(!isset($_GET['id'])) redirect();
		if(!isset($_GET['key'])) redirect();
		
		$TransferCredits = new \Plugin\TransferCredits\TransferCredits();
		$TransferCredits->setUser($_SESSION['username']);
		$TransferCredits->setTransferId($_GET['id']);
		$TransferCredits->setTransferKey($_GET['key']);
		$TransferCredits->verifyTransfer();
	
	}
	
} catch(Exception $ex) {
	message('error', $ex->getMessage());
}