Skip to content

Commit

Permalink
Unquotung the url before redirecting
Browse files Browse the repository at this point in the history
  • Loading branch information
Anusha Ranganathan committed Sep 9, 2011
1 parent 5b60d7e commit 1b3b927
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rdfdatabank/controllers/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pylons.controllers.util import abort, redirect
from paste.request import get_cookies
from webob.exc import HTTPUnauthorized
from urllib import unquote

class AccountController(BaseController):
def login(self):
Expand All @@ -20,13 +21,15 @@ def login(self):
session['login_flash'] = """Wrong credentials. Have you registered? <a href="register">Register</a>"""
session.save()
c.came_from = request.params.get('came_from') or "/"
c.came_from = str(c.came_from).replace('%2F', '/').replace('%2f', '/').lstrip('/')
return render('/login.html')

def welcome(self):
identity = request.environ.get("repoze.who.identity")
came_from = request.params.get('came_from') or "/"
came_from = str(came_from).replace('%2F', '/').replace('%2f', '/').lstrip('/')
came_from = unquote(came_from)
came_from = unquote(came_from)
came_from = unquote(came_from)
came_from = str(came_from)
if identity:
# Login succeeded
userid = identity['repoze.who.userid']
Expand All @@ -53,7 +56,10 @@ def logout(self):
#display_message("We hope to see you soon!", status="success")
came_from = request.params.get('came_from') or "/"
#came_from = request.params.get('came_from', '') or "/"
came_from = str(came_from).replace('%2F', '/').replace('%2f', '/').lstrip('/')
came_from = unquote(came_from)
came_from = unquote(came_from)
came_from = unquote(came_from)
came_from = str(came_from)
if session.has_key('user_name'):
del session['user_name']
if session.has_key('user_uri'):
Expand Down

0 comments on commit 1b3b927

Please sign in to comment.