annotate MoinMoin/userform/admin.py @ 6133:a6283e189869 tip

fixup: remove nonexisting passlib.utils._blowfish this was removed by the passlib 1.7.1 upgrade.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 01 Jun 2017 18:10:19 +0200
parents f4e0854b1604
children
rev   line source
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
2 """
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
3 MoinMoin - User account administration
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
4
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
5 @copyright: 2001-2004 Juergen Hermann <jh@web.de>,
4819
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
6 2003-2007 MoinMoin:ThomasWaldmann,
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
7 2007-2008 MoinMoin:ReimarBauer,
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
8 2009 MoinMoin:DmitrijsMilajevs
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
9 @license: GNU GPL, see COPYING for details.
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
10 """
4819
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
11
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
12
3175
2a3a6cb34e45 pylint findings: fix some harmless stuff
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3070
diff changeset
13 from MoinMoin import user, wikiutil
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
14 from MoinMoin.util.dataset import TupleDataset, Column
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
15 from MoinMoin.Page import Page
4055
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
16 from MoinMoin.widget import html
4832
f83b7b0b59c4 Groups2009: groups and dicts were merged inside of the datastruct module.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4830
diff changeset
17 from MoinMoin.datastruct.backends.wiki_groups import WikiGroup
4819
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
18
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
19
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
20 def do_user_browser(request):
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
21 """ Browser for SystemAdmin macro. """
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
22 _ = request.getText
4819
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
23 groups = request.groups
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
24
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
25 data = TupleDataset()
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
26 data.columns = [
2876
834ce71dddb3 userform.admin: getText added to column label
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2875
diff changeset
27 Column('name', label=_('Username')),
3585
fc32d580fe37 SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3584
diff changeset
28 Column('groups', label=_('Member of Groups')),
2876
834ce71dddb3 userform.admin: getText added to column label
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2875
diff changeset
29 Column('email', label=_('Email')),
834ce71dddb3 userform.admin: getText added to column label
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2875
diff changeset
30 Column('jabber', label=_('Jabber')),
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
31 Column('action', label=_('Action')),
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
32 ]
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
33
5938
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
34 class UserAccount(object):
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
35 # namedtuple is >= 2.6 :-(
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
36 def __init__(self, **kw):
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
37 for k, v in kw.items():
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
38 setattr(self, k, v)
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
39 def __repr__(self):
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
40 return "<UserAccount %r>" % self.__dict__
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
41
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
42 accounts = []
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
43 for uid in user.getUserList(request):
5938
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
44 # be careful and just create a list of what we really need,
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
45 # not sure if we can keep lots of User objects instantiated
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
46 # in parallel (open files? too big?)
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
47 u = user.User(request, uid)
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
48 accounts.append(UserAccount(name=u.name, email=u.email, jid=u.jid, disabled=u.disabled))
3585
fc32d580fe37 SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3584
diff changeset
49
5938
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
50 def sortkey(account):
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
51 # enabled accounts at top, sorted by name
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
52 return (account.disabled, account.name)
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
53
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
54 # Iterate over user accounts
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
55 for account in sorted(accounts, key=sortkey):
4819
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
56 account_groups = set(groups.groups_with_member(account.name))
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
57 wiki_groups = set([group for group in account_groups if isinstance(groups[group], WikiGroup)])
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
58 other_groups = list(account_groups - wiki_groups)
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
59
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
60 # First show groups that are defined in wikipages linking to it
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
61 # after show groups from other backends.
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
62 grouppage_links = ', '.join([Page(request, group_name).link_to(request) for group_name in wiki_groups] +
05a605c107ed Groups2009: wiki_groups Group class was renamed to WikiGroup. userform.admin refactored to use new groups code. Basic test for it is written.
Dmitrijs Milajevs <dimazest@gmail.com>
parents: 4094
diff changeset
63 other_groups)
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
64
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
65 userhomepage = Page(request, account.name)
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
66 if userhomepage.exists():
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
67 namelink = userhomepage.link_to(request)
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
68 else:
2984
52f9d511f155 SystemAdmin user browser: SuperUser now can enable/disable user accounts, new userprofile action (partly a port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2876
diff changeset
69 namelink = wikiutil.escape(account.name)
52f9d511f155 SystemAdmin user browser: SuperUser now can enable/disable user accounts, new userprofile action (partly a port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2876
diff changeset
70
4055
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
71 # creates the POST data for account disable/enable
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
72 val = "1"
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
73 text=_('Disable user')
2984
52f9d511f155 SystemAdmin user browser: SuperUser now can enable/disable user accounts, new userprofile action (partly a port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2876
diff changeset
74 if account.disabled:
4055
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
75 text=_('Enable user')
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
76 val = "0"
2984
52f9d511f155 SystemAdmin user browser: SuperUser now can enable/disable user accounts, new userprofile action (partly a port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2876
diff changeset
77 namelink += " (%s)" % _("disabled")
52f9d511f155 SystemAdmin user browser: SuperUser now can enable/disable user accounts, new userprofile action (partly a port from 1.6)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2876
diff changeset
78
4055
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
79 url = request.page.url(request)
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
80 ret = html.FORM(action=url)
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
81 ret.append(html.INPUT(type='hidden', name='action', value='userprofile'))
5486
a283079b3f1e userprofile action: add ticket
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4055
diff changeset
82 ticket = wikiutil.createTicket(request, action='userprofile')
a283079b3f1e userprofile action: add ticket
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4055
diff changeset
83 ret.append(html.INPUT(type="hidden", name="ticket", value="%s" % ticket))
4055
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
84 ret.append(html.INPUT(type='hidden', name='name', value=account.name))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
85 ret.append(html.INPUT(type='hidden', name='key', value="disabled"))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
86 ret.append(html.INPUT(type='hidden', name='val', value=val))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
87 ret.append(html.INPUT(type='submit', name='userprofile', value=text))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
88 enable_disable_link = unicode(unicode(ret))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
89
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
90 # creates the POST data for recoverpass
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
91 url = request.page.url(request)
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
92 ret = html.FORM(action=url)
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
93 ret.append(html.INPUT(type='hidden', name='action', value='recoverpass'))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
94 ret.append(html.INPUT(type='hidden', name='email', value=account.email))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
95 ret.append(html.INPUT(type='hidden', name='account_sendmail', value="1"))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
96 ret.append(html.INPUT(type='hidden', name='sysadm', value="users"))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
97 ret.append(html.INPUT(type='submit', name='recoverpass', value=_('Mail account data')))
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
98 recoverpass_link = unicode(unicode(ret))
3584
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
99
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
100 if account.email:
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
101 email_link = (request.formatter.url(1, 'mailto:' + account.email, css='mailto') +
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
102 request.formatter.text(account.email) +
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
103 request.formatter.url(0))
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
104 else:
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
105 email_link = ''
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
106
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
107 if account.jid:
3585
fc32d580fe37 SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3584
diff changeset
108 jabber_link = (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto') +
fc32d580fe37 SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3584
diff changeset
109 request.formatter.text(account.jid) +
fc32d580fe37 SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3584
diff changeset
110 request.formatter.url(0))
3584
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
111 else:
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
112 jabber_link = ''
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
113
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
114 data.addRow((
5625
78f1be3c8777 MoinMoin.widget.browser: introduced feature for sorting tables (http://moinmo.in/FeatureRequests/SortableTables).
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 5488
diff changeset
115 (request.formatter.rawHTML(namelink), account.name),
3585
fc32d580fe37 SystemAdmin user browser: fix names/labels, optimize group membership calculation, cosmetic fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3584
diff changeset
116 request.formatter.rawHTML(grouppage_links),
3584
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
117 email_link,
5be4f4a8fa65 SystemAdmin user browser: handle empty email/jabber addresses correctly
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3573
diff changeset
118 jabber_link,
4055
f7e942210f52 bug fix for MoinMoinBugs/SystemAdminMailAccountData by using POST and forms for recoverpass and enable/disable useraccount
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 3585
diff changeset
119 recoverpass_link + enable_disable_link
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
120 ))
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
121
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
122 if data:
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
123 from MoinMoin.widget.browser import DataBrowserWidget
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
124
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
125 browser = DataBrowserWidget(request)
5938
f4e0854b1604 SystemAdmin user browser: show disabled user accounts at the botton of the list
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5625
diff changeset
126 browser.setData(data)
4094
1f6f713c526c userform.admin: fixed bug by nesting form tags.
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 4057
diff changeset
127 return browser.render()
2294
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
128
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
129 # No data
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
130 return ''
22749e92a461 new userprefs handling including plugins; todo: refactor prefs.py
Johannes Berg <johannes AT sipsolutions DOT net>
parents:
diff changeset
131