public function SendValidationEmail($firstname, $lastname, $eMail, $facebookid) { $db = new DB_Access(); $apiConsumer = new F1Api(); $found_individuals = $apiConsumer->peopleSearch($firstname, $lastname, $eMail); $guid = Util::getGuid(); if (sizeof($found_individuals) > 0) { $db->SaveUserActivationCode($facebookid, $eMail, $guid, $found_individuals[0]); } else { $db->SaveUserActivationCode($facebookid, $eMail, $guid); } // Email Initialize ini_set("SMTP", AppConfig::$SMTP); ini_set('sendmail_from', AppConfig::$FromAddress); $Name = AppConfig::$SenderName; //senders name $email = AppConfig::$FromAddress; //senders e-mail adress $recipient = $eMail; //recipient $mail_body = "Please click the following link to validate your e-mail address.\n\n" . AppConfig::$app_url . '/validateemail.php?code=' . $guid; $subject = AppConfig::$app_name . ': E-mail Validation'; //subject $header = "From: " . $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command :) }
public function __construct($facebookid = 0) { // A. TODO: Get the access_token and token_secret from the database //$access_token = '61344b1a-0e88-4ccc-8854-cc6219d83642'; //$token_secret = '7e01bf18-cc44-4332-b40e-dc4ae501098a'; $db = new DB_Access(); $results = $db->GetAuthTokenByUserID($facebookid); $row = mssql_fetch_row($results); $access_token = $row[2]; $token_secret = $row[3]; // B. Create a OAuthAPIClient object and initialize it $this->apiConsumer = new OAuthAPIClient(AppConfig::$f1_base_url, AppConfig::$f1_default_church_code, AppConfig::$f1_key, AppConfig::$f1_secret); $this->apiConsumer->setPathsFromConfig(); // This is important. Set the access_token and the token_secret from step A $this->apiConsumer->init_AccessToken($access_token, $token_secret); $this->baseUrl = $this->apiConsumer->getBaseUrl(); }
if ($task == "") { ?> <div align=center> <FORM METHOD=POST ENCTYPE="multipart/form-data" ACTION="<?php print $_SERVER["PHP_SELF"]; ?> "> File to upload: <INPUT TYPE=FILE NAME="upfile"><BR> <input type="hidden" name="task" value="upload"> <INPUT TYPE=SUBMIT VALUE="Submit"> </FORM> </div> <?php } if ($task == "upload") { $db = new DB_Access(); $db->Choose_DB("chartjes"); $fp = fopen($_FILES["upfile"]["tmp_name"], "r"); $x = 0; while (!feof($fp)) { $x++; $data = fgets($fp, 1024); $roster_data = explode(",", $data); $comments = preg_replace("/\"/", "", $roster_data[2]); $ibl_team = preg_replace("/\"/", "", $roster_data[4]); $tig_name = trim($roster_data[5] . " " . $roster_data[6]); $tig_name = preg_replace("/\\'/", "`", $tig_name); if ($ibl_team != "" && strpos($ibl_team, "UC") === FALSE) { $pick_team = $ibl_team; } // Let's check to see if we found a draft pick
<?php $path = dirname(__FILE__) . '\\'; require_once $path . '..\\DB\\db_client.php'; $churchcode = $_GET['churchcode']; $churchid = $_GET['churchid']; $facebookid = $_GET['facebookid']; //insert the secret and the key. $db = new DB_Access(); $db->SaveChurchAuthInfo($churchid, $churchcode, $_GET['oauth_token']); $db->AddAdminUser($facebookid, $churchid); ?> <script language="javascript"> function but_onclick() { top.location = "http://apps.facebook.com/ftoutreach/index.php?churchcode=<?php echo $churchcode; ?> &churchid=<?php echo $churchid; ?> " } </script> <div style="border: 1px solid #d4dae8; width: 350px; margin-left: auto; margin-right: auto;"> <h4>You have successfully logged in!<h4><br /> <input type="button" value="Go to FTOutreach" id="goto" onclick="but_onclick()"> </div>