tazbug diff web/bugs.cgi @ rev 33

seperate .conf file & fix last commit on bugs.cgi
author xfred222
date Thu Dec 13 20:06:57 2012 -0500 (2012-12-13)
parents db97998089d6
children 8ec2f574923b
line diff
     1.1 --- a/web/bugs.cgi	Thu Dec 13 17:08:36 2012 -0500
     1.2 +++ b/web/bugs.cgi	Thu Dec 13 20:06:57 2012 -0500
     1.3 @@ -7,7 +7,6 @@
     1.4  . /usr/lib/slitaz/httphelper
     1.5  [ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf
     1.6  
     1.7 -
     1.8  # Internal variable
     1.9  bugdir="bug"
    1.10  plugins="plugins"
    1.11 @@ -15,11 +14,6 @@
    1.12  po=""
    1.13  error_log_file="/var/log/tazbug-server.log"
    1.14  
    1.15 -
    1.16 -
    1.17 -
    1.18 -
    1.19 -
    1.20  # Content negotiation for Gettext
    1.21  IFS=","
    1.22  for lang in $HTTP_ACCEPT_LANGUAGE
    1.23 @@ -47,6 +41,11 @@
    1.24  TEXTDOMAIN='tazbug'
    1.25  export TEXTDOMAIN
    1.26  
    1.27 +
    1.28 +
    1.29 +
    1.30 +
    1.31 +
    1.32  #
    1.33  # Functions
    1.34  #
    1.35 @@ -88,6 +87,13 @@
    1.36  
    1.37  # Authentified or not
    1.38  user_box() {
    1.39 +
    1.40 +#bug id to remember
    1.41 +IDLOC=""
    1.42 +if [[ "$(GET id)" ]] ;then
    1.43 +IDLOC="&id=$(GET id)"
    1.44 +fi
    1.45 +
    1.46  	if check_auth; then
    1.47  		. $PEOPLE/$user/account.conf
    1.48  		cat << EOT
    1.49 @@ -98,10 +104,10 @@
    1.50  EOT
    1.51  	else
    1.52  	cat << EOT
    1.53 -<div id="user">
    1.54 -	<a href="?login"><img src="images/avatar.png" alt="[ User ]" /></a>
    1.55 -	<a href="?login">$(gettext 'Log in')</a>
    1.56 -</div>
    1.57 +	<div id="user">
    1.58 +	<a href="?login$IDLOC"><img src="images/avatar.png" alt="[ User ]" /></a>
    1.59 +	<a href="?login$IDLOC">$(gettext 'Log in')</a>
    1.60 +	</div>
    1.61  EOT
    1.62  	fi
    1.63  	cat << EOT
    1.64 @@ -121,7 +127,12 @@
    1.65  
    1.66  # Login page
    1.67  login_page() {
    1.68 -redirect_to_id="$1"
    1.69 +IDLOC=""
    1.70 +if [[ "$(GET id)" ]] ;then
    1.71 +IDLOC="?id=$(GET id)"
    1.72 +fi
    1.73 +
    1.74 +
    1.75  	cat << EOT
    1.76  <h2>$(gettext 'Login')</h2>
    1.77  
    1.78 @@ -133,7 +144,7 @@
    1.79  </div>
    1.80  
    1.81  <div id="login">
    1.82 -	<form method="post" action="$SCRIPT_NAME?id=$redirect_to_id">
    1.83 +	<form method="post" action="$SCRIPT_NAME$IDLOC">
    1.84  		<input type="text" name="auth" placeholder="$(gettext 'User name')" />
    1.85  		<input type="password" name="pass" placeholder="$(gettext 'Password')" />
    1.86  		<div>
    1.87 @@ -488,7 +499,7 @@
    1.88  		header
    1.89  		html_header
    1.90  		user_box
    1.91 -		login_page $([ "$(GET id)" ] && GET id)
    1.92 +		login_page
    1.93  		html_footer ;;
    1.94  	*\ logout\ *)
    1.95  		# Set a Cookie in the past to logout.