tazbug diff web/plugins/dashboard/dashboard.cgi @ rev 100
Small fixes and improvments to plugins
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Feb 10 16:51:39 2017 +0100 (2017-02-10) |
parents | f3aff0cd7229 |
children | 8bda6c6b79a6 |
line diff
1.1 --- a/web/plugins/dashboard/dashboard.cgi Fri Feb 10 15:27:11 2017 +0100 1.2 +++ b/web/plugins/dashboard/dashboard.cgi Fri Feb 10 16:51:39 2017 +0100 1.3 @@ -4,28 +4,28 @@ 1.4 # 1.5 1.6 if [ "$(GET dashboard)" ]; then 1.7 - d="Dashboard" 1.8 - users=$(ls -1 $PEOPLE | wc -l) 1.9 - bugs=$(ls -1 $bugdir | wc -l) 1.10 - bugsize=$(du -sh $bugdir | awk '{print $1}') 1.11 - header 1.12 - html_header 1.13 - user_box 1.14 - if ! check_auth; then 1.15 - gettext "You must be logged in to view the dashboard" 1.16 - exit 0 1.17 - fi 1.18 - # Source all plugins.conf to get DASHBOARD_TOOLS and ADMIN_TOOLS 1.19 + d="Dashboard" 1.20 + header 1.21 + html_header 1.22 + user_box 1.23 + if ! check_auth; then 1.24 + gettext "You must be logged in to view the dashboard" 1.25 + exit 0 1.26 + fi 1.27 + users=$(ls -1 $PEOPLE | wc -l) 1.28 + bugs=$(ls -1 $bugdir | wc -l) 1.29 + bugsize=$(du -sh $bugdir | awk '{print $1}') 1.30 + # Source all plugins.conf to get DASHBOARD_TOOLS and ADMIN_TOOLS 1.31 + ADMIN_TOOLS="" 1.32 + DASHBOARD_TOOLS="" 1.33 + for p in $(ls $plugins) 1.34 + do 1.35 + . $plugins/$p/$p.conf 1.36 + done 1.37 + if check_auth && ! admin_user; then 1.38 ADMIN_TOOLS="" 1.39 - DASHBOARD_TOOLS="" 1.40 - for p in $(ls $plugins) 1.41 - do 1.42 - . $plugins/$p/$p.conf 1.43 - done 1.44 - if check_auth && ! admin_user; then 1.45 - ADMIN_TOOLS="" 1.46 - fi 1.47 - cat << EOT 1.48 + fi 1.49 + cat << EOT 1.50 <h2>Dashboard</h2> 1.51 1.52 <div id="tools"> 1.53 @@ -43,21 +43,21 @@ 1.54 <h3>$(gettext "Plugins")</h3> 1.55 <pre> 1.56 EOT 1.57 - for p in $(ls -1 $plugins) 1.58 - do 1.59 - . $plugins/$p/$p.conf 1.60 - echo "<a href='?$p'>$PLUGIN</a> - $SHORT_DESC" 1.61 - done 1.62 - echo '</pre>' 1.63 - 1.64 - # Get the list of administrators 1.65 - echo "<h3>Admin users</h3>" 1.66 - for u in $(ls $PEOPLE) 1.67 - do 1.68 - user=${u} 1.69 - if admin_user; then 1.70 - echo "<a href='?user=$u'>$u</a>" 1.71 - fi 1.72 - done 1.73 - html_footer && exit 0 1.74 + for p in $(ls -1 $plugins) 1.75 + do 1.76 + . $plugins/$p/$p.conf 1.77 + echo "<a href='?$p'>$PLUGIN</a> - $SHORT_DESC" 1.78 + done 1.79 + echo '</pre>' 1.80 + 1.81 + # Get the list of administrators 1.82 + echo "<h3>Admin users</h3>" 1.83 + for u in $(ls $PEOPLE) 1.84 + do 1.85 + user=${u} 1.86 + if admin_user; then 1.87 + echo "<a href='?user=$u'>$u</a>" 1.88 + fi 1.89 + done 1.90 + html_footer && exit 0 1.91 fi