# HG changeset patch # User Christophe Lincoln # Date 1486741899 -3600 # Node ID bcaad2bc76c84dfbd4793f1a65aec2f079aea2d2 # Parent f3aff0cd72297dc2c5dda0719de692e94e906dab Small fixes and improvments to plugins diff -r f3aff0cd7229 -r bcaad2bc76c8 web/plugins/dashboard/dashboard.cgi --- a/web/plugins/dashboard/dashboard.cgi Fri Feb 10 15:27:11 2017 +0100 +++ b/web/plugins/dashboard/dashboard.cgi Fri Feb 10 16:51:39 2017 +0100 @@ -4,28 +4,28 @@ # if [ "$(GET dashboard)" ]; then - d="Dashboard" - users=$(ls -1 $PEOPLE | wc -l) - bugs=$(ls -1 $bugdir | wc -l) - bugsize=$(du -sh $bugdir | awk '{print $1}') - header - html_header - user_box - if ! check_auth; then - gettext "You must be logged in to view the dashboard" - exit 0 - fi - # Source all plugins.conf to get DASHBOARD_TOOLS and ADMIN_TOOLS + d="Dashboard" + header + html_header + user_box + if ! check_auth; then + gettext "You must be logged in to view the dashboard" + exit 0 + fi + users=$(ls -1 $PEOPLE | wc -l) + bugs=$(ls -1 $bugdir | wc -l) + bugsize=$(du -sh $bugdir | awk '{print $1}') + # Source all plugins.conf to get DASHBOARD_TOOLS and ADMIN_TOOLS + ADMIN_TOOLS="" + DASHBOARD_TOOLS="" + for p in $(ls $plugins) + do + . $plugins/$p/$p.conf + done + if check_auth && ! admin_user; then ADMIN_TOOLS="" - DASHBOARD_TOOLS="" - for p in $(ls $plugins) - do - . $plugins/$p/$p.conf - done - if check_auth && ! admin_user; then - ADMIN_TOOLS="" - fi - cat << EOT + fi + cat << EOT

Dashboard

@@ -43,21 +43,21 @@

$(gettext "Plugins")

 EOT
-		for p in $(ls -1 $plugins)
-		do
-			. $plugins/$p/$p.conf
-			echo "$PLUGIN - $SHORT_DESC"
-		done
-		echo '
' - - # Get the list of administrators - echo "

Admin users

" - for u in $(ls $PEOPLE) - do - user=${u} - if admin_user; then - echo "$u" - fi - done - html_footer && exit 0 + for p in $(ls -1 $plugins) + do + . $plugins/$p/$p.conf + echo "$PLUGIN - $SHORT_DESC" + done + echo '' + + # Get the list of administrators + echo "

Admin users

" + for u in $(ls $PEOPLE) + do + user=${u} + if admin_user; then + echo "$u" + fi + done + html_footer && exit 0 fi diff -r f3aff0cd7229 -r bcaad2bc76c8 web/plugins/pkgs/pkgs.cgi --- a/web/plugins/pkgs/pkgs.cgi Fri Feb 10 15:27:11 2017 +0100 +++ b/web/plugins/pkgs/pkgs.cgi Fri Feb 10 16:51:39 2017 +0100 @@ -1,6 +1,6 @@ #!/bin/sh # -# TazBug Plugin - Skeleton +# TazBug Plugin - List packages # if [ "$(GET packages)" ] || [ "$(GET pkg)" ]; then diff -r f3aff0cd7229 -r bcaad2bc76c8 web/plugins/skel/skel.cgi --- a/web/plugins/skel/skel.cgi Fri Feb 10 15:27:11 2017 +0100 +++ b/web/plugins/skel/skel.cgi Fri Feb 10 16:51:39 2017 +0100 @@ -8,8 +8,13 @@ header html_header user_box - echo "

Plugin Skel

" - echo $(date) + cat << EOT +

Plugin Skel

+ +EOT + echo "

$(date)

" # Say we use files in $DATA/skel, sort them by date and simply cat # the files, this will create a simple blog :-) We may add post via diff -r f3aff0cd7229 -r bcaad2bc76c8 web/plugins/users/users.conf --- a/web/plugins/users/users.conf Fri Feb 10 15:27:11 2017 +0100 +++ b/web/plugins/users/users.conf Fri Feb 10 16:51:39 2017 +0100 @@ -6,7 +6,7 @@ # Authenticated users PLUGINS_TOOLS="${PLUGINS_TOOLS}" -DASHBOARD_TOOLS="Logged users" +DASHBOARD_TOOLS="${DASHBOARD_TOOLS} Logged users" # Admin only in Dashboard ADMIN_TOOLS="${ADMIN_TOOLS} List users"