# HG changeset patch # User xfred222 # Date 1355436516 18000 # Node ID db97998089d63cf23766b4c45cf6691a486d3cf8 # Parent c5da10e6e7496fee376d6d0591baa8b678a5665d added bug location redirect after login and change the config file name due to conflict between new tazbug-website and client. diff -r c5da10e6e749 -r db97998089d6 web/bugs.cgi --- a/web/bugs.cgi Sun Jul 01 22:26:53 2012 +0000 +++ b/web/bugs.cgi Thu Dec 13 17:08:36 2012 -0500 @@ -5,14 +5,20 @@ # Copyright (C) 2012 SliTaz GNU/Linux - BSD License # . /usr/lib/slitaz/httphelper -[ -f "/etc/slitaz/tazbug.conf" ] && . /etc/slitaz/tazbug.conf -[ -f "../tazbug.conf" ] && . ../tazbug.conf +[ -f "/etc/slitaz/bugs.conf" ] && . /etc/slitaz/bugs.conf + # Internal variable bugdir="bug" plugins="plugins" sessions="/tmp/tazbug/sessions" po="" +error_log_file="/var/log/tazbug-server.log" + + + + + # Content negotiation for Gettext IFS="," @@ -65,6 +71,8 @@ EOT } + + # Check if user is auth check_auth() { auth="$(COOKIE auth)" @@ -113,6 +121,7 @@ # Login page login_page() { +redirect_to_id="$1" cat << EOT

$(gettext 'Login')

@@ -124,7 +133,7 @@
-
+
@@ -395,6 +404,8 @@ # Create a new user in AUTH_FILE and PEOPLE new_user_config() { + + mail="$(GET mail)" pass="$(GET pass)" key=$(echo -n "$user:$mail:$pass" | md5sum | awk '{print $1}') @@ -415,7 +426,7 @@ PACKAGES="$(GET packages)" EOT chmod 0600 $PEOPLE/$user/account.conf -} + } # # POST actions @@ -436,7 +447,7 @@ header "Location: $WEB_URL" \ "Set-Cookie: auth=$user:$md5session; HttpOnly" else - header "Location: $WEB_URL?login&error" + header "Location: $cd /va ?login&error" fi ;; esac @@ -477,7 +488,7 @@ header html_header user_box - login_page + login_page $([ "$(GET id)" ] && GET id) html_footer ;; *\ logout\ *) # Set a Cookie in the past to logout. @@ -551,6 +562,7 @@ if fgrep -q "$user:" $AUTH_FILE; then echo "ERROR: User already exists" && exit 1 else + echo "Creating account for : $(GET name)" new_user_config fi ;;