";
?>
diff --git a/contact.php b/contact.php
new file mode 100644
index 0000000..1f880aa
--- /dev/null
+++ b/contact.php
@@ -0,0 +1,120 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2007 James Grant
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation, version 2.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+?>
+
+ require("common.inc.php");
+ send_header("Contact", array());
+
+ function cleanify($in) {
+ $in=ereg_replace("\r","\n",$in);
+ $lines=split("\n",$in);
+ return trim($lines[0]);
+ }
+
+ if($_POST['action']=="send") {
+ if($_POST['to'] && $_POST['subject'] && $_POST['message'] && $_POST['from'] && $_POST['fromemail']) {
+ if(isEmailAddress($_POST['fromemail'])) {
+ list($id,$md5email)=split(":",$_POST['to']);
+ $q=mysql_query("SELECT * FROM users WHERE id='$id'");
+ $r=mysql_fetch_object($q);
+ //if a valid selection is made from the list, then this will always match.
+ if($md5email == md5($r->email)) {
+ $from=cleanify($_POST['from'])." <".cleanify($_POST['fromemail']).">";
+ $extra="Return-Path: $from\r\nFrom: $from\r\nReply-To: $from\r\n";
+ mail("$r->firstname $r->lastname <$r->email>",$_POST['subject'],$_POST['message'],$extra);
+ echo happy(i18n("Contact email successfully sent"));
+ }
+ else {
+ //this should never happen unless a spammer us auto-submitting stuff and it doesnt match.
+ echo error(i18n("Invalid email address"));
+ }
+ }
+ else
+ echo error(i18n("Please enter a valid email address"));
+ }
+ else
+ echo error(i18n("All fields are required"));
+ }
+
+?>
+
+
+
+ echo i18n("Choose who you would like to contact from the list below, type your subject and message, and click the 'Send' button");
+ echo " ";
+ echo " ";
+ echo "";
+
+ send_footer();
+?>
diff --git a/db/db.code.version.txt b/db/db.code.version.txt
index 85322d0..d15a2cc 100644
--- a/db/db.code.version.txt
+++ b/db/db.code.version.txt
@@ -1 +1 @@
-79
+80
diff --git a/db/db.update.80.sql b/db/db.update.80.sql
new file mode 100644
index 0000000..cf122dd
--- /dev/null
+++ b/db/db.update.80.sql
@@ -0,0 +1,2 @@
+INSERT INTO `pagetext` ( `id` , `textname` , `text` , `year` , `lastupdate` ) VALUES ( '', 'register_volunteer_invite', 'Thank you for volunteering for the fair. Volunteer registration is by invitation only.
Please contact the fair and request to be invited as a volunteer. We will then send you an email with instructions on how to complete your volunteer registration.
If you have been invited already, you need to login using the same email address that you were invited with.', '-1', '');
+
diff --git a/user_new.php b/user_new.php
index 601c16d..749c67f 100644
--- a/user_new.php
+++ b/user_new.php
@@ -99,10 +99,7 @@
send_header("{$user_what[$type]} Registration",
array("{$user_what[$type]} Login" => "user_login.php?type=$type") );
- echo i18n("{$user_what[$type]} Registration is by invitation only. You can not create a new account.")."
";
- echo i18n("In order to register you must have your account created for you by the science fair committee.")."
";
- echo i18n("Once your account is created you'll be invited via email to login and complete your {$user_what[$type]} registration information. If you have been invited already, you need to use login using the email address that you were invited with. If you need an invitation, please contact the science fair committee by sending us an email: %1.",
- array($config['fairname'],$config['fairmanageremail']));
+ output_page_text("register_{$type}_invite");
echo " ";
send_footer();
exit;
diff --git a/version.txt b/version.txt
index 399088b..04b10b4 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-2.1.6
+2.1.7