# HG changeset patch # User Christophe Lincoln # Date 1336375585 -7200 # Node ID ea58d117d71afd34c112d06aafde04bc478e47be # Parent bc985f3f94f0cf31f7f963e52c9464dc2906549d login page: we alrady have content diff -r bc985f3f94f0 -r ea58d117d71a web/bugs.cgi --- a/web/bugs.cgi Wed Apr 11 17:42:48 2012 +0200 +++ b/web/bugs.cgi Mon May 07 09:26:25 2012 +0200 @@ -12,21 +12,29 @@ bugdir="bug" plugins="plugins" sessions="/tmp/tazbug/sessions" +po="" # Content negotiation for Gettext IFS="," for lang in $HTTP_ACCEPT_LANGUAGE do lang=${lang%;*} lang=${lang# } lang=${lang%-*} - [ -d "$lang" ] && break case "$lang" in - en) lang="C" ;; - fr) lang="fr_FR" ;; - ru) lang="ru_RU" ;; + en) LANG="C" ;; + de) LANG="de_DE" ;; + es) LANG="es_ES" ;; + fr) LANG="fr_FR" ;; + it) LANG="it_IT" ;; + pt) LANG="pt_BR" ;; + ru) LANG="ru_RU" ;; + zh) LANG="zh_TW" ;; esac + if echo "$po" | fgrep -q "$lang"; then + break + fi done unset IFS -export LANG=$lang LC_ALL=$lang +export LANG LC_ALL=$LANG # Internationalization: $(gettext "") . /usr/bin/gettext.sh @@ -106,9 +114,6 @@ # Login page login_page() { cat << EOT - -
-

$(gettext "Login")

@@ -207,7 +212,7 @@ EOT if check_auth; then if [ "$STATUS" == "OPEN" ]; then - cat << EOT + cat << EOT $(gettext "Close bug") $(gettext "Edit bug") EOT @@ -245,7 +250,7 @@ cat << EOT

$(gettext "New message")

- +

@@ -358,7 +363,7 @@ save_bug() { bug="$(GET bug)" content="$(GET bugconf)" - sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.conf << EOT + sed s'/"/\'/' | sed "s/$(echo -en '\r') /\n/g" > $bugdir/$bug/bug.conf << EOT $content EOT } @@ -452,7 +457,7 @@ echo '

README

' echo '
'
 		cat /usr/share/doc/tazbug/README
-		echo '
' + echo '' html_footer ;; *\ closed\ *) # Show all closed bugs. @@ -465,10 +470,10 @@ # The login page [ "$(GET error)" ] && \ error="$(gettext "Bad login or pass")" - header + header html_header user_box - login_page + login_page html_footer ;; *\ logout\ *) # Set a Cookie in the past to logout. @@ -528,9 +533,9 @@ [ "$(GET delmsg)" ] && rm -f $bugdir/$id/msg.$(GET delmsg) && \ touch $bugdir/$id/msg.$(GET delmsg) msgs=$(fgrep MSG= $bugdir/$id/msg.* | wc -l) - header + header html_header - user_box + user_box . $bugdir/$id/bug.conf bug_page html_footer ;; @@ -543,7 +548,7 @@ echo "ERROR: User already exists" && exit 1 else echo "Creating account for : $(GET name)" - new_user_config + new_user_config fi ;; *\ key\ *) # Let user post new bug or message with crypted key (no gettext) @@ -553,7 +558,7 @@ key="$(GET key)" id="$(GET bug)" header "Content-type: text/plain;" - echo "Checking secure key..." + echo "Checking secure key..." if fgrep -qH $key $PEOPLE/*/account.conf; then conf=$(fgrep -H $key $PEOPLE/*/account.conf | cut -d ":" -f 1) . $conf @@ -565,10 +570,10 @@ echo "Message: $(GET msg)" new_msg ;; *\ bug\ *) - echo "Adding new bug: $(GET bug)" - echo "Description: $(GET desc)" + echo "Adding new bug: $(GET bug)" + echo "Description: $(GET desc)" new_bug ;; - esac + esac else echo "Not a valid SliTaz user key" exit 0 @@ -585,7 +590,7 @@
EOT - + #found=0 JS to notify or write results nb under the search box. for bug in $bugdir/* do @@ -628,9 +633,9 @@

- Please read the README for help and more + Please read the README for help and more information. You may also be interested by the SliTaz - Roadmap and the packages + Roadmap and the packages Cooker. To perform a search enter your term and press ENTER.