[SUCS Devel] [Git][sucssite/sucs-site][master] Make improvements based on feedback from tswsl1989
Imran Hussain
imranh at sucs.org
Tue Oct 6 23:40:30 BST 2015
Imran Hussain pushed to branch master at sucssite / sucs-site
Commits:
47ca4f1b by Imran Hussain at 2015-10-06T23:35:11Z
Make improvements based on feedback from tswsl1989
- - - - -
1 changed file:
- components/susignup.php
Changes:
=====================================
components/susignup.php
=====================================
--- a/components/susignup.php
+++ b/components/susignup.php
@@ -32,8 +32,11 @@ if(!empty($_REQUEST['sid'])&&!empty($_REQUEST['transactionID'])){
// check if the data posted is valid
if(check_su_sid_and_trans($sid,$transactionID)){
- // check to see if they are already a valid and paid member
+ // probe the db for some info thatwe want to use in the if statements below
$tmpresult = $sucsDB->Execute("SELECT * FROM members WHERE sid=?", array($sid));
+ $singuptmpresult = $sucsDB->Execute("SELECT * FROM signup WHERE sid=?", array($sid));
+
+ // check to see if they are already a valid and paid member
if($tmpresult->fields["sid"] == $sid && $tmpresult->fields["paid"] == paidUntil(time())){
// let them know they are already signed up and renewed
message_flash("You are a numpty and have already signed up and paid for this year.");
@@ -44,7 +47,7 @@ if(!empty($_REQUEST['sid'])&&!empty($_REQUEST['transactionID'])){
// let them know that their account has been renewed
message_flash("Your SUCS account has been renewed.");
// else if they aren't in the SUCS DB but have a signup slip, take them back to that part of signup
- $singuptmpresult = $sucsDB->Execute("SELECT * FROM signup WHERE sid=?", array($sid));
+ // I don't know how you would end up in a state like this but the old code dealt with it so I will as well
} else if ($tmpresult->fields == false && $signuptmpresult->fields["sid"] == $sid) {
$mode = "form";
$smarty->assign("id",$signuptmpresult->fields["id"]);
@@ -59,7 +62,7 @@ if(!empty($_REQUEST['sid'])&&!empty($_REQUEST['transactionID'])){
$smarty->assign("pass", $pass);
} else {
// they should never get here
- echo("fuck you");
+ die("You'll see this if there has been a database error. Someone probably knows and is trying to fix it. Sorry.");
}
} else {
trigger_error("That Student Number and Transaction ID combo are invalid.", E_USER_ERROR);
View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/commit/47ca4f1b40fd4f37a6fe59272b79a02144236633
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20151006/1d16dfc5/attachment.html>
More information about the Devel
mailing list