}
                $user->phone_number = $_REQUEST['userCell'];
                $prompt = FALSE;
            }
        } else {
            echo '<p style="color:red">Please enter a valid cell phone number (only numeric characters).</p>';
            $_REQUEST['userCell'] = '';
            exit;
        }
    }
    $user->send_email = $_REQUEST['receive_email'] == 'yes';
    $user->send_sms_text = $_REQUEST['receive_sms_text'] == 'yes';
    $user->send_sms_link = $_REQUEST['receive_sms_link'] == 'yes';
    $feedinfos = array();
    if ($_REQUEST['feed'] != NULL) {
        foreach ($_REQUEST['feed'] as $index => $currentFeed) {
            if (!empty($currentFeed)) {
                $feedinfos[] = array('url' => $currentFeed, 'name' => $currentFeed);
            }
        }
        $prompt = FALSE;
    }
    $user->feeds = Feeds::create($feedinfos);
    if ($prompt == FALSE) {
        print '<p style="color:navy;">Update Successful.</p>';
        print '<a href="index.php">Here is your homepage!</a>';
        print '</br></br>';
    }
} else {
    echo '<p style="color:navy;">Edit your user information here.</p>';
}
         $_REQUEST['userCell'] = '';
         exit;
     }
 } else {
     echo '<p style="color:red">Please enter your cell phone number.  Note that you will not receive text messages from Watercooler unless you select a texting reception method.</p>';
     exit;
 }
 if (isset($_REQUEST['feed'])) {
     $feedinfos = array();
     foreach ($_REQUEST['feed'] as $index => $feed) {
         if ($feed != '') {
             $feedinfos[] = array('name' => $feed, 'url' => $feed);
         }
     }
     if (count($feedinfos) > 0) {
         $feeds = Feeds::create($feedinfos);
     }
 }
 $emailPin = mt_rand(1000, 9999);
 $smsPin = mt_rand(1000, 9999);
 $userInfo = array('username' => $userName, 'password' => md5($userPassword), 'email' => $userEmail, 'phone_number' => $userCell, 'carrier' => $_REQUEST['userCarrier'], 'send_email' => $_REQUEST['receive_email'] === 'yes', 'send_sms_text' => $_REQUEST['receive_sms_text'] === 'yes', 'send_sms_link' => $_REQUEST['receive_sms_link'] === 'yes', 'email_pin' => $emailPin, 'phone_pin' => 0, 'feeds' => $feeds);
 if (($user = User::create($userInfo)) == NULL) {
     echo '<p style="color:red">User registration failed.</p>';
     exit;
 } else {
     print '<p style="color:navy">Registration Successful!</p>';
     $hyperlink = 'confirm.php' . "?id={$user->id}&pin={$emailPin}";
     $EmailConfirmationString = "python2.5 -c \"import EmailServer; EmailServer.sendConfirmEmail('{$page_uri_base}{$hyperlink}','{$user->username}','{$user->email}');\"";
     exec($EmailConfirmationString);
     //$SMSConfirmationString = "python2.5 -c \"import EmailServer; EmailServer.sendConfirmSMS('{$user->phone_number}','{$user->carrier}','{$user->username}', '{$smsPin}');\"";
     //exec($SMSConfirmationString);