tazbug view web/plugins/users/users.cgi @ rev 70
Tiny edits
author | Paul Issott <paul@slitaz.org> |
---|---|
date | Wed Jan 08 16:25:52 2014 +0000 (2014-01-08) |
parents | 95ac80c4d7b2 |
children | 00b8f6d05cd7 |
line source
1 #!/bin/sh
2 #
3 # TinyCM/TazBug Plugin - Users Admin
4 #
5 . /usr/lib/slitaz/httphelper
7 case " $(GET) " in
8 *\ users\ *)
9 d="Users"
10 header
11 html_header
12 user_box
13 if check_auth && ! admin_user; then
14 gettext "You must be admin to manage users"
15 exit 0
16 fi
17 users=$(ls -1 $PEOPLE | wc -l)
18 cat << EOT
19 <h2>Users: $users</h2>
20 <div id="tools">
21 <a href="$script?dashboard">Dashboard</a>
22 <a href='?online'>Online users</a>
23 </div>
24 <pre>
25 EOT
26 for u in $(ls $PEOPLE)
27 do
28 . "${PEOPLE}/${u}/account.conf"
29 cat << EOT
30 $(get_gravatar $MAIL 24) <a href="?user=$USER">$USER</a> | $NAME | $MAIL
31 EOT
32 # deluser link
33 #: <a href="?users&deluser=$USER">$(gettext "delete")</a>
34 unset NAME USER
35 done
36 echo "</pre>" && exit 0 ;;
38 *\ logged\ *)
39 # Show online users based on sessions files.
40 d="Logged users"
41 header
42 html_header
43 user_box
44 if ! check_auth; then
45 gettext "You must be logged in to view online users"
46 exit 0
47 fi
48 cat << EOT
49 <h2>Logged users</h2>
50 <div id="tools">
51 <a href="$script?dashboard">Dashboard</a>
52 </div>
53 <pre>
54 EOT
55 for u in $(ls $sessions)
56 do
57 . "${PEOPLE}/${u}/account.conf"
58 cat << EOT
59 $(get_gravatar $MAIL 24) <a href="?user=$USER">$USER</a> | $NAME
60 EOT
61 done
62 echo "</pre>"
63 html_footer && exit 0 ;;
64 esac