Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sucs-site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Imran Hussain
sucs-site
Commits
c010e54a
Commit
c010e54a
authored
10 years ago
by
Imran Hussain
Browse files
Options
Downloads
Patches
Plain Diff
unread email status indicator
parent
f6df1257
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/session.php
+5
-2
5 additions, 2 deletions
lib/session.php
templates/login.tpl
+12
-20
12 additions, 20 deletions
templates/login.tpl
with
17 additions
and
22 deletions
lib/session.php
+
5
−
2
View file @
c010e54a
...
...
@@ -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"
);
...
...
This diff is collapsed.
Click to expand it.
templates/login.tpl
+
12
−
20
View file @
c010e54a
...
...
@@ -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"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment