function processRequest()
 {
     // we can directly reference $_SESSION, $_REQUEST and defined vars set by config;
     global $con;
     // give access to open db connection object
     $this->sesstoken = fct_session_token();
     // from $_SESSION['token'] (may be gen'd new just now)
     $email = isset($_POST) && isset($_POST['email']) ? $_POST['email'] : '';
     $email = strtolower(urldecode($email));
     $existing_user = $con->recordselect("SELECT * FROM `prelaunch_signup` WHERE emailAddress='" . $email . "'");
     if (mysql_num_rows($existing_user) > 0) {
         return "That email address is already signed up.";
     } else {
         // new pre-launch signup
         $accessIp = get_ip_address1();
         if (isset($_SESSION['plc'])) {
             // new user has arrived on a referral link containing prelaunch_user created timestamp
             $con->insert("INSERT INTO `prelaunch_signup` \n\t\t\t\t\t\t\t(`emailAddress`, `created`, `ipaddress`, `referrerCreated`) \n\t\t\t\t\t\t\tVALUES ('{$email}', " . time() . ", '" . $accessIp . "', '" . $_SESSION['plc'] . "') ");
         } else {
             if (isset($_SESSION['ruid'])) {
                 // new user has arrived on a referral link containing a registered user's id
                 $referrer = $con->recordselect("SELECT * FROM `users` WHERE `userId` = '" . $_SESSION['ruid'] . "' ");
                 if (mysql_num_rows($referrer) >= 1) {
                     // Use registered user's "created" timestamp as referrerCreated
                     // ... to add a little confusion to understand which "create" we are talking about
                     $con->insert("INSERT INTO `prelaunch_signup` \n\t\t\t\t\t\t\t(`emailAddress`, `created`, `ipaddress`, `referrerCreated`) \n\t\t\t\t\t\t\tVALUES ('{$email}', " . time() . ", '" . $accessIp . "', '" . $referrer['created'] . "') ");
                 } else {
                     // strange ... cannot located registered user by id
                     wrtlog("DEBUG: could not locate registered user by userId=" . $_SESSION['ruid'] . " from session['ruid'] ");
                 }
             } else {
                 $con->insert("INSERT INTO `prelaunch_signup` (`emailAddress`, `created`, `ipaddress`) \n\t\t\t\t\t\t\tVALUES ('{$email}', " . time() . ", '" . $accessIp . "') ");
             }
         }
         return "Thank you! We will notify you as soon as we open for business.";
     }
 }
Пример #2
0
 if (!$err && $email_valid1 > 0) {
     $_SESSION['msgType'] = array('from' => 'user', 'type' => 'error', 'var' => "multiple", 'val' => "That email address has already been registered.");
     $err = true;
 }
 if (!$err && !preg_match('`[A-Z]`', $passwd) && preg_match('`[a-z]`', $passwd) && preg_match('`[0-9]`', $passwd)) {
     $_SESSION['msgType'] = array('from' => 'user', 'type' => 'error', 'var' => "multiple", 'val' => "The password must contain a minimum of one lower case character. one upper case character, one digit");
     $err = true;
 }
 if (!$err && $_SESSION['msgType'] == '' && $error == '') {
     $time_add = time();
     $acti_key = base64_encode($time_add);
     $created = date('Ymd');
     $password = base64_encode($passwd);
     $refid = isset($_SESSION['refid']) ? $_SESSION['refid'] : 0;
     // jwg
     $accessIp = $signupIp = get_ip_address1();
     // jwg
     $con->insert("INSERT INTO users (userId, emailAddress, name, password, created, access, status, activated, randomNumber, profilePicture, accessIp, signupIp, newsletter, referrerId) VALUES\n\t\t\t                           (NULL, '{$emailid}', '" . sanitize_string($username) . "', '{$password}', {$created}, NULL, 0, 0, '{$acti_key}', NULL, '{$accessIp}', '{$signupIp}', '{$txtTerms}', '{$refid}' )");
     $lastId = mysql_insert_id();
     // remove prelaunch_signup record for just-registered user - if present
     $sel_prelaunch = $con->recordselect("SELECT * FROM `prelaunch_signup` WHERE `emailAddress` = '" . $_POST['emailid'] . "'");
     if (mysql_num_rows($sel_prelaunch) > 0) {
         $con->delete("DELETE FROM `prelaunch_signup` WHERE `emailAddress` = '" . $_POST['emailid'] . "'");
     }
     // track referrals
     if ($refid > 0 && isset($_SESSION['projid'])) {
         $projid = $_SESSION['projid'];
         $con->insert("INSERT INTO `referrals` (`newuserId`, `referrerId`, `created`, `projectId`) \n\t\t\t\t\t\t\t\tVALUES ({$lastId}, {$refid}, " . time() . ", {$projid}) ");
     }
     if ($txtTerms == 1) {
         $sel_newsletter = $con->recordselect("SELECT * FROM newsletter_user WHERE email='" . $emailid . "'");
Пример #3
0
 */
$sandbox = TRUE;
$domain = $sandbox ? 'http://www.sandbox.paypal.com/' : 'http://www.paypal.com/';
/**
 * Enable error reporting if running in sandbox mode.
 */
if ($sandbox) {
    ///error_reporting(0);
    //ini_set('display_errors', '0');
}
/**
 * API Credentials
 */
$api_version = '85.0';
$application_id = $sandbox ? 'APP-80W284485P519543T' : '';
// Only required for Adaptive Payments.  You get your Live ID when your application is approved by PayPal.
$developer_account_email = '*****@*****.**';
// This is what you use to sign in to http://developer.paypal.com.  Only required for Adaptive Payments.
$api_username = $sandbox ? 'developer_api1.crowdedrocket.com' : 'LIVE_API_USERNAME';
$api_password = $sandbox ? 'NCXWTU5VWA2GTB3U' : 'LIVE_API_PASSWORD';
$api_signature = $sandbox ? 'AkUBj7fCpYI6FdSHQSlytehd.GM-AODzrJy1jp1mamZoM0TTAOm2ik.4' : 'LIVE_API_SIGNATURE';
/**
 * Third Party User Values
 * These can be setup here or within each caller directly when setting up the PayPal object.
 */
$api_subject = '';
// If making calls on behalf a third party, their PayPal email address or account ID goes here.
$device_id = '';
//$device_ip_address = $_SERVER['REMOTE_ADDR'];
$device_ip_address = get_ip_address1();
// jwg - although it appears this is not userd anywhere...
Пример #4
0
<?php

require_once "includes/config.php";
////////////////////////////////////////////////////////////////////////////////////////////////
/// WHEN READY TO OPEN SITE TO THE PUBLIC CHANGE /includes/config.php to $prelaunch=false //////
////////////////////////////////////////////////////////////////////////////////////////////////
$domain = $_SERVER['SERVER_NAME'];
$site_name = stristr($domain, 'emptyrocket') !== false ? 'EmptyRocket' : 'CrowdedRocket';
$userip = get_ip_address1();
$rand8 = substr(time(), -8, 8);
$referral_url = 'https://' . $domain . '/index1.php';
$title = 'Launching great companies : CrowdedRocket';
$description = 'A new approach to crowdfunding!';
//Facebook App Id and Secret
if ($_SERVER['SERVER_NAME'] == 'emptyrocket.com') {
    $fbappid = '329614567212154';
    // emptyrocket test - put these in config
    $fbsecret = 'e86b3b2055f2dd105343ea277c82913c';
    //
} else {
    $fbappid = '836466059717946';
    // crowdedrocket - put these in config
    $fbsecret = '6b9a7a48b3709b002be3686c5b809ebc';
    //
}
echo '<?xml version="1.0" encoding="UTF-8" ?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/"
      xmlns:fb="http://developers.facebook.com/schema/" xml:lang="en_US" lang="en_US" class="" >