comparison rhodecode/controllers/login.py @ 3146:c5169e445fb8 beta

Full IP restrictions enabled - short cache query for IP for performance - remove redundant logic - some small css fixes for login form to better show IP restricted message
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 04 Jan 2013 23:34:53 +0100
parents dffb92224edf
children cd50d1b5f35b fdb0f59b2189
comparison
equal deleted inserted replaced
3145:bee09f317edc 3146:c5169e445fb8
52 super(LoginController, self).__before__() 52 super(LoginController, self).__before__()
53 53
54 def index(self): 54 def index(self):
55 # redirect if already logged in 55 # redirect if already logged in
56 c.came_from = request.GET.get('came_from') 56 c.came_from = request.GET.get('came_from')
57 57 not_default = self.rhodecode_user.username != 'default'
58 if self.rhodecode_user.is_authenticated \ 58 ip_allowed = self.rhodecode_user.ip_allowed
59 and self.rhodecode_user.username != 'default': 59 if self.rhodecode_user.is_authenticated and not_default and ip_allowed:
60
61 return redirect(url('home')) 60 return redirect(url('home'))
62 61
63 if request.POST: 62 if request.POST:
64 # import Login Form validator class 63 # import Login Form validator class
65 login_form = LoginForm() 64 login_form = LoginForm()