annotate MoinMoin/macro/Login.py @ 483:a594780d5e64

Login macro, login/logout/UserPreferences actions imported from: moin--main--1.5--patch-487
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 19 Mar 2006 01:21:38 +0000
parents
children 2077ed6974d7
rev   line source
483
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
2 """
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
3 MoinMoin - login form
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
4
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
5 @copyright: 2005-2006 by Radomirs Cirskis <nad2000@gmail.com>
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
7 """
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
8 from MoinMoin.widget import html
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
9 from MoinMoin import userform
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
10
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
11 def execute(macro, args):
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
12 """ Show the login form (but only when not logged in) """
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
13 request = macro.request
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
14 if request.user.valid:
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
15 data = u''
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
16 else:
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
17 data = userform.getLogin(request)
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
18 return data
a594780d5e64 Login macro, login/logout/UserPreferences actions
Thomas Waldmann <tw@waldmann-edv.de>
parents:
diff changeset
19