From 552c3cedd78263ce385d0ac47b02ccd22ea474b3 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 2 Dec 2007 16:40:03 +0000 Subject: fixed registration page, and simplifed its logic --- lib/class/registration.class.php | 94 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 lib/class/registration.class.php (limited to 'lib/class/registration.class.php') diff --git a/lib/class/registration.class.php b/lib/class/registration.class.php new file mode 100644 index 00000000..7b964b7f --- /dev/null +++ b/lib/class/registration.class.php @@ -0,0 +1,94 @@ +"; + $subject = "New User Registration at " . Config::get('site_title'); + $body = "Thank you for registering\n\n" . + "Please keep this e-mail for your records. Your account information is as follows:\n\n" . + "----------------------\n" . + "Username: $username\n" . + "Password: $password\n" . + "----------------------\n\n" . + "Your account is currently inactive. You cannot use it until you've visited the following link:\n\n" . + Config::get('web_path') . "/register.php?action=validate&username=$username&auth=$validation\n\n" . + "Thank you for registering\n"; + + // Send the mail! + mail($email,$subject,$body,$headers); + + // Check to see if the admin should be notified + if (Config::get('admin_notify_reg')) { + $body = "A new user has registered\n\n" . + "The following values were entered.\n\n" + "Username:$username\nFullname:$fullname\nE-mail:$mail\n\n"; + mail(Config::get('mail_from'),$subject,$body,$headers); + } + + return true; + + } // send_confirmation + + /** + * show_agreement + * This shows the registration agreement, /config/registration_agreement.php + */ + public static function show_agreement() { + + $filename = Config::get('prefix') . '/config/registration_agreement.php'; + + if (!file_exists($filename)) { return false; } + + /* Check for existance */ + $fp = fopen($filename,'r'); + + if (!$fp) { return false; } + + $data = fread($fp,filesize($filename)); + + /* Scrub and show */ + echo $data; + + } // show_agreement + +} // end registration class +?> -- cgit