annotate MoinMoin/xmlrpc/WhoAmI.py @ 6125:07782b362ef7

bump version in moin.spec
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 31 Oct 2016 20:52:05 +0100
parents 1b0629547090
children
rev   line source
184
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
2 """
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
3 MoinMoin - Tells who you are and whether the wiki trusts you.
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
4
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 184
diff changeset
5 @copyright: 2005 MoinMoin:ThomasWaldmann
184
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
7 """
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
8
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
9 def execute(xmlrpcobj, *args):
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
10 request = xmlrpcobj.request
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
11 username = request.user.name
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
12 if not username:
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
13 username = "<unknown user>"
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
14 valid = request.user.valid
2020
1b0629547090 introduce cfg.trusted_auth_methods
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
15 result = "You are %s. valid=%d." % (username.encode("utf-8"), valid)
184
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
16 return xmlrpcobj._outstr(result)
56d74783ea93 WhoAmI wiki xmlrpc plugin and client script
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
17