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(); } } }
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(); } }
<?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";
$creationdate = "-"; } 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";
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(); } } }
function newNodeRevisionExecute() { if (fv('nodeDataUploadFlag')) { // echo 'Adding data…'; $tablenamenewdata = "data"; $next_incrementdata = 0; $qShowStatusdata = "SHOW TABLE STATUS LIKE '{$tablenamenewdata}'"; $qShowStatusResultdata = mysql_query($qShowStatusdata) or die("Query failed: " . mysql_error() . "<br/>" . $qShowStatusdata); $rowdata = mysql_fetch_assoc($qShowStatusResultdata); $next_incrementdata = $rowdata['Auto_increment']; mysql_query('INSERT INTO `data` (`data_id`, `data_current_revision`) VALUES (NULL, \'' . $next_incrementdata . '\');'); $addedDataId = mysql_insert_id(); // echo 'data number ' . $addedDataId . 'and data revision number '; $fileTempName = $_FILES['uploadeddata']['tmp_name']; mysql_query('INSERT INTO `data_revision` (`data_revision_id`, `data_revision_name`, `data_revision_length`, `data_revision_type`, `data_revision_node_id`, `data_revision_md5`, `data_revision_data_id`, `data_revision_node_edit_id`) VALUES (NULL, \'' . $HTTP_POST_FILES['uploadeddata']['name'] . '\', \'' . $HTTP_POST_FILES['uploadeddata']['size'] . '\', \'' . fv('dataType') . '\', \'nodeid\', \'' . md5_file($fileTempName) . '\', \'' . $addedDataId . '\', \'not yet known\');'); $targetULDirectory = 'weave/data/' . str_replace(0, '0/', str_replace(1, '1/', str_replace(2, '2/', str_replace(3, '3/', str_replace(4, '4/', str_replace(5, '5/', str_replace(6, '6/', str_replace(7, '7/', str_replace(8, '8/', str_replace(9, '9/', mysql_insert_id())))))))))); mkdir($targetULDirectory, 0700, true); /* $ck = mysql_insert_id(); $subdirs = array(); for ($i = 0;$i < strlen($ck);$i++) $subdirs[] = $ck[$i]; */ $addedDataRevisionId = mysql_insert_id(); // echo $addedDataRevisionId; $targetULDirectory = $targetULDirectory . $addedDataRevisionId . '.wdf'; // echo $targetULDirectory; move_uploaded_file($fileTempName, $targetULDirectory); } else { // echo 'not adding data. '; } $tablenamenewnode = "node_revision"; $next_incrementnode = 0; $qShowStatusnode = "SHOW TABLE STATUS LIKE '{$tablenamenewnode}'"; $qShowStatusResultnode = mysql_query($qShowStatusnode) or die("Query failed: " . mysql_error() . "<br/>" . $qShowStatusnode); $rownode = mysql_fetch_assoc($qShowStatusResultnode); $next_incrementnode_revision = $rownode['Auto_increment']; mysql_query('UPDATE `node` SET `node_current_revision` = \'' . $next_incrementnode_revision . '\' WHERE `node_id` =' . fv('nodeId') . ' LIMIT 1 ;'); //INSERT INTO `node` ( `node_id` , `node_current_revision` ) VALUES (' . fv('nodeId') . ', \'' . $next_incrementnode_revision . '\');'); $nodeEditedId = mysql_insert_id(); newintf($_POST['nodeDisplayTitle']); global $newIntfId; $nodeDisplayTitleIntfId = $newIntfId; newintf($_POST['nodeShortTitle']); global $newIntfId; $nodeShortTitleIntfId = $newIntfId; newintf($_POST['nodeTitle']); global $newIntfId; $nodeTitleIntfId = $newIntfId; newintf($_POST['nodeSource']); global $newIntfId; $nodeSourceIntfId = $newIntfId; newintf($_POST['nodeSortTitle']); global $newIntfId; $nodeSortTitleIntfId = $newIntfId; newintf($_POST['nodeDescription']); global $newIntfId; $nodeDescriptionIntfId = $newIntfId; newintf($_POST['nodeDisambiguationDescription']); global $newIntfId; $nodeDisambiguationDescriptionIntfId = $newIntfId; newintf($_POST['nodeComment']); global $newIntfId; $nodeCommentIntfId = $newIntfId; newintf($_POST['nodeShortDescription']); global $newIntfId; $nodeShortDescriptionIntfId = $newIntfId; $newNodeOwnerId = qry('user', 'user_id', 'user_name', mysql_real_escape_string($_POST['userName'])); $newNodeData = array("node_revision_type" => $_POST['nodeType'], "node_revision_display_title" => $nodeDisplayTitleIntfId, "node_revision_short_title" => $nodeShortTitleIntfId, "node_revision_title" => $nodeTitleIntfId, "node_revision_permissions" => $_POST['nodePermissions'], "node_revision_relationships" => $_POST['nodeRelationships'], "node_revision_source" => $nodeSourceIntfId, "node_revision_sort_title" => $nodeSortTitleIntfId, "node_revision_description" => $nodeDescriptionIntfId, "node_revision_disambiguation_description" => $nodeDisambiguationDescriptionIntfId, "node_revision_metadata" => $_POST['nodeMetadata'], "node_revision_comment" => $nodeCommentIntfId, "node_revision_short_description" => $nodeShortDescriptionIntfId, "node_revision_universe_status" => $_POST['nodeUniverseStatus'], "node_revision_owner" => $newNodeOwnerId, "node_revision_copyright_flag" => $_POST['nodeCopyrightFlag'], "node_revision_morality_flag" => $_POST['nodeMoralityFlag'], "node_revision_personal_flag" => $_POST['nodePersonalFlag'], "node_revision_data_id" => $addedDataId, "node_revision_node_id" => fv('nodeId'), "node_revision_minor_flag" => $_POST['nodeMinorFlag'], "node_revision_time" => getnow()); ins('node_revision', $newNodeData); $nodeRevisionAddedId = mysql_insert_id(); $nodeEditedId = fv('nodeId'); $user = new user(0, '', 0, fv('wvUserName'), 0, '', '', ''); $user->request_content('user_name', fv('wvUserName')); $newnodeeditids = $user->node_edit_ids . itr(1494) . $nodeRevisionAddedId; $user->set_variable('node_edit_ids', $newnodeeditids); return $nodeEditedId; }
$pwd = $_POST['newpwd']; $copypwd = $_POST['newpwd2']; 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;
if (mail($to, $subject, $body, $from)) { $user->set_variable('users_temppassword', $randPassword); $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)); }
} if ($pwdAccepted) { $_SESSION['userid'] = $user->get_variable('users_id'); header('Location: ' . $relocationString); } } } else { if (isset($_POST['signup'])) { $userNameValid = false; $emailValid = false; $previousEmailAddress = $_POST['email']; $previousSignupName = $_POST['signup']; if (filter_var($previousEmailAddress, FILTER_VALIDATE_EMAIL)) { // check if email or user name is currently used. $user = new user(); $user->set_variable('users_username', $_POST['signup']); if (!$user->load()) { // user name is ok $userNameValid = true; } $user->reset_query(); $user->set_variable('users_email', $_POST['email']); if (!$user->load()) { //email is ok $emailValid = true; } else { $emailInvalidString = "Email address already in use."; } if ($emailValid && $userNameValid) { $randPassword = user::randomPassword(); $user->reset_query();
<?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); $emailSubscribe = $_POST['esub'] === 'true' ? true : false; $shortEmailSubscribe = $_POST['essub'] === 'true' ? true : false; $reversalEmailSubscribe = $_POST['ersub'] === 'true' ? true : false; $textSubscribe = isset($_POST['tsub']) && $_POST['tsub'] === 'true' ? true : false; $shortTextSubscribe = isset($_POST['tssub']) && $_POST['tssub'] === 'true' ? true : false; $reversalTextSubscribe = isset($_POST['trsub']) && $_POST['trsub'] === 'true' ? true : false; if ($user->load()) { $user->set_variable("users_send_email_updates", $emailSubscribe); $user->set_variable("users_send_short_email_updates", $shortEmailSubscribe); $user->set_variable("users_send_reversal_email_updates", $reversalEmailSubscribe); if (($textSubscribe || $shortTextSubscribe || $reversalTextSubscribe) && isset($_POST['tnum'])) { $number = $_POST["tnum"]; $number = str_replace("(", "", $number); $number = str_replace(")", "", $number); $number = str_replace("-", "", $number); $number = str_replace(" ", "", $number); if (strlen($number) == 10 && is_numeric($number)) { $textEmail = $number . user::convertIDToCarrierAddress($_POST['tprovider']); if (strlen($textEmail) > 11) {
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; }
while ($referrals->loadNext()) { $listInfo = array(); $rid = $referrals->get_variable("referral_id"); $uid = $referrals->get_variable("referral_referred_by_userid"); $newUid = $referrals->get_variable("referral_referred_userid"); $date = $referrals->get_variable("referral_date"); $isPaid = $referrals->get_variable("referral_paid"); $expireInfo = user::getUserExpirationDate($uid); $newExpireInfo = user::getUserExpirationDate($newUid); $user = new user(); $user->set_variable("users_id", $uid); if (!$user->load()) { continue; } $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;