Show More
@@ -167,7 +167,6 b' class SimpleGit(BaseVCSController):' | |||||
167 | #============================================================== |
|
167 | #============================================================== | |
168 | # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME |
|
168 | # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME | |
169 | #============================================================== |
|
169 | #============================================================== | |
170 | if action in ['pull', 'push']: |
|
|||
171 |
|
|
170 | try: | |
172 |
|
|
171 | user = self.__get_user(username) | |
173 |
|
|
172 | if user is None or not user.active: | |
@@ -175,13 +174,13 b' class SimpleGit(BaseVCSController):' | |||||
175 |
|
|
174 | username = user.username | |
176 |
|
|
175 | except: | |
177 |
|
|
176 | log.error(traceback.format_exc()) | |
178 |
|
|
177 | return HTTPInternalServerError()(environ, start_response) | |
179 | start_response) |
|
|||
180 |
|
178 | |||
181 |
|
|
179 | #check permissions for this repository | |
182 |
|
|
180 | perm = self._check_permission(action, user, repo_name) | |
183 |
|
|
181 | if perm is not True: | |
184 |
|
|
182 | return HTTPForbidden()(environ, start_response) | |
|
183 | ||||
185 | extras = { |
|
184 | extras = { | |
186 | 'ip': ipaddr, |
|
185 | 'ip': ipaddr, | |
187 | 'username': username, |
|
186 | 'username': username, |
@@ -70,7 +70,7 b' class SimpleHg(BaseVCSController):' | |||||
70 | return self.application(environ, start_response) |
|
70 | return self.application(environ, start_response) | |
71 |
|
71 | |||
72 | ipaddr = self._get_ip_addr(environ) |
|
72 | ipaddr = self._get_ip_addr(environ) | |
73 |
|
73 | username = None | ||
74 | # skip passing error to error controller |
|
74 | # skip passing error to error controller | |
75 | environ['pylons.status_code_redirect'] = True |
|
75 | environ['pylons.status_code_redirect'] = True | |
76 |
|
76 | |||
@@ -131,7 +131,6 b' class SimpleHg(BaseVCSController):' | |||||
131 | #============================================================== |
|
131 | #============================================================== | |
132 | # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME |
|
132 | # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME | |
133 | #============================================================== |
|
133 | #============================================================== | |
134 | if action in ['pull', 'push']: |
|
|||
135 |
|
|
134 | try: | |
136 |
|
|
135 | user = self.__get_user(username) | |
137 |
|
|
136 | if user is None or not user.active: | |
@@ -139,8 +138,7 b' class SimpleHg(BaseVCSController):' | |||||
139 |
|
|
138 | username = user.username | |
140 |
|
|
139 | except: | |
141 |
|
|
140 | log.error(traceback.format_exc()) | |
142 |
|
|
141 | return HTTPInternalServerError()(environ, start_response) | |
143 | start_response) |
|
|||
144 |
|
142 | |||
145 |
|
|
143 | #check permissions for this repository | |
146 |
|
|
144 | perm = self._check_permission(action, user, repo_name) |
General Comments 0
You need to be logged in to leave comments.
Login now