Skip to content
Snippets Groups Projects
Commit c010e54a authored by Imran Hussain's avatar Imran Hussain
Browse files

unread email status indicator

parent f6df1257
No related branches found
No related tags found
No related merge requests found
......@@ -222,11 +222,14 @@ private $datahash=''; // hash of data field
ldap_close($ldap);
// Check the user's email status
$mailstat = @stat("/var/spool/mail/".$user);
/*$mailstat = @stat("/var/spool/mail/".$user);
if ($mailstat[size]>0) {
if ($mailstat[mtime]>$mailstat[atime]) $this->email = 2;
else $this->email = 1;
}
}*/
// 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");
if (file_exists($info['homedirectory'][0]."/.forward")) {
$forward = file($info['homedirectory'][0]."/.forward");
......
......@@ -2,27 +2,19 @@
<form method="post" action="{$ssl_url|escape:'htmlall'}{getparams gets=$gets}">
<div>
{if $session->loggedin}
Logged in as <a href="{$baseurl}/Community/Members/{$session->username}">{$session->username}</a><br />
<a href="{$baseurl}/Options">Membership Options</a><br />
Logged in as <a href="{$baseurl}/Community/Members/{$session->username}">{$session->username}</a><br />
<a href="{$baseurl}/Options">Membership Options</a><br />
{if $session->email_forward}
Mail forwarded to {$session->email_forward}<br />
{else}
{if $session->email=="0"}
No new email<br />
{elseif $session->email=="1"}
<a href="https://sucs.org/webmail/">New email</a><br />
{/if}
{if $session->email_forward}
Mail forwarded to {$session->email_forward}<br />
{* Don't bother alerting users to new mail at present; it's all broken because of noatime
{else}
{if $session->email=="0"}
No email<br />
{elseif $session->email=="1"}
No new email<br />
{elseif $session->email=="2"}
<a href="https://sucs.org/webmail/">New email</a><br />
{/if}
*}
{/if}
<input type="submit" class="button" name="Logout" id="Logout" value="Logout" />
{/if}
<input type="submit" class="button" name="Logout" id="Logout" value="Logout" />
{else}
<input type="text" class="text" name="session_user" id="session_user" placeholder="Username" />
<input type="password" class="text" name="session_pass" id="session_pass" placeholder="Password" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment