[SUCS Devel] [Git][sucssite/sucs-site][master] Make the previous commit a little more robust and add some comments

Laurence Sebastian Bowes elbows at sucs.org
Wed Nov 11 16:07:49 GMT 2015


Laurence Sebastian Bowes pushed to branch master at sucssite / sucs-site


Commits:
5f85bd0d by Laurence Sebastian Bowes at 2015-11-11T16:07:28Z
Make the previous commit a little more robust and add some comments

- - - - -


3 changed files:

- components/bananas.php
- components/members.php
- lib/banana-admin.php


Changes:

=====================================
components/bananas.php
=====================================
--- a/components/bananas.php
+++ b/components/bananas.php
@@ -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) {


=====================================
components/members.php
=====================================
--- a/components/members.php
+++ b/components/members.php
@@ -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) {


=====================================
lib/banana-admin.php
=====================================
--- a/lib/banana-admin.php
+++ b/lib/banana-admin.php
@@ -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);



View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/commit/5f85bd0dd8d58c1b0dc672a0a4431dd9beeefe3f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20151111/717eccf2/attachment.html>


More information about the Devel mailing list