Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once("class.phpmailer.php");
- require_once("formvalidator.php");
- class FGMembersite
- {
- var $admin_email;
- var $from_address;
- var $username;
- var $pwd;
- var $database;
- var $tablename;
- var $connection;
- var $rand_key;
- var $error_message;
- //-----Initialization -------
- function FGMembersite()
- {
- $this->sitename = mydropbox.com';
- $this->rand_key = '0iQx5oBk66oVZep';
- }
- function InitDB($host,$uname,$pwd,$database,$tablename)
- {
- $this->db_host = $host;
- $this->username = $uname;
- $this->pwd = $pwd;
- $this->database = $database;
- $this->tablename = $tablename;
- }
- function SetAdminEmail($email)
- {
- $this->admin_email = $email;
- }
- function SetWebsiteName($sitename)
- {
- $this->sitename = $sitename;
- }
- function SetRandomKey($key)
- {
- $this->rand_key = $key;
- }
- //Main Operations
- function RegisterUser()
- {
- if(!isset($_POST['submitted']))
- {
- return false;
- }
- $formvars = array();
- if(!$this->ValidateRegistrationSubmission())
- {
- return false;
- }
- $this->CollectRegistrationSubmission($formvars);
- if(!$this->SaveToDatabase($formvars))
- {
- return false;
- }
- if(!$this->SendUserConfirmationEmail($formvars))
- {
- return false;
- }
- $this->SendAdminIntimationEmail($formvars);
- return true;
- }
- function ConfirmUser()
- {
- if(empty($_GET['code'])||strlen($_GET['code'])<=10)
- {
- $this->HandleError("Please provide the confirm code");
- return false;
- }
- $user_rec = array();
- if(!$this->UpdateDBRecForConfirmation($user_rec))
- {
- return false;
- }
- $this->SendUserWelcomeEmail($user_rec);
- $this->SendAdminIntimationOnRegComplete($user_rec);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement