Changeset - 99875a8f2ad1
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2010-11-11 01:21:33
marcin@python-works.com
#49 Enabled anonymous access push and pull commands
3 files changed with 14 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/summary.py
Show inline comments
 
@@ -62,9 +62,15 @@ class SummaryController(BaseController):
 

	
 
        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, }
rhodecode/lib/auth.py
Show inline comments
 
@@ -77,7 +77,12 @@ def authfunc(environ, username, password
 

	
 
    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:
rhodecode/lib/middleware/simplehg.py
Show inline comments
 
@@ -46,7 +46,7 @@ class SimpleHg(object):
 
    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
0 comments (0 inline, 0 general)