Attachment 'UserInfo-1.0.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - UserInfo macro Version 1.0, 19.06.2011
4
5 Syntax:
6 <<UserInfo>>; <<UserInfo()>> [same as <<UserInfo(name)>>]
7 <<UserInfo(email)>>
8 <<UserInfo(aliasname)>>
9 <<UserInfo(name)>>
10
11 @copyright: 2011 Ian Riley <ian.riley@adelaide.edu.au>
12 license: GNU GPL, see COPYING for details.
13
14 inspired by CurrentUser.py
15 @copyright: 2006 by Oliver Siemoneit
16 ''"""
17
18 from MoinMoin import user
19
20 def execute(macro, args):
21 request = macro.request
22 _ = request.getText
23 to_get = args
24 if not to_get: to_get = 'name'
25 result = ''
26
27 if request.user.valid:
28 if to_get in ['aliasname', 'name', 'email', ]:
29 try:
30 result = eval('request.user.%s' % to_get)
31 except:
32 pass
33 else: result = 'error'
34 else: result = 'unknown'
35 return result
You are not allowed to attach a file to this page.