[SUCS Devel] [Git][sucssite/sucs-site][master] Fix banana award system

Imran Hussain imranh at sucs.org
Mon Nov 19 08:48:38 GMT 2018


Imran Hussain pushed to branch master at sucssite / sucs-site


Commits:
7ab02831 by Imran Hussain at 2018-11-19T08:48:11+00:00
Fix banana award system

- - - - -


2 changed files:

- lib/banana-admin.php
- templates/banana-award.tpl


Changes:

=====================================
lib/banana-admin.php
=====================================
--- a/lib/banana-admin.php
+++ b/lib/banana-admin.php
@@ -23,10 +23,10 @@ if (isset($session->groups[$permission])) {
     $smarty->assign("banana_admin", TRUE);
 
     if ($_REQUEST['action'] == "award") {
-        if (trim($_POST['why']) !== "") {
-            $number = intval($_POST['number']);
+        if (trim($_REQUEST['why']) !== "") {
+            $number = intval($_REQUEST['number']);
 
-            $why = $_POST['why'];
+            $why = $_REQUEST['why'];
 
             if ((abs($number) <= $maxbanana) && $number) {
 
@@ -46,8 +46,8 @@ if (isset($session->groups[$permission])) {
     }
 } elseif ($session->loggedin) {
     if ($_REQUEST['action'] == "award") {
-        $number = intval($_POST['number']);
-        $why = $_POST['why'];
+        $number = intval($_REQUEST['number']);
+        $why = $_REQUEST['why'];
 
         // Send a mail to someone about them bananas
         $msgbody = $session->username . " thinks $who deserves $number bananas:\r\n";


=====================================
templates/banana-award.tpl
=====================================
--- a/templates/banana-award.tpl
+++ b/templates/banana-award.tpl
@@ -17,7 +17,7 @@
             <p><q>Please tell us if you think this user has done something good recently (deserving yellowy recognition)
                     or something dumb (deserving of greenish derision)</q></p>
         {/if}
-        <form action="{$url}" method="post">
+        <form action="{$url}" method="post" id="bananaform">
             <div>
                 <input type="hidden" name="action" value="award"/>
 
@@ -33,7 +33,7 @@
             </div>
             <div>
                 <p>Why</p>
-                <span class="textinput"><textarea id="bananareason" name="why" cols="25" rows="10"></textarea></span>
+                <span class="textinput"><textarea id="bananareason" name="why" formid="bananaform" cols="25" rows="10"></textarea></span>
             </div>
             <div>
                 <span class="textinput"><input type="submit" value="{$action_text}"/></span>



View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/commit/7ab02831465a57d4816198bab91fdd9d6bf1f1a5

-- 
View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/commit/7ab02831465a57d4816198bab91fdd9d6bf1f1a5
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20181119/40f8ad5c/attachment-0001.html>


More information about the Devel mailing list