##// END OF EJS Templates
#49 Enabled anonymous access push and pull commands
marcink -
r674:99875a8f beta
parent child Browse files
Show More
@@ -62,9 +62,15 b' class SummaryController(BaseController):'
62
62
63 e = request.environ
63 e = request.environ
64
64
65 uri = u'%(protocol)s://%(user)s@%(host)s%(prefix)s/%(repo_name)s' % {
65 if self.rhodecode_user.username == 'default':
66 password = ':default'
67 else:
68 password = ''
69
70 uri = u'%(protocol)s://%(user)s%(password)s@%(host)s%(prefix)s/%(repo_name)s' % {
66 'protocol': e.get('wsgi.url_scheme'),
71 'protocol': e.get('wsgi.url_scheme'),
67 'user':str(c.rhodecode_user.username),
72 'user':str(c.rhodecode_user.username),
73 'password':password,
68 'host':e.get('HTTP_HOST'),
74 'host':e.get('HTTP_HOST'),
69 'prefix':e.get('SCRIPT_NAME'),
75 'prefix':e.get('SCRIPT_NAME'),
70 'repo_name':c.repo_name, }
76 'repo_name':c.repo_name, }
@@ -77,7 +77,12 b' def authfunc(environ, username, password'
77
77
78 if user:
78 if user:
79 if user.active:
79 if user.active:
80 if user.username == username and check_password(password, user.password):
80
81 if user.username == 'default' and user.active:
82 log.info('user %s authenticated correctly', username)
83 return True
84
85 elif user.username == username and check_password(password, user.password):
81 log.info('user %s authenticated correctly', username)
86 log.info('user %s authenticated correctly', username)
82 return True
87 return True
83 else:
88 else:
@@ -46,7 +46,7 b' class SimpleHg(object):'
46 def __init__(self, application, config):
46 def __init__(self, application, config):
47 self.application = application
47 self.application = application
48 self.config = config
48 self.config = config
49 #authenticate this mercurial request using
49 #authenticate this mercurial request using authfunc
50 self.authenticate = AuthBasicAuthenticator('', authfunc)
50 self.authenticate = AuthBasicAuthenticator('', authfunc)
51 self.ipaddr = '0.0.0.0'
51 self.ipaddr = '0.0.0.0'
52 self.repository = None
52 self.repository = None
General Comments 0
You need to be logged in to leave comments. Login now