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