From 3b845d2d365a41bb5ddfccd9d62bc9413630368b Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 2 Nov 2008 22:35:54 +0000 Subject: [PATCH] - working ajax part of the user invite script. No emails are sent yet, this is just the working ajax part. but.. it works.. at least in firefox. --- user_invite.php | 194 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 user_invite.php diff --git a/user_invite.php b/user_invite.php new file mode 100644 index 0000000..ab16201 --- /dev/null +++ b/user_invite.php @@ -0,0 +1,194 @@ + + Copyright (C) 2005 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. +*/ +?> + 'committee_main.php', + 'Administration' => 'admin/index.php' + ) ); + + require_once('ajax.inc.php'); + +?> + +"; + if($_POST['action']=="invite" && $_POST['email']) + { + $q=mysql_query("SELECT id FROM users WHERE email='".$_POST['email']."'"); + if(mysql_num_rows($q)) + { + echo error(i18n("A judge already exists with that email address")); + } + else + { + $pass=generatePassword(); +// mysql_query("INSERT INTO judges (email,password) VALUES ('".mysql_escape_string(stripslashes($_POST['email']))."','$pass')"); +// email_send("new_judge_invite",stripslashes($_POST['email']),array("FAIRNAME"=>$config['fairname']),array("FAIRNAME"=>$config['fairname'],"EMAIL"=>stripslashes($_POST['email']),"PASSWORD"=>$pass)); + + echo happy(i18n("%1 has been invited to be a judge",array($_POST['email']))); + } + } + + + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "
"; + echo i18n("Select a Role: "); + echo "
"; + echo i18n("Enter an Email: "); + echo ""; + echo "
"; + echo "
\n"; + echo "
".i18n('Select a role and enter an email address')."
"; + + echo "
\n"; + echo "\n"; + + echo "
\n"; + + + send_footer(); +?>