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