Skip to content
Snippets Groups Projects
Commit e6a9cc1c authored by Tim Clark's avatar Tim Clark
Browse files

finished signup system, unstick todos still need to be followed

parent d323c35b
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ if(isset($_REQUEST['signupid'])&&isset($_REQUEST['signuppw'])){
// invalidate signup slip
$query = "UPDATE signup SET sid=?, username=?, activated=now() WHERE id=?";
$unset($atribs);
unset($atribs);
$atribs[0]=$fields['studentid'];
$atribs[1]=$fields['username'];
$atribs[2]=$signupid;
......@@ -285,45 +285,80 @@ if(isset($_REQUEST['signupid'])&&isset($_REQUEST['signuppw'])){
$usermessage .= "Username: ".$fields['username']."\n";
$usermessage .= "Password: ".$password."\n\n";
$usermessage .= "Wondering what to do next? Check out our Getting Started page: http://sucs.org/Getting%20Started or go right ahead and post on our forum at http://sucs.org/Community/Forum or join in the discussion on our chat system, Milliways: http://sucs.org/Community/Milliways\n\n";
$usermessage .= "Our weekly social is held in the coffee end JC's at 1:00 PM every Friday\n\n";
$usermessage .= "Before you use the SUCS computers or the computer room, please make sure you are familiar with the conditions of use and room rules at http://sucs.org/About/Regulations\n\n";
$usermessage .= "If you require help using the system, introductory guides are available at http://sucs.org/Knowledge\n\n";
$usermessage .= "If you have any trouble using the system, reply to this e-mail describing the nature of the problem and we'll look into it.\n\n";
$usermessage .= "We hope you enjoy your SUCS membership.\n\n";
$usermessage .= "Regards,\n\n";
$usermessage .= "Swansea University Computer Society";
if($fields['email']=''){
if($fields['email']!=''){
$user_email=$fields['email'];
}
elseif($fields['studentid']!=''){
$user_email=$fields['studentid']."@swan.ac.uk";
}
else{
$user_email=$fields['email'];
$user_email=FALSE;
}
mail(
if($user_email){
mail(
$user_email,
"Your SUCS Account has been created!",
$usermessage,
"From: \"SUCS Admin\" <admin@sucs.org>"
);
);
}
}
}
}
$addtolist ="".$fields['email']."\n".$fields['studentid']."@swan.ac.uk";
file_put_contents('/tmp/listadd.'.$fields['username'],$addtolist);
system(
file_put_contents('/tmp/listadd.'.$fields['username'],$addtolist);
unset($execoutputarr);
exec(
$script_path.'listadd.apache '.
escapeshellarg($fields['username'])
escapeshellarg($fields['username']).' '.
escapeshellarg($row[type]),
$execoutputarr,
$ececreturn
);
}
if($execreturn!=0){
$execoutputstr=implode("\n",$execoutputarr);
mail(
$error_email,
"Error adding user to mailing lists from signup id: ".$signupid,
$execoutputstr,
"From: \"SUCS Admin\" <admin@sucs.org>"
);
$failed=true;
}
//TODO: REMOVE THIS BEFORE DEPLOYING
$_POST[uid]=$uid;
$_POST[password]=$password;
$_POST[ldif]=$ldif;
$smarty->assign("post",$_POST);
// TODO: ADD OUTPUT DATA
}
$smarty->assign("failed",$failed);
if($failed){
$errorreparray=$_POST;
unset($errorroparray[signuppw]);
$errorreparray[uid]=$uid;
$errorreport = "User inputed detailes:\n\n";
foreach ($errorreparray as $key => $value){
$errorreport .= $key.": ".$value."\n";
}
$errorreport .= "\nLove from the Signup System";
mail(
$error_email,
"Signup system error report",
$errorreport,
"From: \"SUCS Admin\" <admin@sucs.org>"
);
}
else{
$smarty->assign("username", $fields['username']);
$smarty->assign("password", $password);
$smarty->assign("email", $user_email);
}
}
else{
......
......@@ -88,10 +88,15 @@
</div>
</form>
{elseif $mode=='result'}
<table>
<tr><th>Key</th><th>Value</th></tr>
{foreach from=$post key=key item=value}
<tr><td>{$key}</td><td>{$value}</td></tr>
{/foreach}
</table>
{if !$failed}
<h1>Welcome to SUCS</h1>
<p>Signup is complete, please see below for your password, a copy has also been send to {$email}, we request you change this immediatley. See our <a href="/Getting%20Started">Getting Started</a> page for some ways you can start using your new SUCS account!</p>
<p>
Username: <strong>{$username}</strong><br />
Password: <strong>{$password}</strong><br />
</p>
{else}
<h1>Error</h1>
An error occured during signup, please email <a href='mailto:admin@sucs.org'>admin@sucs.org</a> for assistance.
{/if}
{/if}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment