Commit b9db1f21 authored by Kit Manners's avatar Kit Manners Committed by Imran Hussain

Remember the student number if they entered it in a previous form

parent 459d1ed8
......@@ -50,6 +50,10 @@ if (isset($_REQUEST['signupid']) && isset($_REQUEST['signuppw'])) {
// pass on the id and passwd and id the validation is overridable
$smarty->assign("signupid", $signupid);
$smarty->assign("signuppw", $signuppw);
// pass on the student id if it exists
if (isset($_REQUEST['signupsid'])) {
$smarty->assign("signupsid", $signupsid);
}
$smarty->assign("overridable", $overridable);
$smarty->assign("usertype", $row[type]);
// if accepting the form
......
......@@ -51,6 +51,7 @@ if (!empty($_REQUEST['sid']) && !empty($_REQUEST['transactionID'])) {
$mode = "form";
$smarty->assign("id", $signuptmpresult->fields["id"]);
$smarty->assign("pass", $signuptmpresult->fields["password"]);
$smarty->assign("sid", $signuptmpresult->fields["sid"]);
// else if they aren't in the SUCS DB, then bootstrap signup process
} else if ($tmpresult->fields == false) {
$mode = "form";
......@@ -59,6 +60,7 @@ if (!empty($_REQUEST['sid']) && !empty($_REQUEST['transactionID'])) {
$id = $iddata->fields['id'];
$smarty->assign("id", $id);
$smarty->assign("pass", $pass);
$smarty->assign("sid", $sid);
} else {
// they should never get here
die("You'll see this if there has been a database error. Someone probably knows and is trying to fix it. Sorry.");
......
......@@ -36,7 +36,7 @@
<div class="row" id="studentiddiv">
<label for="studentid">Student Number</label>
<span class="textinput"><input type="text" id="studentid" name="studentid" size="30"
{if $mode=='re-form'}value='{$fields.studentid}'{/if} /></span>
{if $mode=='re-form'}value='{$fields.studentid}'{elseif isset($signupsid)}value='{$signupsid}'{/if} /></span>
<div id="studentidmessage"{if $mode=='re-form'}{if isset($errors.studentid)}
style="color:red; float:right; clear:right;">{$errors.studentid}{else} style="color:green;
......
......@@ -39,6 +39,7 @@
<form action="{$baseurl}/signup/" method="post">
<input type=hidden name="signupid" id="id" value="{$id}"/>
<input type=hidden name="signuppw" id="pass" value="{$pass}"/>
<input type=hidden name="signupsid" id="sid" value="{$sid}"/>
<input type=submit name="submit" value="Proceed"/>
</form>
{else}
......@@ -49,4 +50,4 @@
An error occured during signup, please email, with as much information as you can provide,
<a href='mailto:admin@sucs.org'>admin@sucs.org</a>
for assistance.
{/if}
\ No newline at end of file
{/if}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment