Show More
@@ -8,7 +8,7 b' syntax: regexp' | |||||
8 | syntax: regexp |
|
8 | syntax: regexp | |
9 | ^\.pydevproject$ |
|
9 | ^\.pydevproject$ | |
10 | syntax: regexp |
|
10 | syntax: regexp | |
11 | ^hg_app\.db$ |
|
11 | ^rhodecode\.db$ | |
12 | syntax: regexp |
|
12 | syntax: regexp | |
13 | ^test\.db$ |
|
13 | ^test\.db$ | |
14 | syntax: regexp |
|
14 | syntax: regexp |
@@ -2,8 +2,8 b' include COPYING' | |||||
2 | include README.rst |
|
2 | include README.rst | |
3 | include rhodecode/config/deployment.ini_tmpl |
|
3 | include rhodecode/config/deployment.ini_tmpl | |
4 |
|
4 | |||
5 |
include |
|
5 | include rhodecode_daemon | |
6 |
include |
|
6 | include rhodecode_daemon2 | |
7 |
|
7 | |||
8 | recursive-include rhodecode/public/css * |
|
8 | recursive-include rhodecode/public/css * | |
9 | recursive-include rhodecode/public/images * |
|
9 | recursive-include rhodecode/public/images * |
@@ -94,7 +94,7 b' logview.pylons.util = #eee' | |||||
94 | ######################################################### |
|
94 | ######################################################### | |
95 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
95 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
96 | ######################################################### |
|
96 | ######################################################### | |
97 |
sqlalchemy.db1.url = sqlite:///%(here)s/ |
|
97 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db | |
98 | #sqlalchemy.db1.echo = False |
|
98 | #sqlalchemy.db1.echo = False | |
99 | #sqlalchemy.db1.pool_recycle = 3600 |
|
99 | #sqlalchemy.db1.pool_recycle = 3600 | |
100 | sqlalchemy.convert_unicode = true |
|
100 | sqlalchemy.convert_unicode = true |
@@ -3,7 +3,7 b'' | |||||
3 | #### THIS IS AN GENTOO INIT.D SCRIPT#### |
|
3 | #### THIS IS AN GENTOO INIT.D SCRIPT#### | |
4 | ######################################## |
|
4 | ######################################## | |
5 |
|
5 | |||
6 |
APP_NAME=" |
|
6 | APP_NAME="rhodecode" | |
7 | APP_HOMEDIR="marcink/python_workspace" |
|
7 | APP_HOMEDIR="marcink/python_workspace" | |
8 | APP_PATH="/home/$APP_HOMEDIR/$APP_NAME" |
|
8 | APP_PATH="/home/$APP_HOMEDIR/$APP_NAME" | |
9 |
|
9 |
@@ -13,7 +13,7 b'' | |||||
13 | # Description: starts instance of hg-app using start-stop-daemon |
|
13 | # Description: starts instance of hg-app using start-stop-daemon | |
14 | ### END INIT INFO |
|
14 | ### END INIT INFO | |
15 |
|
15 | |||
16 |
APP_NAME=" |
|
16 | APP_NAME="rhodecode" | |
17 | APP_HOMEDIR="marcink/python_workspace" |
|
17 | APP_HOMEDIR="marcink/python_workspace" | |
18 | APP_PATH="/home/$APP_HOMEDIR/$APP_NAME" |
|
18 | APP_PATH="/home/$APP_HOMEDIR/$APP_NAME" | |
19 |
|
19 |
@@ -94,7 +94,7 b' logview.pylons.util = #eee' | |||||
94 | ######################################################### |
|
94 | ######################################################### | |
95 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
95 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
96 | ######################################################### |
|
96 | ######################################################### | |
97 |
sqlalchemy.db1.url = sqlite:///%(here)s/ |
|
97 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db | |
98 | #sqlalchemy.db1.echo = False |
|
98 | #sqlalchemy.db1.echo = False | |
99 | #sqlalchemy.db1.pool_recycle = 3600 |
|
99 | #sqlalchemy.db1.pool_recycle = 3600 | |
100 | sqlalchemy.convert_unicode = true |
|
100 | sqlalchemy.convert_unicode = true |
@@ -95,7 +95,7 b' logview.pylons.util = #eee' | |||||
95 | ######################################################### |
|
95 | ######################################################### | |
96 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### |
|
96 | ### DB CONFIGS - EACH DB WILL HAVE IT'S OWN CONFIG ### | |
97 | ######################################################### |
|
97 | ######################################################### | |
98 |
sqlalchemy.db1.url = sqlite:///%(here)s/ |
|
98 | sqlalchemy.db1.url = sqlite:///%(here)s/rhodecode.db | |
99 | #sqlalchemy.db1.echo = False |
|
99 | #sqlalchemy.db1.echo = False | |
100 | #sqlalchemy.db1.pool_recycle = 3600 |
|
100 | #sqlalchemy.db1.pool_recycle = 3600 | |
101 | sqlalchemy.convert_unicode = true |
|
101 | sqlalchemy.convert_unicode = true |
@@ -4,7 +4,7 b' from pylons.configuration import PylonsC' | |||||
4 | from pylons.error import handle_mako_error |
|
4 | from pylons.error import handle_mako_error | |
5 | from rhodecode.config.routing import make_map |
|
5 | from rhodecode.config.routing import make_map | |
6 | from rhodecode.lib.auth import set_available_permissions, set_base_path |
|
6 | from rhodecode.lib.auth import set_available_permissions, set_base_path | |
7 |
from rhodecode.lib.utils import repo2db_mapper, make_ui, set_ |
|
7 | from rhodecode.lib.utils import repo2db_mapper, make_ui, set_rhodecode_config | |
8 | from rhodecode.model import init_model |
|
8 | from rhodecode.model import init_model | |
9 | from rhodecode.model.hg_model import _get_repos_cached_initial |
|
9 | from rhodecode.model.hg_model import _get_repos_cached_initial | |
10 | from sqlalchemy import engine_from_config |
|
10 | from sqlalchemy import engine_from_config | |
@@ -72,7 +72,7 b' def load_environment(global_conf, app_co' | |||||
72 | repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'], initial)) |
|
72 | repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'], initial)) | |
73 | set_available_permissions(config) |
|
73 | set_available_permissions(config) | |
74 | set_base_path(config) |
|
74 | set_base_path(config) | |
75 |
set_ |
|
75 | set_rhodecode_config(config) | |
76 | # CONFIGURATION OPTIONS HERE (note: all config options will override |
|
76 | # CONFIGURATION OPTIONS HERE (note: all config options will override | |
77 | # any Pylons config options) |
|
77 | # any Pylons config options) | |
78 |
|
78 |
@@ -73,16 +73,16 b' class ReposController(BaseController):' | |||||
73 | form_result = {} |
|
73 | form_result = {} | |
74 | try: |
|
74 | try: | |
75 | form_result = _form.to_python(dict(request.POST)) |
|
75 | form_result = _form.to_python(dict(request.POST)) | |
76 |
repo_model.create(form_result, c. |
|
76 | repo_model.create(form_result, c.rhodecode_user) | |
77 | invalidate_cache('cached_repo_list') |
|
77 | invalidate_cache('cached_repo_list') | |
78 | h.flash(_('created repository %s') % form_result['repo_name'], |
|
78 | h.flash(_('created repository %s') % form_result['repo_name'], | |
79 | category='success') |
|
79 | category='success') | |
80 |
|
80 | |||
81 | if request.POST.get('user_created'): |
|
81 | if request.POST.get('user_created'): | |
82 |
action_logger(self. |
|
82 | action_logger(self.rhodecode_user, 'user_created_repo', | |
83 | form_result['repo_name'], '', self.sa) |
|
83 | form_result['repo_name'], '', self.sa) | |
84 | else: |
|
84 | else: | |
85 |
action_logger(self. |
|
85 | action_logger(self.rhodecode_user, 'admin_created_repo', | |
86 | form_result['repo_name'], '', self.sa) |
|
86 | form_result['repo_name'], '', self.sa) | |
87 |
|
87 | |||
88 | except formencode.Invalid as errors: |
|
88 | except formencode.Invalid as errors: | |
@@ -176,7 +176,7 b' class ReposController(BaseController):' | |||||
176 |
|
176 | |||
177 | return redirect(url('repos')) |
|
177 | return redirect(url('repos')) | |
178 | try: |
|
178 | try: | |
179 |
action_logger(self. |
|
179 | action_logger(self.rhodecode_user, 'admin_deleted_repo', | |
180 | repo_name, '', self.sa) |
|
180 | repo_name, '', self.sa) | |
181 | repo_model.delete(repo) |
|
181 | repo_model.delete(repo) | |
182 | invalidate_cache('cached_repo_list') |
|
182 | invalidate_cache('cached_repo_list') |
@@ -32,7 +32,7 b' from rhodecode.lib.auth import LoginRequ' | |||||
32 | HasPermissionAnyDecorator |
|
32 | HasPermissionAnyDecorator | |
33 | from rhodecode.lib.base import BaseController, render |
|
33 | from rhodecode.lib.base import BaseController, render | |
34 | from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \ |
|
34 | from rhodecode.lib.utils import repo2db_mapper, invalidate_cache, \ | |
35 |
set_ |
|
35 | set_rhodecode_config, get_hg_settings, get_hg_ui_settings, make_ui | |
36 | from rhodecode.model.db import User, UserLog, HgAppSettings, HgAppUi |
|
36 | from rhodecode.model.db import User, UserLog, HgAppSettings, HgAppUi | |
37 | from rhodecode.model.forms import UserForm, ApplicationSettingsForm, \ |
|
37 | from rhodecode.model.forms import UserForm, ApplicationSettingsForm, \ | |
38 | ApplicationUiSettingsForm |
|
38 | ApplicationUiSettingsForm | |
@@ -118,17 +118,17 b' class SettingsController(BaseController)' | |||||
118 | try: |
|
118 | try: | |
119 | hgsettings1 = self.sa.query(HgAppSettings)\ |
|
119 | hgsettings1 = self.sa.query(HgAppSettings)\ | |
120 | .filter(HgAppSettings.app_settings_name == 'title').one() |
|
120 | .filter(HgAppSettings.app_settings_name == 'title').one() | |
121 |
hgsettings1.app_settings_value = form_result[' |
|
121 | hgsettings1.app_settings_value = form_result['rhodecode_title'] | |
122 |
|
122 | |||
123 | hgsettings2 = self.sa.query(HgAppSettings)\ |
|
123 | hgsettings2 = self.sa.query(HgAppSettings)\ | |
124 | .filter(HgAppSettings.app_settings_name == 'realm').one() |
|
124 | .filter(HgAppSettings.app_settings_name == 'realm').one() | |
125 |
hgsettings2.app_settings_value = form_result[' |
|
125 | hgsettings2.app_settings_value = form_result['rhodecode_realm'] | |
126 |
|
126 | |||
127 |
|
127 | |||
128 | self.sa.add(hgsettings1) |
|
128 | self.sa.add(hgsettings1) | |
129 | self.sa.add(hgsettings2) |
|
129 | self.sa.add(hgsettings2) | |
130 | self.sa.commit() |
|
130 | self.sa.commit() | |
131 |
set_ |
|
131 | set_rhodecode_config(config) | |
132 | h.flash(_('Updated application settings'), |
|
132 | h.flash(_('Updated application settings'), | |
133 | category='success') |
|
133 | category='success') | |
134 |
|
134 | |||
@@ -231,7 +231,7 b' class SettingsController(BaseController)' | |||||
231 | GET /_admin/my_account Displays info about my account |
|
231 | GET /_admin/my_account Displays info about my account | |
232 | """ |
|
232 | """ | |
233 | # url('admin_settings_my_account') |
|
233 | # url('admin_settings_my_account') | |
234 |
c.user = self.sa.query(User).get(c. |
|
234 | c.user = self.sa.query(User).get(c.rhodecode_user.user_id) | |
235 | c.user_repos = [] |
|
235 | c.user_repos = [] | |
236 | for repo in c.cached_repo_list.values(): |
|
236 | for repo in c.cached_repo_list.values(): | |
237 | if repo.dbrepo.user.username == c.user.username: |
|
237 | if repo.dbrepo.user.username == c.user.username: | |
@@ -259,9 +259,9 b' class SettingsController(BaseController)' | |||||
259 | # method='put') |
|
259 | # method='put') | |
260 | # url('admin_settings_my_account_update', id=ID) |
|
260 | # url('admin_settings_my_account_update', id=ID) | |
261 | user_model = UserModel() |
|
261 | user_model = UserModel() | |
262 |
uid = c. |
|
262 | uid = c.rhodecode_user.user_id | |
263 | _form = UserForm(edit=True, old_data={'user_id':uid, |
|
263 | _form = UserForm(edit=True, old_data={'user_id':uid, | |
264 |
'email':c. |
|
264 | 'email':c.rhodecode_user.email})() | |
265 | form_result = {} |
|
265 | form_result = {} | |
266 | try: |
|
266 | try: | |
267 | form_result = _form.to_python(dict(request.POST)) |
|
267 | form_result = _form.to_python(dict(request.POST)) | |
@@ -270,7 +270,7 b' class SettingsController(BaseController)' | |||||
270 | category='success') |
|
270 | category='success') | |
271 |
|
271 | |||
272 | except formencode.Invalid as errors: |
|
272 | except formencode.Invalid as errors: | |
273 |
c.user = self.sa.query(User).get(c. |
|
273 | c.user = self.sa.query(User).get(c.rhodecode_user.user_id) | |
274 | c.user_repos = [] |
|
274 | c.user_repos = [] | |
275 | for repo in c.cached_repo_list.values(): |
|
275 | for repo in c.cached_repo_list.values(): | |
276 | if repo.dbrepo.user.username == c.user.username: |
|
276 | if repo.dbrepo.user.username == c.user.username: |
@@ -72,7 +72,7 b' class UsersController(BaseController):' | |||||
72 | user_model.create(form_result) |
|
72 | user_model.create(form_result) | |
73 | h.flash(_('created user %s') % form_result['username'], |
|
73 | h.flash(_('created user %s') % form_result['username'], | |
74 | category='success') |
|
74 | category='success') | |
75 |
#action_logger(self. |
|
75 | #action_logger(self.rhodecode_user, 'new_user', '', '', self.sa) | |
76 | except formencode.Invalid as errors: |
|
76 | except formencode.Invalid as errors: | |
77 | return htmlfill.render( |
|
77 | return htmlfill.render( | |
78 | render('admin/users/user_add.html'), |
|
78 | render('admin/users/user_add.html'), |
@@ -46,7 +46,7 b' class LoginController(BaseController):' | |||||
46 | #redirect if already logged in |
|
46 | #redirect if already logged in | |
47 | c.came_from = request.GET.get('came_from', None) |
|
47 | c.came_from = request.GET.get('came_from', None) | |
48 |
|
48 | |||
49 |
if c. |
|
49 | if c.rhodecode_user.is_authenticated: | |
50 | return redirect(url('hg_home')) |
|
50 | return redirect(url('hg_home')) | |
51 |
|
51 | |||
52 | if request.POST: |
|
52 | if request.POST: | |
@@ -63,7 +63,7 b' class LoginController(BaseController):' | |||||
63 | auth_user.user_id = user.user_id |
|
63 | auth_user.user_id = user.user_id | |
64 | auth_user.name = user.name |
|
64 | auth_user.name = user.name | |
65 | auth_user.lastname = user.lastname |
|
65 | auth_user.lastname = user.lastname | |
66 |
session[' |
|
66 | session['rhodecode_user'] = auth_user | |
67 | session.save() |
|
67 | session.save() | |
68 | log.info('user %s is now authenticated', username) |
|
68 | log.info('user %s is now authenticated', username) | |
69 |
|
69 | |||
@@ -138,7 +138,7 b' class LoginController(BaseController):' | |||||
138 | return render('/password_reset.html') |
|
138 | return render('/password_reset.html') | |
139 |
|
139 | |||
140 | def logout(self): |
|
140 | def logout(self): | |
141 |
session[' |
|
141 | session['rhodecode_user'] = AuthUser() | |
142 | session.save() |
|
142 | session.save() | |
143 | log.info('Logging out and setting user as Empty') |
|
143 | log.info('Logging out and setting user as Empty') | |
144 | redirect(url('hg_home')) |
|
144 | redirect(url('hg_home')) |
@@ -121,7 +121,7 b' class SettingsController(BaseController)' | |||||
121 |
|
121 | |||
122 | return redirect(url('hg_home')) |
|
122 | return redirect(url('hg_home')) | |
123 | try: |
|
123 | try: | |
124 |
action_logger(self. |
|
124 | action_logger(self.rhodecode_user, 'user_deleted_repo', | |
125 | repo_name, '', self.sa) |
|
125 | repo_name, '', self.sa) | |
126 | repo_model.delete(repo) |
|
126 | repo_model.delete(repo) | |
127 | invalidate_cache('cached_repo_list') |
|
127 | invalidate_cache('cached_repo_list') | |
@@ -156,11 +156,11 b' class SettingsController(BaseController)' | |||||
156 | try: |
|
156 | try: | |
157 | form_result = _form.to_python(dict(request.POST)) |
|
157 | form_result = _form.to_python(dict(request.POST)) | |
158 | form_result.update({'repo_name':repo_name}) |
|
158 | form_result.update({'repo_name':repo_name}) | |
159 |
repo_model.create_fork(form_result, c. |
|
159 | repo_model.create_fork(form_result, c.rhodecode_user) | |
160 | h.flash(_('fork %s repository as %s task added') \ |
|
160 | h.flash(_('fork %s repository as %s task added') \ | |
161 | % (repo_name, form_result['fork_name']), |
|
161 | % (repo_name, form_result['fork_name']), | |
162 | category='success') |
|
162 | category='success') | |
163 |
action_logger(self. |
|
163 | action_logger(self.rhodecode_user, 'user_forked_repo', | |
164 | repo_name, '', self.sa) |
|
164 | repo_name, '', self.sa) | |
165 | except formencode.Invalid as errors: |
|
165 | except formencode.Invalid as errors: | |
166 | c.new_repo = errors.value['fork_name'] |
|
166 | c.new_repo = errors.value['fork_name'] |
@@ -54,7 +54,7 b' class SummaryController(BaseController):' | |||||
54 |
|
54 | |||
55 | uri = u'%(protocol)s://%(user)s@%(host)s%(prefix)s/%(repo_name)s' % { |
|
55 | uri = u'%(protocol)s://%(user)s@%(host)s%(prefix)s/%(repo_name)s' % { | |
56 | 'protocol': e.get('wsgi.url_scheme'), |
|
56 | 'protocol': e.get('wsgi.url_scheme'), | |
57 |
'user':str(c. |
|
57 | 'user':str(c.rhodecode_user.username), | |
58 | 'host':e.get('HTTP_HOST'), |
|
58 | 'host':e.get('HTTP_HOST'), | |
59 | 'prefix':e.get('SCRIPT_NAME'), |
|
59 | 'prefix':e.get('SCRIPT_NAME'), | |
60 | 'repo_name':c.repo_name, } |
|
60 | 'repo_name':c.repo_name, } |
@@ -230,11 +230,11 b' def get_user(session):' | |||||
230 | Gets user from session, and wraps permissions into user |
|
230 | Gets user from session, and wraps permissions into user | |
231 | @param session: |
|
231 | @param session: | |
232 | """ |
|
232 | """ | |
233 |
user = session.get(' |
|
233 | user = session.get('rhodecode_user', AuthUser()) | |
234 | if user.is_authenticated: |
|
234 | if user.is_authenticated: | |
235 | user = fill_data(user) |
|
235 | user = fill_data(user) | |
236 | user = fill_perms(user) |
|
236 | user = fill_perms(user) | |
237 |
session[' |
|
237 | session['rhodecode_user'] = user | |
238 | session.save() |
|
238 | session.save() | |
239 | return user |
|
239 | return user | |
240 |
|
240 | |||
@@ -248,7 +248,7 b' class LoginRequired(object):' | |||||
248 | return decorator(self.__wrapper, func) |
|
248 | return decorator(self.__wrapper, func) | |
249 |
|
249 | |||
250 | def __wrapper(self, func, *fargs, **fkwargs): |
|
250 | def __wrapper(self, func, *fargs, **fkwargs): | |
251 |
user = session.get(' |
|
251 | user = session.get('rhodecode_user', AuthUser()) | |
252 | log.debug('Checking login required for user:%s', user.username) |
|
252 | log.debug('Checking login required for user:%s', user.username) | |
253 | if user.is_authenticated: |
|
253 | if user.is_authenticated: | |
254 | log.debug('user %s is authenticated', user.username) |
|
254 | log.debug('user %s is authenticated', user.username) | |
@@ -287,7 +287,7 b' class PermsDecorator(object):' | |||||
287 | # _wrapper.__dict__.update(func.__dict__) |
|
287 | # _wrapper.__dict__.update(func.__dict__) | |
288 | # _wrapper.__doc__ = func.__doc__ |
|
288 | # _wrapper.__doc__ = func.__doc__ | |
289 |
|
289 | |||
290 |
self.user_perms = session.get(' |
|
290 | self.user_perms = session.get('rhodecode_user', AuthUser()).permissions | |
291 | log.debug('checking %s permissions %s for %s', |
|
291 | log.debug('checking %s permissions %s for %s', | |
292 | self.__class__.__name__, self.required_perms, func.__name__) |
|
292 | self.__class__.__name__, self.required_perms, func.__name__) | |
293 |
|
293 | |||
@@ -378,7 +378,7 b' class PermsFunction(object):' | |||||
378 | self.repo_name = None |
|
378 | self.repo_name = None | |
379 |
|
379 | |||
380 | def __call__(self, check_Location=''): |
|
380 | def __call__(self, check_Location=''): | |
381 |
user = session.get(' |
|
381 | user = session.get('rhodecode_user', False) | |
382 | if not user: |
|
382 | if not user: | |
383 | return False |
|
383 | return False | |
384 | self.user_perms = user.permissions |
|
384 | self.user_perms = user.permissions |
@@ -15,8 +15,8 b' from rhodecode.model.hg_model import _ge' | |||||
15 | class BaseController(WSGIController): |
|
15 | class BaseController(WSGIController): | |
16 |
|
16 | |||
17 | def __before__(self): |
|
17 | def __before__(self): | |
18 |
c. |
|
18 | c.rhodecode_version = __version__ | |
19 |
c. |
|
19 | c.rhodecode_name = config['rhodecode_title'] | |
20 | c.repo_name = get_repo_slug(request) |
|
20 | c.repo_name = get_repo_slug(request) | |
21 | c.cached_repo_list = _get_repos_cached() |
|
21 | c.cached_repo_list = _get_repos_cached() | |
22 | c.repo_switcher_list = _get_repos_switcher_cached(c.cached_repo_list) |
|
22 | c.repo_switcher_list = _get_repos_switcher_cached(c.cached_repo_list) | |
@@ -40,7 +40,7 b' class BaseController(WSGIController):' | |||||
40 | # available in environ['pylons.routes_dict'] |
|
40 | # available in environ['pylons.routes_dict'] | |
41 | try: |
|
41 | try: | |
42 | #putting this here makes sure that we update permissions every time |
|
42 | #putting this here makes sure that we update permissions every time | |
43 |
self. |
|
43 | self.rhodecode_user = c.rhodecode_user = auth.get_user(session) | |
44 | return WSGIController.__call__(self, environ, start_response) |
|
44 | return WSGIController.__call__(self, environ, start_response) | |
45 | finally: |
|
45 | finally: | |
46 | meta.Session.remove() |
|
46 | meta.Session.remove() |
@@ -34,7 +34,7 b' def get_hg_settings():' | |||||
34 | raise Exception('Could not get application settings !') |
|
34 | raise Exception('Could not get application settings !') | |
35 | settings = {} |
|
35 | settings = {} | |
36 | for each in ret: |
|
36 | for each in ret: | |
37 |
settings[' |
|
37 | settings['rhodecode_' + each.app_settings_name] = each.app_settings_value | |
38 |
|
38 | |||
39 | return settings |
|
39 | return settings | |
40 |
|
40 |
@@ -59,7 +59,7 b' class SimpleHg(object):' | |||||
59 | #=================================================================== |
|
59 | #=================================================================== | |
60 | username = REMOTE_USER(environ) |
|
60 | username = REMOTE_USER(environ) | |
61 | if not username: |
|
61 | if not username: | |
62 |
self.authenticate.realm = self.config[' |
|
62 | self.authenticate.realm = self.config['rhodecode_realm'] | |
63 | result = self.authenticate(environ) |
|
63 | result = self.authenticate(environ) | |
64 | if isinstance(result, str): |
|
64 | if isinstance(result, str): | |
65 | AUTH_TYPE.update(environ, 'basic') |
|
65 | AUTH_TYPE.update(environ, 'basic') |
@@ -144,7 +144,7 b' def get_hg_settings():' | |||||
144 | raise Exception('Could not get application settings !') |
|
144 | raise Exception('Could not get application settings !') | |
145 | settings = {} |
|
145 | settings = {} | |
146 | for each in ret: |
|
146 | for each in ret: | |
147 |
settings[' |
|
147 | settings['rhodecode_' + each.app_settings_name] = each.app_settings_value | |
148 |
|
148 | |||
149 | return settings |
|
149 | return settings | |
150 |
|
150 | |||
@@ -223,7 +223,7 b" def make_ui(read_from='file', path=None," | |||||
223 | return baseui |
|
223 | return baseui | |
224 |
|
224 | |||
225 |
|
225 | |||
226 |
def set_ |
|
226 | def set_rhodecode_config(config): | |
227 | hgsettings = get_hg_settings() |
|
227 | hgsettings = get_hg_settings() | |
228 |
|
228 | |||
229 | for k, v in hgsettings.items(): |
|
229 | for k, v in hgsettings.items(): |
@@ -8,14 +8,14 b' import logging' | |||||
8 | log = logging.getLogger(__name__) |
|
8 | log = logging.getLogger(__name__) | |
9 |
|
9 | |||
10 | class HgAppSettings(Base): |
|
10 | class HgAppSettings(Base): | |
11 |
__tablename__ = ' |
|
11 | __tablename__ = 'rhodecode_settings' | |
12 | __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) |
|
12 | __table_args__ = (UniqueConstraint('app_settings_name'), {'useexisting':True}) | |
13 | app_settings_id = Column("app_settings_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
13 | app_settings_id = Column("app_settings_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
14 | app_settings_name = Column("app_settings_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
14 | app_settings_name = Column("app_settings_name", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
15 | app_settings_value = Column("app_settings_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
15 | app_settings_value = Column("app_settings_value", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) | |
16 |
|
16 | |||
17 | class HgAppUi(Base): |
|
17 | class HgAppUi(Base): | |
18 |
__tablename__ = ' |
|
18 | __tablename__ = 'rhodecode_ui' | |
19 | __table_args__ = {'useexisting':True} |
|
19 | __table_args__ = {'useexisting':True} | |
20 | ui_id = Column("ui_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) |
|
20 | ui_id = Column("ui_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True) | |
21 | ui_section = Column("ui_section", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
|
21 | ui_section = Column("ui_section", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None) |
@@ -333,8 +333,8 b' def ApplicationSettingsForm():' | |||||
333 | class _ApplicationSettingsForm(formencode.Schema): |
|
333 | class _ApplicationSettingsForm(formencode.Schema): | |
334 | allow_extra_fields = True |
|
334 | allow_extra_fields = True | |
335 | filter_extra_fields = False |
|
335 | filter_extra_fields = False | |
336 |
|
|
336 | rhodecode_title = UnicodeString(strip=True, min=1, not_empty=True) | |
337 |
|
|
337 | rhodecode_realm = UnicodeString(strip=True, min=1, not_empty=True) | |
338 |
|
338 | |||
339 | return _ApplicationSettingsForm |
|
339 | return _ApplicationSettingsForm | |
340 |
|
340 |
@@ -82,19 +82,19 b'' | |||||
82 |
|
82 | |||
83 | <div class="field"> |
|
83 | <div class="field"> | |
84 | <div class="label"> |
|
84 | <div class="label"> | |
85 |
<label for=" |
|
85 | <label for="rhodecode_title">${_('Application name')}:</label> | |
86 | </div> |
|
86 | </div> | |
87 | <div class="input"> |
|
87 | <div class="input"> | |
88 |
${h.text(' |
|
88 | ${h.text('rhodecode_title',size=30)} | |
89 | </div> |
|
89 | </div> | |
90 | </div> |
|
90 | </div> | |
91 |
|
91 | |||
92 | <div class="field"> |
|
92 | <div class="field"> | |
93 | <div class="label"> |
|
93 | <div class="label"> | |
94 |
<label for=" |
|
94 | <label for="rhodecode_realm">${_('Realm text')}:</label> | |
95 | </div> |
|
95 | </div> | |
96 | <div class="input"> |
|
96 | <div class="input"> | |
97 |
${h.text(' |
|
97 | ${h.text('rhodecode_realm',size=30)} | |
98 | </div> |
|
98 | </div> | |
99 | </div> |
|
99 | </div> | |
100 |
|
100 |
@@ -2,7 +2,7 b'' | |||||
2 | <%inherit file="/base/base.html"/> |
|
2 | <%inherit file="/base/base.html"/> | |
3 |
|
3 | |||
4 | <%def name="title()"> |
|
4 | <%def name="title()"> | |
5 |
${c. |
|
5 | ${c.rhodecode_user.username} ${_('account')} | |
6 | </%def> |
|
6 | </%def> | |
7 |
|
7 | |||
8 | <%def name="breadcrumbs_links()"> |
|
8 | <%def name="breadcrumbs_links()"> |
@@ -18,11 +18,11 b'' | |||||
18 | <ul id="logged-user"> |
|
18 | <ul id="logged-user"> | |
19 | <li class="first"> |
|
19 | <li class="first"> | |
20 | <div class="gravatar"> |
|
20 | <div class="gravatar"> | |
21 |
<img alt="gravatar" src="${h.gravatar_url(c. |
|
21 | <img alt="gravatar" src="${h.gravatar_url(c.rhodecode_user.email,24)}" /> | |
22 | </div> |
|
22 | </div> | |
23 | <div class="account"> |
|
23 | <div class="account"> | |
24 |
${h.link_to('%s %s'%(c. |
|
24 | ${h.link_to('%s %s'%(c.rhodecode_user.name,c.rhodecode_user.lastname),h.url('admin_settings_my_account'))}<br/> | |
25 |
${h.link_to(c. |
|
25 | ${h.link_to(c.rhodecode_user.username,h.url('admin_settings_my_account'))} | |
26 | </div> |
|
26 | </div> | |
27 | </li> |
|
27 | </li> | |
28 | <li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li> |
|
28 | <li class="last highlight">${h.link_to(u'Logout',h.url('logout_home'))}</li> | |
@@ -34,7 +34,7 b'' | |||||
34 | </div> |
|
34 | </div> | |
35 | <!-- logo --> |
|
35 | <!-- logo --> | |
36 | <div id="logo"> |
|
36 | <div id="logo"> | |
37 |
<h1><a href="${h.url('hg_home')}">${c. |
|
37 | <h1><a href="${h.url('hg_home')}">${c.rhodecode_name}</a></h1> | |
38 | </div> |
|
38 | </div> | |
39 | <!-- end logo --> |
|
39 | <!-- end logo --> | |
40 | <!-- quick menu --> |
|
40 | <!-- quick menu --> | |
@@ -66,7 +66,7 b'' | |||||
66 |
|
66 | |||
67 | <!-- footer --> |
|
67 | <!-- footer --> | |
68 | <div id="footer"> |
|
68 | <div id="footer"> | |
69 |
<p>Hg App ${c. |
|
69 | <p>Hg App ${c.rhodecode_version} © 2010 by Marcin Kuzminski</p> | |
70 | <script type="text/javascript">${h.tooltip.activate()}</script> |
|
70 | <script type="text/javascript">${h.tooltip.activate()}</script> | |
71 | </div> |
|
71 | </div> | |
72 | <!-- end footer --> |
|
72 | <!-- end footer --> |
@@ -1,10 +1,10 b'' | |||||
1 | ## -*- coding: utf-8 -*- |
|
1 | ## -*- coding: utf-8 -*- | |
2 | <%inherit file="base/base.html"/> |
|
2 | <%inherit file="base/base.html"/> | |
3 | <%def name="title()"> |
|
3 | <%def name="title()"> | |
4 |
${c. |
|
4 | ${c.rhodecode_name} | |
5 | </%def> |
|
5 | </%def> | |
6 | <%def name="breadcrumbs()"> |
|
6 | <%def name="breadcrumbs()"> | |
7 |
${c. |
|
7 | ${c.rhodecode_name} | |
8 | </%def> |
|
8 | </%def> | |
9 | <%def name="page_nav()"> |
|
9 | <%def name="page_nav()"> | |
10 | ${self.menu('home')} |
|
10 | ${self.menu('home')} |
@@ -10,7 +10,7 b'' | |||||
10 | :${c.cur_query} |
|
10 | :${c.cur_query} | |
11 | </%def> |
|
11 | </%def> | |
12 | <%def name="breadcrumbs()"> |
|
12 | <%def name="breadcrumbs()"> | |
13 |
${c. |
|
13 | ${c.rhodecode_name} | |
14 | </%def> |
|
14 | </%def> | |
15 | <%def name="page_nav()"> |
|
15 | <%def name="page_nav()"> | |
16 | ${self.menu('home')} |
|
16 | ${self.menu('home')} |
@@ -54,5 +54,5 b' class TestController(TestCase):' | |||||
54 | assert False, 'could not login using %s %s' % (username, password) |
|
54 | assert False, 'could not login using %s %s' % (username, password) | |
55 |
|
55 | |||
56 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status |
|
56 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status | |
57 |
assert response.session[' |
|
57 | assert response.session['rhodecode_user'].username == username, 'wrong logged in user got %s expected %s' % (response.session['rhodecode_user'].username, username) | |
58 | return response.follow() |
|
58 | return response.follow() |
@@ -15,7 +15,7 b' class TestLoginController(TestController' | |||||
15 | {'username':'test_admin', |
|
15 | {'username':'test_admin', | |
16 | 'password':'test12'}) |
|
16 | 'password':'test12'}) | |
17 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status |
|
17 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status | |
18 |
assert response.session[' |
|
18 | assert response.session['rhodecode_user'].username == 'test_admin', 'wrong logged in user' | |
19 | response = response.follow() |
|
19 | response = response.follow() | |
20 | assert 'auto description for vcs_test' in response.body |
|
20 | assert 'auto description for vcs_test' in response.body | |
21 |
|
21 | |||
@@ -25,7 +25,7 b' class TestLoginController(TestController' | |||||
25 | 'password':'test12'}) |
|
25 | 'password':'test12'}) | |
26 | print response |
|
26 | print response | |
27 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status |
|
27 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status | |
28 |
assert response.session[' |
|
28 | assert response.session['rhodecode_user'].username == 'test_regular', 'wrong logged in user' | |
29 | response = response.follow() |
|
29 | response = response.follow() | |
30 | assert 'auto description for vcs_test' in response.body |
|
30 | assert 'auto description for vcs_test' in response.body | |
31 | assert '<a title="Admin" href="/_admin">' not in response.body |
|
31 | assert '<a title="Admin" href="/_admin">' not in response.body |
General Comments 0
You need to be logged in to leave comments.
Login now