Пример #1
0
    standard button). The fields PayPal recommends checking are:
    1. Check the $_POST['payment_status'] is "Completed"
    2. Check that $_POST['txn_id'] has not been previously processed
    3. Check that $_POST['receiver_email'] is your Primary PayPal email
    4. Check that $_POST['payment_amount'] and $_POST['payment_currency']
    are correct
    Since implementations on this varies, I will leave these checks out of this
    example and just send an email using the getTextReport() method to get all
    of the details about the IPN.
    */
    mail($mail, 'Verified IPN', $listener->getTextReport());
    JLog::add("Verified IPN. UserId=" . $user->id . "  Username="******"   Remote IP=" . JTrinityCoreUtilities::getRemoteIP() . "  Report=" . $listener->getTextReport(), JLog::INFO, 'ipn.php');
    JLog::add("Verified IPN. Payment amount=" . JRequest::getVar('payment_amount') . "  Receiver mail=" . JRequest::getVar('receiver_email') . " Payment status=" . JRequest::getVar('payment_status'), 'ipn.php');
    // Check if succesfull to add the points to the user
    if (JRequest::getVar('payment_status') == 'Completed' && !transactionExist(JRequest::getVar('txn_id'))) {
        // Add transaction ID to the database with status COMPLETED
        // Add points to the user
        // Message OK to the user
    } else {
        // Add transaction id to the database with status NO completed
        // Message failed to the user
    }
} else {
    /*
    An Invalid IPN *may* be caused by a fraudulent transaction attempt. It's
    a good idea to have a developer or sys admin manually investigate any
    invalid IPN.
    */
    mail($mail, 'Invalid IPN', $listener->getTextReport());
    JLog::add("Invalid IPN. UserId=" . $user->id . "  Username="******"   Remote IP=" . JTrinityCoreUtilities::getRemoteIP() . "  Report=" . $listener->getTextReport(), JLog::CRITICAL, 'ipn.php');
}
Пример #2
0
<?php

// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JTrinityCoreUtilities::CheckUserLogged();
// Get user name
$user = JFactory::getUser();
$user_name = $user->name;
$user_username = $user->username;
$acc = JTrinityCoreDBHelper::getAccountData($user_username);
if (!$acc) {
    return false;
}
$remote_IP = JTrinityCoreUtilities::getRemoteIP();
$last_login = $acc->last_login;
$last_ip = $acc->last_ip;
$banned = $acc->locked;
$expansion_string = JTrinityCoreDBHelper::getExpansionString($acc->expansion);
$images = "media/com_jtrinitycore/images/";
//$style="media/com_jtrinitycore/styles/style.css";
// <link href="" rel="stylesheet" type="text/css" />
?>
<h1 class="contentheading"><?php 
echo JText::_('COM_JTRINITYCORE_CUSER_CONTROL_PANEL');
?>
</h1>
<?php 
JTrinityCoreUtilities::ShowUserPoints(false);
// Donation shop banner
/*echo '<div style="float: right;">