tazbug rev 32
added bug location redirect after login and change the config file name due to conflict between new tazbug-website and
client.
client.
author | xfred222 |
---|---|
date | Thu Dec 13 17:08:36 2012 -0500 (2012-12-13) |
parents | c5da10e6e749 |
children | 24effe14f521 |
files | web/bugs.cgi |
line diff
1.1 --- a/web/bugs.cgi Sun Jul 01 22:26:53 2012 +0000 1.2 +++ b/web/bugs.cgi Thu Dec 13 17:08:36 2012 -0500 1.3 @@ -5,14 +5,20 @@ 1.4 # Copyright (C) 2012 SliTaz GNU/Linux - BSD License 1.5 # 1.6 . /usr/lib/slitaz/httphelper 1.7 -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf 1.8 -[ -f "../tazbug.conf" ] && . ../tazbug.conf 1.9 +[ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf 1.10 + 1.11 1.12 # Internal variable 1.13 bugdir="bug" 1.14 plugins="plugins" 1.15 sessions="/tmp/tazbug/sessions" 1.16 po="" 1.17 +error_log_file="/var/log/tazbug-server.log" 1.18 + 1.19 + 1.20 + 1.21 + 1.22 + 1.23 1.24 # Content negotiation for Gettext 1.25 IFS="," 1.26 @@ -65,6 +71,8 @@ 1.27 EOT 1.28 } 1.29 1.30 + 1.31 + 1.32 # Check if user is auth 1.33 check_auth() { 1.34 auth="$(COOKIE auth)" 1.35 @@ -113,6 +121,7 @@ 1.36 1.37 # Login page 1.38 login_page() { 1.39 +redirect_to_id="$1" 1.40 cat << EOT 1.41 <h2>$(gettext 'Login')</h2> 1.42 1.43 @@ -124,7 +133,7 @@ 1.44 </div> 1.45 1.46 <div id="login"> 1.47 - <form method="post" action="$SCRIPT_NAME"> 1.48 + <form method="post" action="$SCRIPT_NAME?id=$redirect_to_id"> 1.49 <input type="text" name="auth" placeholder="$(gettext 'User name')" /> 1.50 <input type="password" name="pass" placeholder="$(gettext 'Password')" /> 1.51 <div> 1.52 @@ -395,6 +404,8 @@ 1.53 1.54 # Create a new user in AUTH_FILE and PEOPLE 1.55 new_user_config() { 1.56 + 1.57 + 1.58 mail="$(GET mail)" 1.59 pass="$(GET pass)" 1.60 key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}') 1.61 @@ -415,7 +426,7 @@ 1.62 PACKAGES="$(GET packages)" 1.63 EOT 1.64 chmod 0600 $PEOPLE/$user/account.conf 1.65 -} 1.66 + } 1.67 1.68 # 1.69 # POST actions 1.70 @@ -436,7 +447,7 @@ 1.71 header "Location: $WEB_URL" \ 1.72 "Set-Cookie: auth=$user:$md5session; HttpOnly" 1.73 else 1.74 - header "Location: $WEB_URL?login&error" 1.75 + header "Location: $cd /va ?login&error" 1.76 fi ;; 1.77 esac 1.78 1.79 @@ -477,7 +488,7 @@ 1.80 header 1.81 html_header 1.82 user_box 1.83 - login_page 1.84 + login_page $([ "$(GET id)" ] && GET id) 1.85 html_footer ;; 1.86 *\ logout\ *) 1.87 # Set a Cookie in the past to logout. 1.88 @@ -551,6 +562,7 @@ 1.89 if fgrep -q "$user:" $AUTH_FILE; then 1.90 echo "ERROR: User already exists" && exit 1 1.91 else 1.92 + 1.93 echo "Creating account for : $(GET name)" 1.94 new_user_config 1.95 fi ;;