Make the previous commit a little more robust and add some comments

parent 54d868d5
......@@ -24,6 +24,7 @@ if (count($members->memberView($who)) > 0) {
header("Location: https://$preferred_hostname$baseurl/Community/Members/$who");
} else {
// banana admin bits
// Tell the banana library that the person/organisation/thing we're dealing with isn't a SUCS member
$isnonmember = true;
if ($mode == "detail") {
if ($session->loggedin) {
......
......@@ -32,7 +32,9 @@ if ($session->loggedin) {
if (count($usernames) == 1) {
$smarty->assign('who', $usernames[0]['uid']);
// Add banana widget to the sidebar
$who = $usernames[0]['uid'];
$who = $usernames[0]['uid'];
//Tell the banana library that we're dealing with a real member
$isnonmember = false;
include("../lib/banana-admin.php");
// Needs Redirection
if ($uid) {
......
......@@ -51,6 +51,7 @@ if (isset($session->groups[$permission])) {
// Send a mail to someone about them bananas
$msgbody = $session->username . " thinks $who deserves $number bananas:\r\n";
//Make sure we send out the right link depending on whether they are a member or not
$msgbody .= "\"$why\"\r\n\r\nVisit https://sucs.org/Community/" . ($isnonmember ? 'Bananas' : 'Members') . "/$who if you want to make an award.";
mail($contact, "Banana Award Nomination", $msgbody, $msgheaders);
$smarty->assign("awarded", TRUE);
......
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