Changeset - ff449e9e6e38
[Not reviewed]
default
0 2 0
Marcin Kuzminski - 15 years ago 2010-10-18 04:11:59
marcin@python-works.com
fixed chrome repo switcher issue
2 files changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/middleware/simplehg.py
Show inline comments
 
@@ -65,57 +65,58 @@ class SimpleHg(object):
 
                AUTH_TYPE.update(environ, 'basic')
 
                REMOTE_USER.update(environ, result)
 
            else:
 
                return result.wsgi_application(environ, start_response)
 

	
 
        try:
 
            repo_name = '/'.join(environ['PATH_INFO'].split('/')[1:])
 
            if repo_name.endswith('/'):
 
                repo_name = repo_name.rstrip('/')
 
        except:
 
            log.error(traceback.format_exc())
 
            return HTTPInternalServerError()(environ, start_response)
 

	
 
        #===================================================================
 
        # CHECK PERMISSIONS FOR THIS REQUEST
 
        #===================================================================
 
        action = self.__get_action(environ)
 
        if action:
 
            username = self.__get_environ_user(environ)
 
            try:
 
                user = self.__get_user(username)
 
            except:
 
                log.error(traceback.format_exc())
 
                return HTTPInternalServerError()(environ, start_response)
 

	
 
            #check permissions for this repository
 

	
 
            if action == 'push':
 
                if not HasPermissionAnyMiddleware('repository.write',
 
                                                  'repository.admin')\
 
                                                    (user, repo_name):
 
                    return HTTPForbidden()(environ, start_response)
 

	
 
            else:
 
                #any other action need at least read permission
 
                if not HasPermissionAnyMiddleware('repository.read',
 
                                                  'repository.write',
 
                                                  'repository.admin')\
 
                                                    (user, repo_name):
 
                    return HTTPForbidden()(environ, start_response)
 

	
 
            #log action
 
            if action in ('push', 'pull', 'clone'):
 
                proxy_key = 'HTTP_X_REAL_IP'
 
                def_key = 'REMOTE_ADDR'
 
                ipaddr = environ.get(proxy_key, environ.get(def_key, '0.0.0.0'))
 
                self.__log_user_action(user, action, repo_name, ipaddr)
 

	
 
        #===================================================================
 
        # MERCURIAL REQUEST HANDLING
 
        #===================================================================
 
        environ['PATH_INFO'] = '/'#since we wrap into hgweb, reset the path
 
        self.baseui = make_ui('db')
 
        self.basepath = self.config['base_path']
 
        self.repo_path = os.path.join(self.basepath, repo_name)
 

	
 
        #quick check if that dir exists...
 
        if check_repo_fast(repo_name, self.basepath):
 
            return HTTPNotFound()(environ, start_response)
rhodecode/public/css/style.css
Show inline comments
 
@@ -336,49 +336,48 @@ background:url("../../images/quick_r_sel
 
#header #header-inner #quick li a:hover span.icon {
 
border-left:none;
 
border-right:1px solid #464646;
 
background:url("../../images/quick_l_selected.png") no-repeat top left;
 
}
 
 
#header #header-inner #quick ul {
 
top:29px;
 
right:0;
 
min-width:200px;
 
display:none;
 
position:absolute;
 
background:#FFF;
 
border:1px solid #666;
 
border-top:1px solid #003367;
 
z-index:100;
 
margin:0;
 
padding:0;
 
}
 
 
#header #header-inner #quick ul.repo_switcher {
 
max-height:275px;
 
overflow-x:hidden;
 
overflow-y:auto;
 
white-space:nowrap;
 
}
 
 
#header #header-inner #quick li ul li {
 
border-bottom:1px solid #ddd;
 
}
 
 
#header #header-inner #quick li ul li a {
 
width:182px;
 
height:auto;
 
display:block;
 
float:left;
 
background:#FFF;
 
color:#003367;
 
font-weight:400;
 
margin:0;
 
padding:7px 9px;
 
}
 
 
#header #header-inner #quick li ul li a.childs {
 
width:167px;
 
background:#FFF url("../../resources/images/plus.png") no-repeat 8px 9px;
 
margin:0;
 
padding:7px 9px 7px 24px;
 
}
 
@@ -1421,49 +1420,49 @@ border-left:12px solid #afd8f8;
 
 
#content div.box div.traffic table {
 
width:auto;
 
}
 
 
#content div.box div.traffic table td {
 
background:transparent;
 
border:none;
 
padding:2px 3px 3px;
 
}
 
 
#content div.box div.traffic table td.legendLabel {
 
padding:0 3px 2px;
 
}
 
 
#footer {
 
clear:both;
 
overflow:hidden;
 
text-align:right;
 
margin:0;
 
padding:0 30px;
 
}
 
 
#footer p {
 
background:none repeat scroll 0 0 #2F2F2F;
 
background:url("../images/header_inner.png") repeat-x scroll 0 0 #003367;
 
color:#FFF;
 
font-weight:700;
 
padding:15px 25px 15px 0;
 
}
 
 
#login div.title {
 
width:420px;
 
clear:both;
 
overflow:hidden;
 
position:relative;
 
background:#003367 url("../../images/header_inner.png") repeat-x;
 
margin:0 auto;
 
padding:0;
 
}
 
 
#login div.title div.corner {
 
height:6px;
 
width:6px;
 
position:absolute;
 
background:url("../../images/login_corners.png") no-repeat;
 
}
 
 
#login div.inner {
 
width:380px;
 
@@ -2129,52 +2128,52 @@ font-size:0.8em;
 
opacity:0.6px;
 
}
 
 
table#permissions_manage td.private_repo_msg {
 
font-size:0.8em;
 
}
 
 
table#permissions_manage tr#add_perm_input td {
 
vertical-align:middle;
 
}
 
 
div.gravatar {
 
background-color:#FFF;
 
border:1px solid #D0D0D0;
 
float:left;
 
margin-right:0.7em;
 
padding:2px 2px 0;
 
}
 
 
#header,#content,#footer {
 
min-width:1224px;
 
}
 
 
#content {
 
min-height:100%;
 
min-height:85%;
 
clear:both;
 
overflow:hidden;
 
padding:10px 30px;
 
padding:14px 30px;
 
}
 
 
#content div.box div.title div.search {
 
background:url("../../images/title_link.png") no-repeat top left;
 
border-left:1px solid #316293;
 
}
 
 
#content div.box div.title div.search div.input input {
 
border:1px solid #316293;
 
}
 
 
#content div.box div.title div.search div.button input.ui-state-default {
 
background:#4e85bb url("../../images/button_highlight.png") repeat-x;
 
border:1px solid #316293;
 
border-left:none;
 
color:#FFF;
 
}
 
 
#content div.box div.title div.search div.button input.ui-state-hover {
 
background:#46a0c1 url("../../images/button_highlight_selected.png") repeat-x;
 
border:1px solid #316293;
 
border-left:none;
 
color:#FFF;
 
}
0 comments (0 inline, 0 general)