tazbug view web/plugins/dashboard/dashboard.cgi @ rev 66

Add users plugin (splited from dashboard) and improve it. This plugin is compatible with TinyCM
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jan 07 23:17:19 2014 +0100 (2014-01-07)
parents 17bc5f665bf5
children 6144a840e058
line source
1 #!/bin/sh
2 #
3 # TazBug Plugin - Dashboard
4 #
5 . /usr/lib/slitaz/httphelper
7 case " $(GET) " in
8 *\ dashboard\ *)
9 d="Dashboard"
10 users=$(ls -1 $PEOPLE | wc -l)
11 bugs=$(ls -1 $bugdir | wc -l)
12 bugsize=$(du -sh $bugdir | awk '{print $1}')
13 header
14 html_header
15 user_box
16 if ! check_auth; then
17 gettext "You must be logged in to view the dashboard"
18 exit 0
19 fi
20 # Source all plugins configs to get DASHBOARD_TOOLS and ADMIN_TOOLS
21 for p in $(ls $plugins)
22 do
23 . $plugins/$p/$p.conf
24 done
25 if check_auth && ! admin_user; then
26 ADMIN_TOOLS=""
27 fi
28 cat << EOT
29 <h2>Dashboard</h2>
31 <div id="tools">
32 $DASHBOARD_TOOLS $ADMIN_TOOLS
33 </div>
35 <pre>
36 Users : $users
37 Bugs : $bugs
38 Bugsize : $bugsize
39 </pre>
41 <h3>Admin users</h3>
42 EOT
43 # Get the list of administrators
44 for u in $(ls $PEOPLE)
45 do
46 user=${u}
47 if admin_user; then
48 echo "<a href='?user=$u'>$u</a>"
49 fi
50 done
51 cat << EOT
52 <h3>$(gettext "Plugins")</h3>
53 <pre>
54 EOT
55 # List all plugins
56 for p in $(ls -1 $plugins)
57 do
58 . $plugins/$p/$p.conf
59 echo "<a href='?$p'>$PLUGIN</a> - $SHORT_DESC"
60 done
61 echo '</pre>'
62 html_footer && exit 0 ;;
63 esac