[SUCS Devel] [Git][sucssite/sucs-site][master] 2 commits: Move the sucsunreadmail script to the plugins folder from my home dir

Imran Hussain imranh at sucs.org
Mon Sep 14 11:10:52 BST 2015


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


Commits:
feafd46c by Imran Hussain at 2015-09-14T11:09:03Z
Move the sucsunreadmail script to the plugins folder from my home dir

- - - - -
a4206f63 by Imran Hussain at 2015-09-14T11:10:19Z
Merge branch 'master' of projects.sucs.org:sucssite/sucs-site

- - - - -


2 changed files:

- lib/session.php
- + plugins/sucsunreadmail


Changes:

=====================================
lib/session.php
=====================================
--- a/lib/session.php
+++ b/lib/session.php
@@ -227,7 +227,7 @@ private $datahash='';		// hash of data field
 		}*/
 		// a sure-fire way to check to see if the user has any unread email
 		// the bash script returns 0 for no and 1 for yes, takes one arg, username
-		$this->email = shell_exec("/home/member/imranh/bin/sucsunreadmail $user");
+		$this->email = shell_exec("../plugins/sucsunreadmail $user");
 
 		if (file_exists($info['homedirectory'][0]."/.forward")) {
 			$forward = file($info['homedirectory'][0]."/.forward");


=====================================
plugins/sucsunreadmail
=====================================
--- /dev/null
+++ b/plugins/sucsunreadmail
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if finger -m $1 | grep "New mail" &> /dev/null
+	then
+		echo "1"
+	else
+		echo "0"
+fi
\ No newline at end of file



View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/compare/fbc34b606f88fca0593f07c38a655311628f4173...a4206f63445405303f0f93b3f7f59f19f80ee979
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20150914/10c305a2/attachment.html>


More information about the Devel mailing list