Commit 7ab02831 authored by Imran Hussain's avatar Imran Hussain

Fix banana award system

parent b7bdb1e3
Pipeline #495 passed with stage
in 3 minutes and 20 seconds
......@@ -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";
......
......@@ -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>
......
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