Changing how default redirection works.

This commit is contained in:
Antoine Nguyen
2013-06-12 11:42:02 +02:00
parent 0343bc4762
commit a62f8d263e
+6 -3
View File
@@ -34,9 +34,12 @@ def dologin(request):
form.cleaned_data["username"],
form.cleaned_data["password"])
nextlocation = request.POST["next"]
if nextlocation.strip() in ["", "None"]:
nextlocation = reverse("domains")
nextlocation = request.POST.get("next", None)
if nextlocation is None or nextlocation == "None":
if user.group != "SimpleUsers":
nextlocation = reverse("modoboa.lib.webutils.topredirection")
else:
nextlocation = reverse("domains")
return HttpResponseRedirect(nextlocation)
error = _("Your username and password didn't match. Please try again.")
logger.warning("Failed connection attempt from '%(addr)s' as user '%(user)s'" \