tazbug view web/plugins/dashboard/dashboard.cgi @ rev 54
bigger font for preformated text, small improvment to dashboard plugin
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Jan 07 15:35:49 2014 +0100 (2014-01-07) |
parents | 02a11d8d636e |
children | f005632d7c8b |
line source
1 #!/bin/sh
2 #
3 # TinyCM/TazBug Plugin - Dashboard
4 #
5 . /usr/lib/slitaz/httphelper
7 case " $(GET) " in
8 *\ users\ *)
9 d="Dashboard"
10 header
11 html_header
12 user_box
13 if ! 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 </div>
23 <pre>
24 EOT
25 for u in $(ls $PEOPLE)
26 do
27 . "${PEOPLE}/${u}/account.conf"
28 cat << EOT
29 $(get_gravatar $MAIL 24) <a href="?user=$USER">$USER</a> | $NAME
30 EOT
31 # deluser link
32 #: <a href="?users&deluser=$USER">$(gettext "delete")</a>
33 unset NAME USER
34 done
35 echo "</pre>" && exit 0 ;;
37 *\ dashboard\ *)
38 d="Dashboard"
39 users=$(ls -1 $PEOPLE | wc -l)
40 bugs=$(ls -1 $bugdir | wc -l)
41 bugsize=$(du -sh $bugdir | awk '{print $1}')
42 header
43 html_header
44 user_box
45 if ! check_auth; then
46 gettext "You must be logged in to view the dashboard."
47 exit 0
48 fi
49 if admin_user; then
50 admintools="<a href='?users'>Users</a>"
51 fi
52 cat << EOT
53 <h2>Dashboard</h2>
54 <pre>
55 Users : $users
56 Bugs : $bugs
57 Bugsize : $bugsize
58 </pre>
59 <div id="tools">
60 $admintools
61 </div>
62 <h3>Admin users</h3>
63 EOT
64 # Get the list of administrators
65 for u in $(ls $PEOPLE)
66 do
67 user=${u}
68 if admin_user; then
69 echo "<a href='?user=$u'>$u</a>"
70 fi
71 done
72 cat << EOT
73 <h3>$(gettext "Plugins")</h3>
74 <pre>
75 EOT
76 for p in $(ls -1 $plugins)
77 do
78 . $plugins/$p/$p.conf
79 echo "<a href='?$p'>$PLUGIN</a> - $SHORT_DESC"
80 done
81 echo '</pre>'
82 html_footer
83 exit 0 ;;
84 esac