From feafd46c9d9b96a7a8d3fb49a79b8e7fa9b4ea54 Mon Sep 17 00:00:00 2001 From: Imran Hussain Date: Mon, 14 Sep 2015 11:09:03 +0100 Subject: [PATCH] Move the sucsunreadmail script to the plugins folder from my home dir --- lib/session.php | 2 +- plugins/sucsunreadmail | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100755 plugins/sucsunreadmail diff --git a/lib/session.php b/lib/session.php index cb2ac36..e0cc856 100644 --- 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"); diff --git a/plugins/sucsunreadmail b/plugins/sucsunreadmail new file mode 100755 index 0000000..ca3d1f5 --- /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 -- 2.24.1