[SUCS Devel] [Git][sucssite/sucs-site][master] 3 commits: Use the built in sucs-site error handling stuff.

Peter Jenkins unreturnable at sucs.org
Mon Oct 12 17:59:09 BST 2015


Peter Jenkins pushed to branch master at sucssite / sucs-site


Commits:
0fc217a2 by Imran Hussain at 2015-10-12T17:22:17Z
Use the built in sucs-site error handling stuff.

- - - - -
a023341d by Imran Hussain at 2015-10-12T17:32:56Z
Merge remote-tracking branch 'upstream/master'

Conflicts:
	templates/susignup-admin.tpl

- - - - -
15751aff by Peter Jenkins at 2015-10-12T17:59:04Z
Merge branch 'master' into 'master'

Use the built in sucs-site error handling stuff.

See merge request !29

- - - - -


2 changed files:

- components/susignup-admin.php
- templates/susignup-admin.tpl


Changes:

=====================================
components/susignup-admin.php
=====================================
--- a/components/susignup-admin.php
+++ b/components/susignup-admin.php
@@ -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.");


=====================================
templates/susignup-admin.tpl
=====================================
--- a/templates/susignup-admin.tpl
+++ b/templates/susignup-admin.tpl
@@ -1,9 +1,9 @@
 {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'>



View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/compare/03cf6db852f88dbf34feb31151924a605dc99a9b...15751affc636bef0012b0e8887575f692edafbc7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20151012/a97dfb9b/attachment.html>


More information about the Devel mailing list