|
a/Allura/allura/controllers/auth.py |
|
b/Allura/allura/controllers/auth.py |
|
... |
|
... |
37 |
class AuthController(BaseController):
|
37 |
class AuthController(BaseController):
|
38 |
|
38 |
|
39 |
def __init__(self):
|
39 |
def __init__(self):
|
40 |
self.prefs = PreferencesController()
|
40 |
self.prefs = PreferencesController()
|
41 |
|
41 |
|
42 |
@expose('allura.templates.login')
|
42 |
@expose('jinja:login.html')
|
43 |
@with_trailing_slash
|
43 |
@with_trailing_slash
|
44 |
def index(self, *args, **kwargs):
|
44 |
def index(self, *args, **kwargs):
|
45 |
orig_request = request.environ.get('pylons.original_request', None)
|
45 |
orig_request = request.environ.get('pylons.original_request', None)
|
46 |
if 'return_to' in kwargs:
|
46 |
if 'return_to' in kwargs:
|
47 |
return_to = kwargs.pop('return_to')
|
47 |
return_to = kwargs.pop('return_to')
|
|
... |
|
... |
49 |
return_to = orig_request.url
|
49 |
return_to = orig_request.url
|
50 |
else:
|
50 |
else:
|
51 |
return_to = request.referer
|
51 |
return_to = request.referer
|
52 |
return dict(oid_providers=OID_PROVIDERS, return_to=return_to)
|
52 |
return dict(oid_providers=OID_PROVIDERS, return_to=return_to)
|
53 |
|
53 |
|
54 |
@expose('allura.templates.custom_login')
|
54 |
@expose('jinja:custom_login.html')
|
55 |
def login_verify_oid(self, provider, username, return_to=None):
|
55 |
def login_verify_oid(self, provider, username, return_to=None):
|
56 |
if provider:
|
56 |
if provider:
|
57 |
oid_url = string.Template(provider).safe_substitute(
|
57 |
oid_url = string.Template(provider).safe_substitute(
|
58 |
username=username)
|
58 |
username=username)
|
59 |
else:
|
59 |
else:
|
|
... |
|
... |
73 |
flash('Please choose a user name for SourceForge, %s.'
|
73 |
flash('Please choose a user name for SourceForge, %s.'
|
74 |
% c.user.display_name)
|
74 |
% c.user.display_name)
|
75 |
redirect('setup_openid_user')
|
75 |
redirect('setup_openid_user')
|
76 |
redirect(kw.pop('return_to', '/'))
|
76 |
redirect(kw.pop('return_to', '/'))
|
77 |
|
77 |
|
78 |
@expose('allura.templates.setup_openid_user')
|
78 |
@expose('jinja:setup_openid_user.html')
|
79 |
def setup_openid_user(self):
|
79 |
def setup_openid_user(self):
|
80 |
return dict()
|
80 |
return dict()
|
81 |
|
81 |
|
82 |
@expose('jinja:create_account.html')
|
82 |
@expose('jinja:create_account.html')
|
83 |
def create_account(self):
|
83 |
def create_account(self):
|
|
... |
|
... |
145 |
n = M.Neighborhood.query.get(name='Users')
|
145 |
n = M.Neighborhood.query.get(name='Users')
|
146 |
n.register_project('u/' + username)
|
146 |
n.register_project('u/' + username)
|
147 |
flash('Your username has been set to %s.' % username)
|
147 |
flash('Your username has been set to %s.' % username)
|
148 |
redirect('/')
|
148 |
redirect('/')
|
149 |
|
149 |
|
150 |
@expose('allura.templates.claim_openid')
|
150 |
@expose('jinja:claim_openid.html')
|
151 |
def claim_oid(self):
|
151 |
def claim_oid(self):
|
152 |
return dict(oid_providers=OID_PROVIDERS)
|
152 |
return dict(oid_providers=OID_PROVIDERS)
|
153 |
|
153 |
|
154 |
@expose('allura.templates.custom_login')
|
154 |
@expose('jinja:custom_login.html')
|
155 |
def claim_verify_oid(self, provider, username):
|
155 |
def claim_verify_oid(self, provider, username):
|
156 |
if provider:
|
156 |
if provider:
|
157 |
oid_url = string.Template(provider).safe_substitute(
|
157 |
oid_url = string.Template(provider).safe_substitute(
|
158 |
username=username)
|
158 |
username=username)
|
159 |
else:
|
159 |
else:
|