|
a/Allura/allura/lib/plugin.py |
|
b/Allura/allura/lib/plugin.py |
|
... |
|
... |
126 |
|
126 |
|
127 |
:rtype: None
|
127 |
:rtype: None
|
128 |
:raises: AssertionError with user message, upon any error
|
128 |
:raises: AssertionError with user message, upon any error
|
129 |
'''
|
129 |
'''
|
130 |
raise NotImplemented, 'upload_sshkey'
|
130 |
raise NotImplemented, 'upload_sshkey'
|
|
|
131 |
|
|
|
132 |
def account_navigation(self):
|
|
|
133 |
return [
|
|
|
134 |
{
|
|
|
135 |
'tabid': 'account_sfnet_beta_index',
|
|
|
136 |
'title': 'Subscriptions',
|
|
|
137 |
'target': "/auth/prefs",
|
|
|
138 |
'alt': 'Manage Subscription Preferences',
|
|
|
139 |
},
|
|
|
140 |
]
|
131 |
|
141 |
|
132 |
class LocalAuthenticationProvider(AuthenticationProvider):
|
142 |
class LocalAuthenticationProvider(AuthenticationProvider):
|
133 |
'''
|
143 |
'''
|
134 |
Stores user passwords on the User model, in mongo. Uses per-user salt and
|
144 |
Stores user passwords on the User model, in mongo. Uses per-user salt and
|
135 |
SHA-256 encryption.
|
145 |
SHA-256 encryption.
|
|
... |
|
... |
402 |
if group._id not in pr.roles:
|
412 |
if group._id not in pr.roles:
|
403 |
pr.roles.append(group._id)
|
413 |
pr.roles.append(group._id)
|
404 |
if 'tools' in project_template:
|
414 |
if 'tools' in project_template:
|
405 |
for i, tool in enumerate(project_template['tools'].keys()):
|
415 |
for i, tool in enumerate(project_template['tools'].keys()):
|
406 |
tool_config = project_template['tools'][tool]
|
416 |
tool_config = project_template['tools'][tool]
|
|
|
417 |
tool_options = tool_config.get('options', {})
|
|
|
418 |
for k, v in tool_options.iteritems():
|
|
|
419 |
if isinstance(v, basestring):
|
|
|
420 |
tool_options[k] = \
|
|
|
421 |
string.Template(v).safe_substitute(
|
|
|
422 |
p.__dict__.get('root_project', {}))
|
407 |
app = p.install_app(tool,
|
423 |
app = p.install_app(tool,
|
408 |
mount_label=tool_config['label'],
|
424 |
mount_label=tool_config['label'],
|
409 |
mount_point=tool_config['mount_point'],
|
425 |
mount_point=tool_config['mount_point'],
|
410 |
ordinal=i+offset)
|
426 |
ordinal=i + offset,
|
411 |
if 'options' in tool_config:
|
427 |
**tool_options)
|
412 |
for option in tool_config['options']:
|
|
|
413 |
value = tool_config['options'][option]
|
|
|
414 |
if isinstance(value, basestring):
|
|
|
415 |
value = string.Template(value).safe_substitute(
|
|
|
416 |
p.__dict__.get('root_project', {}))
|
|
|
417 |
app.config.options[option] = value
|
|
|
418 |
if tool == 'wiki':
|
428 |
if tool == 'wiki':
|
419 |
from forgewiki import model as WM
|
429 |
from forgewiki import model as WM
|
420 |
text = tool_config.get('home_text',
|
430 |
text = tool_config.get('home_text',
|
421 |
'[[project_admins]]\n[[download_button]]')
|
431 |
'[[project_admins]]\n[[download_button]]')
|
422 |
WM.Page.query.get(app_config_id=app.config._id).text = text
|
432 |
WM.Page.query.get(app_config_id=app.config._id).text = text
|