Skip to content
Commits on Source (3)
......@@ -38,16 +38,19 @@ if (isset($session->groups[$permission])) {
$smarty->assign("error_text", "Search term doesn't look like a valid student ID");
} else {
// they have given us a valid sid lets check to see if they have paid
$sid = $_REQUEST['sid'];
// make sure the user/admin/exec isn't an idiot
// check if they are already signed up and tell them so
$tmpresult = $sucsDB->Execute("SELECT * FROM members WHERE sid=?", array($_REQUEST['sid']));
if ($tmpresult->fields["sid"] == $sid && $tmpresult->fields["paid"] == paidUntil(time())) {
// let them know they are already signed up and renewed
$mode = 'error';
message_flash("You are a numpty and have already signed up and paid for this year.");
// else if check to see if they have signedup and paid for the new year but haven't renewed
} else if ($tmpresult->fields["sid"] == $sid && $tmpresult->fields["paid"] != paidUntil(time())) {
// renew them!
$mode = 'error';
renew_membership($tmpresult->fields["username"]);
// let them know that their account has been renewed
message_flash("Your SUCS account has been renewed.");
......
{if $staff == TRUE}
{if $mode == 'error'}
{*{if $mode == 'error'}
<div class='errorbar'>
<strong>Error: </strong> {$error_text}
</div>
{/if}
{/if}*}
{if $mode == 'renewals'}
<form action='{$componentpath}' method='post'>
<table id='susignup-renewals'>
......