tazbug rev 52

Handle better configs files, dont use TAZBUG path but PWD and misc improvments
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jan 07 15:14:34 2014 +0100 (2014-01-07)
parents 668d92a43a47
children 1995b2fd9270
files bugs.conf po/fr.po tazbug tazbug-box tazbug.conf web/bugs.cgi web/bugs.conf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/bugs.conf	Tue Jan 07 15:14:34 2014 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +# SliTaz Bug Tracker Web interface configuration. This config file will
     1.5 +# overwrite: /etc/slitaz/tazbug.conf
     1.6 +#
     1.7 +
     1.8 +# TazBug URL for redirection and RSS
     1.9 +WEB_URL="http://localhost/bugs/bugs.cgi"
    1.10 +
    1.11 +# Auth file for user
    1.12 +AUTH_FILE="/var/lib/slitaz/auth/people"
    1.13 +
    1.14 +# People config files
    1.15 +PEOPLE="/var/lib/slitaz/people"
    1.16 +
    1.17 +# Online registration for user
    1.18 +ONLINE_SIGNUP="yes"
     2.1 --- a/po/fr.po	Mon Jan 06 16:58:23 2014 +0000
     2.2 +++ b/po/fr.po	Tue Jan 07 15:14:34 2014 +0100
     2.3 @@ -13,7 +13,7 @@
     2.4  "Language-Team: French \n"
     2.5  "Language: fr \n"
     2.6  "MIME-Version: 1.0\n"
     2.7 -"Content-Type: text/plain; charset=CHARSET\n"
     2.8 +"Content-Type: text/plain; charset=UTF-8\n"
     2.9  "Content-Transfer-Encoding: 8bit\n"
    2.10  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
    2.11  
     3.1 --- a/tazbug	Mon Jan 06 16:58:23 2014 +0000
     3.2 +++ b/tazbug	Tue Jan 07 15:14:34 2014 +0100
     3.3 @@ -3,7 +3,7 @@
     3.4  # TazBug Command line tool. Help to encrypt password, key and post on the
     3.5  # the server side.
     3.6  #
     3.7 -# Copyright (C) 2012 SliTaz GNU/Linux - BSD License
     3.8 +# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
     3.9  #
    3.10  . /usr/lib/slitaz/httphelper
    3.11  [ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
     4.1 --- a/tazbug-box	Mon Jan 06 16:58:23 2014 +0000
     4.2 +++ b/tazbug-box	Tue Jan 07 15:14:34 2014 +0100
     4.3 @@ -4,7 +4,7 @@
     4.4  # if we use it for other sites and services so we use one centralized
     4.5  # SliTaz account.
     4.6  #
     4.7 -# Copyright (C) 2012 SliTaz GNU/Linux - BSD License
     4.8 +# Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
     4.9  #
    4.10  # Authors : Christophe Lincoln <pankso@slitaz.org>
    4.11  #
     5.1 --- a/tazbug.conf	Mon Jan 06 16:58:23 2014 +0000
     5.2 +++ b/tazbug.conf	Tue Jan 07 15:14:34 2014 +0100
     5.3 @@ -1,10 +1,7 @@
     5.4 -# SliTaz Bug Tracker configuration
     5.5 +# SliTaz Bug Tracker tools configuration
     5.6  #
     5.7  
     5.8 -# Installation path
     5.9 -TAZBUG="/var/www/bugs"
    5.10 -
    5.11 -# TazBug URL for redirection and RSS
    5.12 +# TazBug URL to post bugs from cmdline
    5.13  WEB_URL="http://bugs.slitaz.org/"
    5.14  
    5.15  # Auth file for user
    5.16 @@ -12,3 +9,6 @@
    5.17  
    5.18  # People config files
    5.19  PEOPLE="/var/lib/slitaz/people"
    5.20 +
    5.21 +# Online registration for user
    5.22 +ONLINE_SIGNUP="yes"
     6.1 --- a/web/bugs.cgi	Mon Jan 06 16:58:23 2014 +0000
     6.2 +++ b/web/bugs.cgi	Tue Jan 07 15:14:34 2014 +0100
     6.3 @@ -5,15 +5,17 @@
     6.4  # Copyright (C) 2012-2014 SliTaz GNU/Linux - BSD License
     6.5  #
     6.6  . /usr/lib/slitaz/httphelper
     6.7 +
     6.8 +# Source config file
     6.9 +[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf
    6.10 +# Web interface can have different setting than cmdline tools
    6.11  [ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf
    6.12 -#. bugs.conf
    6.13  
    6.14  # Internal variable
    6.15 -bugdir="$TAZBUG/bug"
    6.16 +bugdir="$PWD/bug"
    6.17  plugins="plugins"
    6.18  sessions="/tmp/bugs/sessions"
    6.19  script="$SCRIPT_NAME"
    6.20 -po=""
    6.21  
    6.22  # Content negotiation for Gettext
    6.23  IFS=","
    6.24 @@ -66,37 +68,30 @@
    6.25  EOT
    6.26  }
    6.27  
    6.28 -GETfiltered()
    6.29 -{
    6.30 -GET $1 | sed -e "s/'/\&#39;/g; s|\n|<br/>|g; s/\t/\&#09;/g;s/\%22/\"/g"
    6.31 +GETfiltered() {
    6.32 +	GET $1 | sed -e "s/'/\&#39;/g; s|\n|<br/>|g; s/\t/\&#09;/g;s/\%22/\"/g"
    6.33  }
    6.34  
    6.35 -js_redirection_to()
    6.36 -{
    6.37 +js_redirection_to() {
    6.38  	js_log "Redirecting to $1"
    6.39  	echo "<script type=\"text/javascript\"> document.location = \"$1\"; </script>"
    6.40  }
    6.41  
    6.42 -js_log()
    6.43 -{
    6.44 +js_log() {
    6.45  	echo "<script type=\"text/javascript\">console.log('$1')</script>";
    6.46  }
    6.47  
    6.48 -js_set_cookie()
    6.49 -{
    6.50 +js_set_cookie() {
    6.51  	name=$1
    6.52  	value=$2
    6.53 -
    6.54  	js_log 'Setting cookie.'
    6.55  	echo "<script type=\"text/javascript\">"
    6.56  		echo "document.cookie = \"$name=$value; expires=0; path=/\"";
    6.57  	echo "</script>"
    6.58  }
    6.59  
    6.60 -js_unset_cookie()
    6.61 -{
    6.62 +js_unset_cookie() {
    6.63  	name=$1
    6.64 -
    6.65  	js_log 'Unsetting cookie.'
    6.66  	echo "<script type=\"text/javascript\">"
    6.67  		echo "document.cookie = \"$1=\"\"; expires=-1; path=/";
     7.1 --- a/web/bugs.conf	Mon Jan 06 16:58:23 2014 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,17 +0,0 @@
     7.4 -# SliTaz Bug Tracker configuration
     7.5 -#
     7.6 -
     7.7 -# Installation path
     7.8 -TAZBUG="/var/www/bugs"
     7.9 -
    7.10 -# TazBug URL for redirection and RSS
    7.11 -WEB_URL="http://localhost/bugs/bugs.cgi"
    7.12 -
    7.13 -# Auth file for user
    7.14 -AUTH_FILE="/var/lib/slitaz/auth/people"
    7.15 -
    7.16 -# People config files
    7.17 -PEOPLE="/var/lib/slitaz/people"
    7.18 -
    7.19 -# Online registration for user
    7.20 -ONLINE_SIGNUP="yes"