1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 02:48:51 +00:00

sudo mode: fix bugs in the code

This commit is contained in:
Shuai Lin
2015-05-05 13:34:03 +08:00
parent 763e760c7e
commit 1ad6c30b35
4 changed files with 41 additions and 7 deletions

View File

@@ -1435,13 +1435,16 @@ def sys_sudo_mode(request):
password = request.POST.get('password')
if password:
user = authenticate(username=request.user.username, password=password)
update_sudo_mode_ts(request)
return HttpResponseRedirect(
request.GET.get('next', reverse('sys_useradmin')))
if user:
update_sudo_mode_ts(request)
return HttpResponseRedirect(
request.GET.get('next', reverse('sys_useradmin')))
password_error = True
enable_shib_login = getattr(settings, 'ENABLE_SHIB_LOGIN', False)
return render_to_response(
'sysadmin/sudo_mode.html', {
'password_error': True,
'password_error': password_error,
'enable_shib_login': enable_shib_login,
},
context_instance=RequestContext(request))