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

Diff of /trunk/site/basedomain.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 49 Revision 50
1
2__revision__ = "$Id: $"
3__authors__ = ["Scott Hadfield <hadfield@gentoo.org>",
4 "Ian Leitch <port001@gentoo.org>"]
5__modulename__ = "basedomain"
6 1
7import os 2import os
8 3
9from harmonious import harm 4from harmonious import harm
10from harmonious.lib.template import Template 5from harmonious.lib.template import Template
20 15
21 if hasattr(self, 'init'): 16 if hasattr(self, 'init'):
22 17
23 self.init() 18 self.init()
24 19
25 def __get_user(self): 20 def _get_user(self):
26 21
27 uid = get_uid_by_sid(harm.request.session.get_id()) 22 uid = get_uid_by_sid(harm.request.session.get_id())
23
24 if uid == None:
25
26 return (0, '')
28 27
29 return (uid, User(uid).get_alias()) 28 return (uid, User(uid).get_alias())
30 29
31 def _do_header(self): 30 def _do_header(self):
32 31
33 (uid, alias) = self.__get_user() 32 (uid, alias) = self._get_user()
34 33
35 self._template.param('GLSR_URL', config.url) 34 self._template.param('GLSR_URL', config.url)
36 self._template.param('USER_ALIAS', alias) 35 self._template.param('USER_ALIAS', alias)
37 self._template.param('USER_ID', uid) 36 self._template.param('USER_ID', uid)
38 self._template.compile(os.path.join(config.template_loc, 'header.tpl')) 37 self._template.compile(os.path.join(config.template_loc, 'header.tpl'))

Legend:
Removed from v.49  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.20