comparison mercurial/hgweb/hgwebdir_mod.py @ 3556:c3043ebe40a0

use untrusted settings in hgwebdir
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 26 Oct 2006 19:25:45 +0200
parents 8f02223662c8
children f7dee427cd14
comparison
equal deleted inserted replaced
3555:881064004fd0 3556:c3043ebe40a0
85 "footer": footer, 85 "footer": footer,
86 "motd": motd, 86 "motd": motd,
87 "url": url}) 87 "url": url})
88 88
89 def archivelist(ui, nodeid, url): 89 def archivelist(ui, nodeid, url):
90 allowed = ui.configlist("web", "allow_archive") 90 allowed = ui.configlist("web", "allow_archive", untrusted=True)
91 for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]: 91 for i in [('zip', '.zip'), ('gz', '.tar.gz'), ('bz2', '.tar.bz2')]:
92 if i[0] in allowed or ui.configbool("web", "allow" + i[0]): 92 if i[0] in allowed or ui.configbool("web", "allow" + i[0],
93 untrusted=True):
93 yield {"type" : i[0], "extension": i[1], 94 yield {"type" : i[0], "extension": i[1],
94 "node": nodeid, "url": url} 95 "node": nodeid, "url": url}
95 96
96 def entries(sortcolumn="", descending=False, **map): 97 def entries(sortcolumn="", descending=False, **map):
97 def sessionvars(**map): 98 def sessionvars(**map):
112 u = ui.ui() 113 u = ui.ui()
113 try: 114 try:
114 u.readconfig(os.path.join(path, '.hg', 'hgrc')) 115 u.readconfig(os.path.join(path, '.hg', 'hgrc'))
115 except IOError: 116 except IOError:
116 pass 117 pass
117 get = u.config 118 def get(section, name, default=None):
119 return u.config(section, name, default, untrusted=True)
118 120
119 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name]) 121 url = ('/'.join([req.env["REQUEST_URI"].split('?')[0], name])
120 .replace("//", "/")) + '/' 122 .replace("//", "/")) + '/'
121 123
122 # update time with local timezone 124 # update time with local timezone