예제 #1
0
<?php

require_once "inc/config.php";
require_once "inc/security.php";
require_once "inc/validator.php";
require_once "inc/RedditConnector.php";
require_once "inc/RewardManager.php";
require_once "inc/Debug.php";
$referrer = "reddit";
$connector = new RedditConnector();
// Results: valid, alreadyclaimed, sessionerror, error
$result = "STATE_ERROR";
// Temp storage for debug args
$debugtmp = "";
// Session and state valid?
if ($connector->validateSession()) {
    // Authentication successful?
    if ($connector->authenticate()) {
        $user = $connector->getUserDetails();
        // Request successful and user exists?
        if ($user) {
            $username = $user["name"];
            $identifier = $user["id"];
            $commentkarma = $user["comment_karma"];
            $linkkarma = $user["link_karma"];
            // Debug info
            $debugtmp .= ", NAME: " . $username . ", ID: " . $identifier . ", COMMENT KARMA: " . $commentkarma . ", LINK KARMA: " . $linkkarma;
            // Is user qualified for a reward?
            if ($checkQualification == false || isQualifiedReddit($user)) {
                // Check, if Cookie check is enabled
                if ($checkCookie == false || cookieExists() == false) {
예제 #2
0
<?php

include "header.php";
?>

<!-- Reddit intro -->

<?php 
require_once "inc/config.php";
require_once "inc/security.php";
require_once "inc/balance.php";
require_once "inc/RedditConnector.php";
$uid = generateUid();
registerUid($uid);
$connector = new RedditConnector();
$url = $connector->getAuthUrl($uid);
?>

  <h3>Great, you chose Reddit as authentication method!</h3>
  <br />
  
  <div class="description">
    <p>Receive <strong><?php 
echo getAmountLabelLong("reddit");
?>
</strong> as reward.</p>
    
    <p>To <strong>redeem</strong> this reward, you need a Reddit account with more than <strong>100 karma</strong>. 
    Make also sure you check out <a href="http://www.reddit.com/r/mastercoin" target="_blank" 
    title="Mastercoin on Reddit"><strong>/r/mastercoin</strong></a>.</p>