tazbug annotate web/plugins/mybugs/mybugs.cgi @ rev 147
mybugs plugin: some fix again!
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Feb 23 00:51:16 2017 +0100 (2017-02-23) |
parents | fb5c47b8d6f5 |
children | 6db228036db5 |
rev | line source |
---|---|
pankso@140 | 1 #!/bin/sh |
pankso@140 | 2 # |
pankso@144 | 3 # TinyCM/TazBug Plugin - List bugs and messages for a given user |
pankso@140 | 4 # |
pankso@140 | 5 |
pankso@140 | 6 if [ "$(GET mybugs)" ]; then |
pankso@140 | 7 d="My bugs" |
pankso@140 | 8 header |
pankso@140 | 9 html_header |
pankso@140 | 10 user_box |
pankso@140 | 11 if ! check_auth; then |
pankso@144 | 12 echo "You must be logged to view user bugs" |
pankso@140 | 13 html_footer && exit 0 |
pankso@140 | 14 fi |
pankso@144 | 15 if [ "$(GET user)" ]; then |
pankso@144 | 16 user="$(GET user)" |
pankso@144 | 17 . $PEOPLE/$user/account.conf |
pankso@144 | 18 fi |
pankso@141 | 19 echo "<h2><a href='?user=$USER'>$(get_gravatar "$MAIL" 48)</a> $NAME</h2>" |
pankso@144 | 20 |
pankso@144 | 21 if fgrep -q -l "CREATOR=\"$user\"" ${bugdir}/*/*/bug.conf; then |
pankso@144 | 22 echo "<h3>$(gettext 'My bugs')</h3>" |
pankso@144 | 23 echo "<pre>" |
pankso@144 | 24 for bug in $(fgrep -l "CREATOR=\"$user\"" ${bugdir}/*/*/bug.conf | \ |
pankso@147 | 25 xargs ls -lt | awk '{print $9}') |
pankso@144 | 26 do |
pankso@144 | 27 . ${bug} |
pankso@144 | 28 id=$(basename $(dirname $bug)) |
pankso@144 | 29 cat << EOT |
pankso@144 | 30 <img src='images/bug.png' alt='' /> \ |
pankso@144 | 31 Bug $id: <a href="?id=$id">$BUG</a> <span class="date">- $DATE</span> |
pankso@144 | 32 EOT |
pankso@144 | 33 done |
pankso@144 | 34 echo "</pre>" |
pankso@144 | 35 fi |
pankso@144 | 36 |
pankso@144 | 37 if fgrep -q -l "USER=\"$user\"" ${bugdir}/*/*/msg.*; then |
pankso@144 | 38 echo "<h3>Debug messages</h3>" |
pankso@144 | 39 echo "<pre>" |
pankso@144 | 40 for msg in $(fgrep -l "USER=\"$user\"" ${bugdir}/*/*/msg.* | \ |
pankso@147 | 41 xargs ls -lt | awk '{print $9}') |
pankso@144 | 42 do |
pankso@144 | 43 . ${msg} |
pankso@144 | 44 id=$(basename $(dirname $msg)) |
pankso@145 | 45 msgid=$(echo $msg | cut -d "." -f 2) |
pankso@147 | 46 message="$(fgrep MSG= $msg | cut -d \" -f 2 | cut -c 1-40)" |
pankso@144 | 47 cat << EOT |
pankso@144 | 48 <img src='images/bug.png' alt='' /> \ |
pankso@144 | 49 <a href="?id=$id">Bug $id:</a> <span class="date">$DATE</span> \ |
pankso@147 | 50 <a href="?id=$id#msg${msgid}">${message}...</a> |
pankso@144 | 51 EOT |
pankso@144 | 52 done |
pankso@144 | 53 echo "</pre>" |
pankso@144 | 54 fi |
pankso@144 | 55 |
pankso@140 | 56 html_footer && exit 0 |
pankso@140 | 57 fi |