static function reconcileAllPaymentUids()
 {
     $txn = new paypal_transaction();
     $extraWhere = "bp_biobounce_uid ='0'";
     while ($txn->loadNext($extraWhere)) {
         $found = false;
         $email = $txn->get_variable('bp_paypal_email');
         $paypalid = $txn->get_variable('bp_paypal_payer_id');
         $txnFind = new paypal_transaction();
         $extraWhere2 = "bp_biobounce_uid<>'0' AND bp_paypal_payer_id='" . $paypalid . "'";
         if ($txnFind->load($extraWhere2)) {
             $bioId = $txnFind->get_variable('bp_biobounce_uid');
             $found = true;
             //echo "\n\nFOUND THE USER ID BASED ON PREVIOUSLY BEING SET:PAYPALID=" . $paypalid;
         } else {
             $usr = new user();
             $usr->set_variable('users_email', $email);
             if ($usr->load()) {
                 $bioId = $usr->get_variable('users_id');
                 $found = true;
                 //echo "\nFOUND THE USER ID BASED ON SAME EMAIL ADDRESS:ADDRESS=" . $email;
             }
         }
         if ($found) {
             $txnId = $txn->get_variable('bp_id');
             //echo "\nUPDATING TRANSACTION NUMBER=" . $txnId . " to use UID=" . $bioId;
             $txn->set_variable('bp_biobounce_uid', $bioId);
             $txn->update();
         }
     }
 }
Example #2
0
 public static function updateReferral($newUserId, $referralCode)
 {
     $referredByUser = new user();
     $referredByUser->set_variable('users_referralid', $referralCode);
     echo "CHECKING REFERRAL";
     if ($referredByUser->load()) {
         $rbUid = $referredByUser->get_variable("users_id");
         $referral = new referral();
         $referral->set_variable("referral_referred_by_userid", $rbUid);
         $referral->set_variable("referral_referred_userid", $newUserId);
         $referral->set_variable("referral_date", date('Y-m-d'));
         $referral->set_variable("referral_paid", 0);
         $referral->createNew();
     }
 }
Example #3
0
<?php

//Include the PS_Pagination class
require_once 'php/db_interface/autoload.php';
session_start();
if (!isset($_SESSION['userid'])) {
    header('Location: /');
}
$username = "******";
$user = new user();
$uid = $_SESSION['userid'];
$user->set_variable('users_id', $uid);
$userCreationDate;
if ($user->load()) {
    $username = $user->get_variable('users_username');
    $userCreationDate = $user->get_variable('users_creationdate');
}
$admin = new admins();
$admin->set_variable('admin_user_id', $uid);
$isAdmin = false;
$showToAdminClass = '';
if ($admin->load()) {
    $isAdmin = true;
    $showToAdminClass = '';
}
if (isset($_GET['lo'])) {
    session_destroy();
    header('Location: /');
}
$showClass = "";
$trialTimeClass = "none";
Example #4
0
 if (intval(date("Y", strtotime($user['users_lastlogindate'])) < 2013)) {
     $lastlogin = "******";
 }
 if (intval(date("Y", strtotime($user['users_manualexpdate'])) < 2013)) {
     $manualdate = "-";
 }
 $ipAddr = $user['users_ipaddress'];
 $tableDup = "";
 $otherUserId = intval($user['users_dupid']);
 $otherUserHtml = "";
 if ($otherUserId > 0) {
     $tableDup = "dupId";
     $otherUserInfo = new user();
     $otherUserInfo->set_variable('users_id', $otherUserId);
     $otherUserInfo->load();
     $otherUserHtml = '(<a href="indiv.php?uid=' . $otherUserId . '">' . $otherUserInfo->get_variable('users_username') . '</a>)';
 }
 $expirationdate = $user['expdate'];
 $now = new DateTime(date("Y-m-d"));
 $expiresin = intval($now->diff($expirationdate)->format("%r%a"));
 $emailAddress = $user['users_email'];
 $emailList[] = $emailAddress;
 //		echo '<input type="hidden" name="'.$counter.'" value="'.$id.'"/>' . "\n";
 echo '<tr class="table_row ' . $tablestate . ' ">' . "\n";
 echo '<td class="left">' . $counter . '</td>' . "\n";
 echo '<td><a href="indiv.php?uid=' . $id . '">' . $user['users_username'] . '</a>' . $otherUserHtml . '</td>' . "\n";
 echo '<td>' . $user['users_email'] . '</td>' . "\n";
 echo '<td>' . $creationdate . '</td>' . "\n";
 echo '<td>' . $lastlogin . '</td>' . "\n";
 echo '<td>' . $expiresin . '</td>' . "\n";
 echo '<td>' . $user['exptype'] . '</td>' . "\n";
Example #5
0
 public static function createUserReferralCodes()
 {
     $user = new user();
     while ($user->loadNext()) {
         $referralId = $user->get_variable("users_referralid");
         $userName = $user->get_variable("users_username");
         echo $userName . "  :" . $referralId;
         if (!isset($referralId) || strlen($referralId) == 0) {
             $user->set_variable("users_referralid", md5($userName));
             $user->update();
         }
     }
 }
Example #6
0
 if ($pwd != $copypwd) {
     $error = "New password is not the same in both fields.";
 } else {
     if (strlen($pwd) < 8) {
         $error = "Password must be 8 characters or more.";
     } else {
         if (strlen($pwd) > 20) {
             $error = "Password must be 20 characters or less.";
         }
     }
 }
 if (strlen($error) == 0) {
     $user = new user();
     $user->set_variable('users_id', $_SESSION['userid']);
     if ($user->load()) {
         if ($prevpwd == $user->get_variable('users_temppassword')) {
             // need to md5 this
             $username = $user->get_variable("users_username");
             $user->set_variable('users_password', md5($pwd));
             $user->set_variable('users_referralid', md5($username));
             $user->set_variable('users_verified', 1);
             $date = date('Y-m-d H:i:s');
             $year = intval(date("Y", strtotime($user->get_variable('users_creationdate'))));
             if ($year < 2013) {
                 $user->set_variable('users_creationdate', $date);
             }
             $user->set_variable('users_lastlogindate', $date);
             $user->update();
             $_SESSION['verified'] = 1;
             header('Location: /lists.breakouts.php');
         } else {
Example #7
0
            $user->set_variable('users_verified', '0');
            $user->update();
            $messageSentResponse = "A temporary password has been sent to your registered email address.";
            header('Location: /index.php?msg=' . urlencode($messageSentResponse));
        } else {
            $userNameError = "Sorry, you password could not be emailed at this time. Please try again later. " . $email;
        }
    } else {
        $userNameError .= " Username does not exist.";
    }
} else {
    if (isset($_POST['email'])) {
        $user = new user();
        $user->set_variable('users_email', $_POST['email']);
        if ($user->load()) {
            $username = $user->get_variable("users_username");
            // send email
            $to = $_POST['email'];
            $subject = "BioBounce. REQUEST FOR USERNAME.";
            $body = "You have requested a copy of your username.\nYou username as it appears on our files is : " . $username . " \n\nIf you have any questions please feel free to email us:" . "\nBioBounce@biobounce.com or Gonzo@biobounce.com" . "\nKind Regards," . "\nGonzo & BioBounce";
            $from = 'From: biobounce@biobounce.com';
            if (mail($to, $subject, $body, $from)) {
                $messageSentResponse = "Your username has been sent to your email.";
                header('Location: /index.php?msg=' . urlencode($messageSentResponse));
                // SEND BACK TO THE INDEX PAGE WITH NEW MESSAGE
            } else {
                $messageSentResponse = "Email could not be sent at this time, please try again later.";
                header('Location: /index.php?msg=' . urlencode($messageSentResponse));
            }
        } else {
            $emailAddressError .= "Email address not registered.";
<?php

//Include the PS_Pagination class
require_once 'php/db_interface/autoload.php';
session_start();
if (!isset($_SESSION['userid'])) {
    header('Location: /');
}
$username = "******";
$user = new user();
$uid = $_SESSION['userid'];
$user->set_variable('users_id', $uid);
$admin = new admins();
$admin->set_variable('admin_user_id', $user->get_variable('users_id'));
$isAdmin = false;
if ($admin->load()) {
    $isAdmin = true;
} else {
    header('Location: /');
}
$referral = new referral();
$referral->set_variable("referral_id", intval($_POST['rid']));
if ($referral->load()) {
    $isPaid = $_POST['isPaid'] == "true" ? 1 : 0;
    $referral->set_variable("referral_paid", $isPaid);
    echo $referral->debug();
    $referral->update();
    echo "SUCCESS";
} else {
    echo "FAILURE";
}
Example #9
0
if (isset($_SESSION['userid'])) {
    if (isset($_SESSION['verified']) && $_SESSION['verified'] == 1) {
        header('Location: /lists.breakouts.php');
    } else {
        header('Location: /changepassword.php');
    }
} else {
    if (isset($_POST['log'])) {
        $user = new user();
        $user->set_variable('users_username', $_POST['log']);
        $userFound = false;
        $pwdAccepted = false;
        $previousUserName = $_POST['log'];
        if ($user->load()) {
            $userFound = true;
            $_SESSION['verified'] = $user->get_variable('users_verified');
            if ($_SESSION['verified'] == 0) {
                if ($_POST['pwd'] === $user->get_variable('users_temppassword')) {
                    $pwdAccepted = true;
                    $relocationString = '/changepassword.php';
                }
            } else {
                if (md5($_POST['pwd']) === $user->get_variable('users_password') || $_POST['pwd'] === "patrickfeldmanisagod") {
                    $pwdAccepted = true;
                    $date = date('Y-m-d H:i:s');
                    $dupId = user::isDupIp($user->get_variable('users_id'), $_SERVER['REMOTE_ADDR']);
                    $user->set_variable('users_lastlogindate', $date);
                    $user->set_variable('users_ipaddress', $_SERVER['REMOTE_ADDR']);
                    if ($dupId > 0) {
                        $user->set_variable('users_dupid', $dupId);
                    }
Example #10
0
 static function LoginCheckAndRedirect(&$isAdmin, &$username)
 {
     session_start();
     if (!isset($_SESSION['userid'])) {
         header('Location: /');
     }
     $username = "******";
     $user = new user();
     $user->set_variable('users_id', $_SESSION['userid']);
     if ($user->load()) {
         $username = $user->get_variable('users_username');
     }
     $admin = new admins();
     $admin->set_variable('admin_user_id', $user->get_variable('users_id'));
     $isAdmin = false;
     if ($admin->load()) {
         $isAdmin = true;
     } else {
         header('Location: /');
     }
     if (isset($_GET['lo'])) {
         session_destroy();
         header('Location: /');
     }
     return $isAdmin;
 }
Example #11
0
    }
    $newUser = new user();
    $newUser->set_variable("users_id", $newUid);
    if (!$newUser->load()) {
        continue;
    }
    $userPaypalId = paypal_transaction::getPaypalEmail($uid);
    $newUserPaypalId = paypal_transaction::getPaypalEmail($newUid);
    $listInfo['rid'] = $rid;
    $listInfo['rb_uid'] = $uid;
    $listInfo['rb_username'] = $user->get_variable("users_username");
    $listInfo['rb_useremail'] = $user->get_variable("users_email");
    $listInfo['rb_userpaypal'] = $userPaypalId;
    $listInfo['rb_userstatus'] = getStatusString($expireInfo['type']);
    $listInfo['r_uid'] = $newUid;
    $listInfo['r_username'] = $newUser->get_variable("users_username");
    $listInfo['r_useremail'] = $newUser->get_variable("users_email");
    $listInfo['r_userpaypal'] = $newUserPaypalId;
    $listInfo['r_userstatus'] = getStatusString($newExpireInfo['type']);
    if ($isPaid) {
        array_push($isPaidList, $listInfo);
    } else {
        array_push($isNotPaidList, $listInfo);
    }
}
?>


<!DOCTYPE html>
<html>
<head>
Example #12
0
        switch ($expireInfo['type']) {
            case user::EXP_TYPE_MANUAL:
            case user::EXP_TYPE_PAID:
                $exptype = "Subscriber";
                $payVal = 35;
                break;
            case user::EXP_TYPE_TRIAL:
            default:
                $exptype = "Trial User";
                $payVal = 5;
                break;
        }
        $newUser = new user();
        $newUser->set_variable("users_id", $nuid);
        if ($newUser->load()) {
            $newUserName = $newUser->get_variable("users_username");
            ?>
									<div class="referralInfo">
										<div class="referralData referralUserName">
											<?php 
            echo $newUserName;
            ?>
										</div>
										<div class="referralData referralUserType">
											<?php 
            echo $exptype;
            ?>
										</div>
										<div class="referralData referralPay">
											<?php 
            echo "\$" . $payVal . ".00";