Revision a903e505
b/pithos/api/login.py | ||
---|---|---|
34 | 34 |
import logging |
35 | 35 |
|
36 | 36 |
from django.http import HttpResponseNotFound, HttpResponseRedirect |
37 |
from django.utils.http import urlencode |
|
37 | 38 |
from django.conf import settings |
38 | 39 |
|
39 | 40 |
|
... | ... | |
47 | 48 |
return HttpResponseNotFound() |
48 | 49 |
|
49 | 50 |
if request.is_secure(): |
50 |
uri = 'https://'
|
|
51 |
proto = 'https://'
|
|
51 | 52 |
else: |
52 |
uri = 'http://' |
|
53 |
uri = uri + host + '/login' |
|
54 |
return HttpResponseRedirect(uri) |
|
53 |
proto = 'http://' |
|
54 |
next = request.GET.get('next', '') |
|
55 |
params = {'next': next} |
|
56 |
renew = 'renew' in request.GET |
|
57 |
if renew: |
|
58 |
params['renew'] = True |
|
59 |
uri = proto + host + '/login?' + urlencode(params) |
|
60 |
return HttpResponseRedirect(uri) |
Also available in: Unified diff