tazbug diff web/bugs.cgi @ rev 76
Admin can del messages, small css fix and add .hgignore
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Feb 04 22:26:37 2014 +0100 (2014-02-04) |
parents | 7a7e798ecd1c |
children | be084688e724 |
line diff
1.1 --- a/web/bugs.cgi Mon Feb 03 23:55:02 2014 +0100 1.2 +++ b/web/bugs.cgi Tue Feb 04 22:26:37 2014 +0100 1.3 @@ -23,18 +23,15 @@ 1.4 do 1.5 lang=${lang%;*} lang=${lang# } lang=${lang%-*} 1.6 case "$lang" in 1.7 - en) LANG="C" ;; 1.8 - de) LANG="de_DE" ;; 1.9 - es) LANG="es_ES" ;; 1.10 - fr) LANG="fr_FR" ;; 1.11 - it) LANG="it_IT" ;; 1.12 - pt) LANG="pt_BR" ;; 1.13 - ru) LANG="ru_RU" ;; 1.14 - zh) LANG="zh_TW" ;; 1.15 + en) LANG="C" && break ;; 1.16 + de) LANG="de_DE" && break ;; 1.17 + es) LANG="es_ES" && break ;; 1.18 + fr) LANG="fr_FR" && break ;; 1.19 + it) LANG="it_IT" && break ;; 1.20 + pt) LANG="pt_BR" && break ;; 1.21 + ru) LANG="ru_RU" && break ;; 1.22 + zh) LANG="zh_TW" && break ;; 1.23 esac 1.24 - if echo "$po" | fgrep -q "$lang"; then 1.25 - break 1.26 - fi 1.27 done 1.28 unset IFS 1.29 export LANG LC_ALL=$LANG 1.30 @@ -330,9 +327,10 @@ 1.31 if [ "$MSG" ]; then 1.32 msgid=$(echo $msg | cut -d "." -f 2) 1.33 del="" 1.34 - # User can delete his post. 1.35 - [ "$user" == "$USER" ] && \ 1.36 + # User can delete his post has well as admin. 1.37 + if [ "$user" == "$USER" ] || admin_user; then 1.38 del="<a href=\"?id=$id&delmsg=$msgid\">delete</a>" 1.39 + fi 1.40 cat << EOT 1.41 <p><strong>$USER</strong> $DATE $del</p> 1.42 <pre>