tazbug view web/plugins/debug/debug.cgi @ rev 105
Overall improvments
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Feb 10 18:12:00 2017 +0100 (2017-02-10) |
parents | 6f798394f27e |
children | b9aaee394e0c |
line source
1 #!/bin/sh
2 #
3 # TazBug Plugin - Debug Tazbug :-)
4 #
6 if [ "$(GET debug)" ]; then
7 d="Debug"
8 header
9 html_header
10 user_box
11 if check_auth && ! admin_user; then
12 gettext "You must be admin to debug"
13 exit 0
14 fi
15 cat << EOT
16 <h2>Debug interface</h2>
17 <div id="tools">
18 <a href="$script?dashboard">Dashboard</a>
19 </div>
20 EOT
21 # Handle ?debug&del request
22 if [ "$(GET del)" ]; then
23 id="$(GET del)"
24 if [ -d "${bugdir}/${id}" ]; then
25 echo -n "<pre>Removing bug ID: $id... "
26 rm -rf ${bugdir}/${id}
27 echo "Done</pre>"
28 fi
29 fi
31 # Check for bug DB consitensy
32 echo "<h3>Checking for bug.conf consistency</h3>"
33 for id in $(ls $bugdir | sort -g)
34 do
35 if [ $(cat ${bugdir}/${id}/bug.conf | wc -l) != 8 ]; then
36 echo "<pre>"
37 echo -e "ERROR: bug ID $id - <a href='?edit=$id'>Edit</a>\
38 - <a href='?debug&del=$id'>Delete</a>\n"
39 cat ${bugdir}/${id}/bug.conf
40 echo "</pre>"
41 fi
42 done
43 echo "$(ls -1 $bugdir | wc -l) bugs scanned"
45 html_footer & exit 0
46 fi