tazbug rev 53

bugs.cgi: Use $script/$SCRIPT_NAME rather than WEB_URL
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jan 07 15:22:49 2014 +0100 (2014-01-07)
parents 3acb15d87d6e
children e38bfadddc2f
files tazbug.conf web/bugs.cgi
line diff
     1.1 --- a/tazbug.conf	Tue Jan 07 15:14:34 2014 +0100
     1.2 +++ b/tazbug.conf	Tue Jan 07 15:22:49 2014 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz Bug Tracker tools configuration
     1.5  #
     1.6  
     1.7 -# TazBug URL to post bugs from cmdline
     1.8 +# TazBug URL to post bugs from cmdline and RSS
     1.9  WEB_URL="http://bugs.slitaz.org/"
    1.10  
    1.11  # Auth file for user
     2.1 --- a/web/bugs.cgi	Tue Jan 07 15:14:34 2014 +0100
     2.2 +++ b/web/bugs.cgi	Tue Jan 07 15:22:49 2014 +0100
     2.3 @@ -59,8 +59,8 @@
     2.4  </div>
     2.5  
     2.6  <div id="footer">
     2.7 -	<a href="$WEB_URL">SliTaz Bugs</a> -
     2.8 -	<a href="$WEB_URL?README">README</a>
     2.9 +	<a href="$script">SliTaz Bugs</a> -
    2.10 +	<a href="$script?README">README</a>
    2.11  </div>
    2.12  
    2.13  </body>
    2.14 @@ -143,7 +143,7 @@
    2.15  	cat << EOT
    2.16  
    2.17  <div id="search">
    2.18 -	<form method="get" action="$WEB_URL">
    2.19 +	<form method="get" action="$script">
    2.20  		<input type="text" name="search" placeholder="$(gettext 'Search')" />
    2.21  		<!-- <input type="submit" value="$(gettext 'Search')" /> -->
    2.22  	</form>
    2.23 @@ -281,7 +281,7 @@
    2.24  	fi
    2.25  	cat << EOT
    2.26  <h2>$(eval_gettext 'Bug $id: $STATUS')</h2>
    2.27 -<form method="get" action="$WEB_URL">
    2.28 +<form method="get" action="$script">
    2.29  
    2.30  <p>
    2.31  	$(get_gravatar $MAIL 32) <strong>$BUG</strong>
    2.32 @@ -395,7 +395,7 @@
    2.33  <h2>$(gettext "New Bug")</h2>
    2.34  <div id="newbug">
    2.35  
    2.36 -<form method="get" action="$WEB_URL" onsubmit="return checkNewBug();">
    2.37 +<form method="get" action="$script" onsubmit="return checkNewBug();">
    2.38  	<input type="hidden" name="addbug" />
    2.39  	<table>
    2.40  		<tbody>
    2.41 @@ -440,7 +440,7 @@
    2.42  <h2>$(eval_gettext 'Edit Bug $bug')</h2>
    2.43  <div id="edit">
    2.44  
    2.45 -<form method="get" action="$WEB_URL">
    2.46 +<form method="get" action="$script">
    2.47  	<textarea name="bugconf">$(cat $bugdir/$bug/bug.conf)</textarea>
    2.48  	<input type="hidden" name="bug" value="$bug" />
    2.49  	<input type="submit" value="$(gettext 'Save configuration')" />
    2.50 @@ -535,7 +535,7 @@
    2.51  
    2.52  		if [  ! -f $AUTH_FILE ] ; then
    2.53  			js_log "$AUTH_FILE (defined in \$AUTH_FILE) has not been found."
    2.54 -			js_redirection_to "$WEB_URL?login$IDLOC"
    2.55 +			js_redirection_to "$script?login$IDLOC"
    2.56  		fi;
    2.57  
    2.58  		valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2)
    2.59 @@ -548,10 +548,10 @@
    2.60  			echo "$md5session" > $sessions/$user
    2.61  			js_set_cookie 'auth' "$user:$md5session"
    2.62  			js_log "Login authentification has been executed & accepted :)"
    2.63 -			js_redirection_to "$WEB_URL$IDLOC"
    2.64 +			js_redirection_to "$script$IDLOC"
    2.65  		else
    2.66  			js_log "Login authentification has been executed & refused"
    2.67 -			js_redirection_to "$WEB_URL?login&error$IDLOC"
    2.68 +			js_redirection_to "$script?login&error$IDLOC"
    2.69  		fi
    2.70  		html_footer ;;
    2.71  	*\ signup\ *)
    2.72 @@ -619,7 +619,7 @@
    2.73  		if check_auth; then
    2.74  			rm -f "$sessions/$user"
    2.75  			js_unset_cookie 'auth'
    2.76 -			js_redirection_to "$WEB_URL"
    2.77 +			js_redirection_to "$script"
    2.78  		fi ;;
    2.79  	*\ user\ *)
    2.80  		# User profile
    2.81 @@ -651,7 +651,7 @@
    2.82  		html_header
    2.83  		if check_auth; then
    2.84  			new_bug
    2.85 -			js_redirection_to "$WEB_URL?id=$count"
    2.86 +			js_redirection_to "$script?id=$count"
    2.87  		fi ;;
    2.88  	*\ edit\ *)
    2.89  		bug="$(GET edit)"
    2.90 @@ -665,7 +665,7 @@
    2.91  		html_header
    2.92  		if check_auth; then
    2.93  			save_bug
    2.94 -			js_redirection_to "$WEB_URL?id=$bug"
    2.95 +			js_redirection_to "$script?id=$bug"
    2.96  		fi ;;
    2.97  	*\ id\ *)
    2.98  		# Empty deleted messages to keep msg count working.
    2.99 @@ -740,7 +740,7 @@
   2.100  		user_box
   2.101  		cat << EOT
   2.102  <h2>$(gettext "Search")</h2>
   2.103 -<form method="get" action="$WEB_URL">
   2.104 +<form method="get" action="$script">
   2.105  	<input type="text" name="search" />
   2.106  	<input type="submit" value="$(gettext 'Search')" />
   2.107  </form>