# HG changeset patch # User Marcin Kuzminski # Date 1289434893 -3600 # Node ID 99875a8f2ad1296598eab0a3c726a3ea280df88e # Parent dd532af216d9c273dccbd1b58fe9d4a8bff18784 #49 Enabled anonymous access push and pull commands diff -r dd532af216d9 -r 99875a8f2ad1 rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py Thu Nov 11 01:05:43 2010 +0100 +++ b/rhodecode/controllers/summary.py Thu Nov 11 01:21:33 2010 +0100 @@ -62,9 +62,15 @@ e = request.environ - uri = u'%(protocol)s://%(user)s@%(host)s%(prefix)s/%(repo_name)s' % { + if self.rhodecode_user.username == 'default': + password = ':default' + else: + password = '' + + uri = u'%(protocol)s://%(user)s%(password)s@%(host)s%(prefix)s/%(repo_name)s' % { 'protocol': e.get('wsgi.url_scheme'), 'user':str(c.rhodecode_user.username), + 'password':password, 'host':e.get('HTTP_HOST'), 'prefix':e.get('SCRIPT_NAME'), 'repo_name':c.repo_name, } diff -r dd532af216d9 -r 99875a8f2ad1 rhodecode/lib/auth.py --- a/rhodecode/lib/auth.py Thu Nov 11 01:05:43 2010 +0100 +++ b/rhodecode/lib/auth.py Thu Nov 11 01:21:33 2010 +0100 @@ -77,7 +77,12 @@ if user: if user.active: - if user.username == username and check_password(password, user.password): + + if user.username == 'default' and user.active: + log.info('user %s authenticated correctly', username) + return True + + elif user.username == username and check_password(password, user.password): log.info('user %s authenticated correctly', username) return True else: diff -r dd532af216d9 -r 99875a8f2ad1 rhodecode/lib/middleware/simplehg.py --- a/rhodecode/lib/middleware/simplehg.py Thu Nov 11 01:05:43 2010 +0100 +++ b/rhodecode/lib/middleware/simplehg.py Thu Nov 11 01:21:33 2010 +0100 @@ -46,7 +46,7 @@ def __init__(self, application, config): self.application = application self.config = config - #authenticate this mercurial request using + #authenticate this mercurial request using authfunc self.authenticate = AuthBasicAuthenticator('', authfunc) self.ipaddr = '0.0.0.0' self.repository = None