Mercurial > kallithea
comparison rhodecode/lib/middleware/simplegit.py @ 989:801cdb3e0969 beta
simplified simplegit and simplehg a little
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 01 Feb 2011 02:18:05 +0100 |
parents | b2d5868cc4b8 |
children | 6832ef664673 |
comparison
equal
deleted
inserted
replaced
988:7f4943c90876 | 989:801cdb3e0969 |
---|---|
157 # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME FROM | 157 # CHECK PERMISSIONS FOR THIS REQUEST USING GIVEN USERNAME FROM |
158 # BASIC AUTH | 158 # BASIC AUTH |
159 #============================================================== | 159 #============================================================== |
160 | 160 |
161 if self.action in ['pull', 'push'] or self.action: | 161 if self.action in ['pull', 'push'] or self.action: |
162 username = self.__get_environ_user(environ) | 162 username = REMOTE_USER(environ) |
163 try: | 163 try: |
164 user = self.__get_user(username) | 164 user = self.__get_user(username) |
165 self.username = user.username | 165 self.username = user.username |
166 except: | 166 except: |
167 log.error(traceback.format_exc()) | 167 log.error(traceback.format_exc()) |
246 log.error(traceback.format_exc()) | 246 log.error(traceback.format_exc()) |
247 raise | 247 raise |
248 repo_name = repo_name.split('/')[0] | 248 repo_name = repo_name.split('/')[0] |
249 return repo_name | 249 return repo_name |
250 | 250 |
251 def __get_environ_user(self, environ): | |
252 return environ.get('REMOTE_USER') | |
253 | 251 |
254 def __get_user(self, username): | 252 def __get_user(self, username): |
255 return UserModel().get_by_username(username, cache=True) | 253 return UserModel().get_by_username(username, cache=True) |
256 | 254 |
257 def __get_action(self, environ): | 255 def __get_action(self, environ): |