/[glsr]/trunk/site/basedomain.py
Gentoo

Contents of /trunk/site/basedomain.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 50 - (show annotations) (download) (as text)
Sat Jul 2 09:57:18 2005 UTC (9 years, 4 months ago) by port001
File MIME type: text/x-python
File size: 1080 byte(s)
Supporting code for logins
1
2 import os
3
4 from harmonious import harm
5 from harmonious.lib.template import Template
6
7 from glsr.setup import config
8 from glsr.site.user import get_uid_by_sid, User
9
10 class BaseDomain:
11
12 def __init__(self):
13
14 self._template = Template()
15
16 if hasattr(self, 'init'):
17
18 self.init()
19
20 def _get_user(self):
21
22 uid = get_uid_by_sid(harm.request.session.get_id())
23
24 if uid == None:
25
26 return (0, '')
27
28 return (uid, User(uid).get_alias())
29
30 def _do_header(self):
31
32 (uid, alias) = self._get_user()
33
34 self._template.param('GLSR_URL', config.url)
35 self._template.param('USER_ALIAS', alias)
36 self._template.param('USER_ID', uid)
37 self._template.compile(os.path.join(config.template_loc, 'header.tpl'))
38 harm.response.append_body(self._template.output())
39
40 def _do_footer(self):
41
42 self._template.param('GLSR_VERSION', config.__version__)
43 self._template.compile(os.path.join(config.template_loc, 'footer.tpl'))
44 harm.response.append_body(self._template.output())

Properties

Name Value
svn:keyword Id
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.20