Commit 1e8fa139 authored by Imran Hussain's avatar Imran Hussain

Fix r702 sneaking in a smarty 2 function

parent 93511244
...@@ -26,14 +26,14 @@ if (isset($session->groups[$permission])) { ...@@ -26,14 +26,14 @@ if (isset($session->groups[$permission])) {
if (trim ($_POST['why']) !== "") { if (trim ($_POST['why']) !== "") {
$number = intval($_POST['number']); $number = intval($_POST['number']);
$why = $_POST['why']; $why = $_POST['why'];
if ( (abs($number) <= $maxbanana ) && $number <> 0 ){ if ( (abs($number) <= $maxbanana ) && $number <> 0 ){
$DB->Query("INSERT INTO awards (username, score, whn, who, why) VALUES (?,?,NOW(),?,?)", array($who, $number, $session->username, $why)); $DB->Query("INSERT INTO awards (username, score, whn, who, why) VALUES (?,?,NOW(),?,?)", array($who, $number, $session->username, $why));
header("Location: " . $_SERVER['PHP_SELF']); header("Location: " . $_SERVER['PHP_SELF']);
} }
// Checks for a nonzero banana and denies awarding if it's zero // Checks for a nonzero banana and denies awarding if it's zero
elseif ( $number == 0 ){ elseif ( $number == 0 ){
trigger_error("Come on ".$session->username.", enter a nonzero value please"); trigger_error("Come on ".$session->username.", enter a nonzero value please");
...@@ -45,14 +45,14 @@ if (isset($session->groups[$permission])) { ...@@ -45,14 +45,14 @@ if (isset($session->groups[$permission])) {
} else { } else {
trigger_error("No reason entered for the awarding of bananas.", E_USER_WARNING); trigger_error("No reason entered for the awarding of bananas.", E_USER_WARNING);
} }
} }
} elseif ($session->loggedin) { } elseif ($session->loggedin) {
if ($_REQUEST['action'] == "award") { if ($_REQUEST['action'] == "award") {
$number = intval($_POST['number']); $number = intval($_POST['number']);
$why = $_POST['why']; $why = $_POST['why'];
// Send a mail to someone about them bananas // Send a mail to someone about them bananas
$msgbody = $session->username." thinks $who deserves $number bananas:\r\n"; $msgbody = $session->username." thinks $who deserves $number bananas:\r\n";
$msgbody .= "\"$why\"\r\n\r\nVisit https://sucs.org/Community/Members/$who if you want to make an award."; $msgbody .= "\"$why\"\r\n\r\nVisit https://sucs.org/Community/Members/$who if you want to make an award.";
mail($contact, "Banana Award Nomination", $msgbody, $msgheaders); mail($contact, "Banana Award Nomination", $msgbody, $msgheaders);
...@@ -62,7 +62,7 @@ if (isset($session->groups[$permission])) { ...@@ -62,7 +62,7 @@ if (isset($session->groups[$permission])) {
} }
$secondary = $smarty->get_template_vars("secondary"); $secondary = $smarty->getTemplateVars("secondary");
$secondary .= $smarty->fetch('banana-award.tpl'); $secondary .= $smarty->fetch('banana-award.tpl');
$smarty->assign('secondary', $secondary); $smarty->assign('secondary', $secondary);
......
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