##// END OF EJS Templates
hgweb: remove some use of wsgireq in hgwebdir...
Gregory Szorc -
r36905:fc4e3129 default
parent child Browse files
Show More
@@ -200,7 +200,7 b' class hgwebdir(object):'
200 wsgireq = requestmod.wsgirequest(env, respond)
200 wsgireq = requestmod.wsgirequest(env, respond)
201 return self.run_wsgi(wsgireq)
201 return self.run_wsgi(wsgireq)
202
202
203 def read_allowed(self, ui, wsgireq):
203 def readallowed(self, ui, req):
204 """Check allow_read and deny_read config options of a repo's ui object
204 """Check allow_read and deny_read config options of a repo's ui object
205 to determine user permissions. By default, with neither option set (or
205 to determine user permissions. By default, with neither option set (or
206 both empty), allow all users to read the repo. There are two ways a
206 both empty), allow all users to read the repo. There are two ways a
@@ -209,7 +209,7 b' class hgwebdir(object):'
209 allow_read is not empty and the user is not in allow_read. Return True
209 allow_read is not empty and the user is not in allow_read. Return True
210 if user is allowed to read the repo, else return False."""
210 if user is allowed to read the repo, else return False."""
211
211
212 user = wsgireq.env.get('REMOTE_USER')
212 user = req.remoteuser
213
213
214 deny_read = ui.configlist('web', 'deny_read', untrusted=True)
214 deny_read = ui.configlist('web', 'deny_read', untrusted=True)
215 if deny_read and (not user or ismember(ui, user, deny_read)):
215 if deny_read and (not user or ismember(ui, user, deny_read)):
@@ -329,6 +329,7 b' class hgwebdir(object):'
329 tmpl = None
329 tmpl = None
330
330
331 def makeindex(self, wsgireq, tmpl, subdir=""):
331 def makeindex(self, wsgireq, tmpl, subdir=""):
332 req = wsgireq.req
332
333
333 def archivelist(ui, nodeid, url):
334 def archivelist(ui, nodeid, url):
334 allowed = ui.configlist("web", "allow_archive", untrusted=True)
335 allowed = ui.configlist("web", "allow_archive", untrusted=True)
@@ -428,7 +429,7 b' class hgwebdir(object):'
428 if u.configbool("web", "hidden", untrusted=True):
429 if u.configbool("web", "hidden", untrusted=True):
429 continue
430 continue
430
431
431 if not self.read_allowed(u, wsgireq):
432 if not self.readallowed(u, req):
432 continue
433 continue
433
434
434 # update time with local timezone
435 # update time with local timezone
@@ -480,8 +481,8 b' class hgwebdir(object):'
480 self.refresh()
481 self.refresh()
481 sortable = ["name", "description", "contact", "lastchange"]
482 sortable = ["name", "description", "contact", "lastchange"]
482 sortcolumn, descending = sortdefault
483 sortcolumn, descending = sortdefault
483 if 'sort' in wsgireq.req.qsparams:
484 if 'sort' in req.qsparams:
484 sortcolumn = wsgireq.req.qsparams['sort']
485 sortcolumn = req.qsparams['sort']
485 descending = sortcolumn.startswith('-')
486 descending = sortcolumn.startswith('-')
486 if descending:
487 if descending:
487 sortcolumn = sortcolumn[1:]
488 sortcolumn = sortcolumn[1:]
General Comments 0
You need to be logged in to leave comments. Login now