changeset 2072:d347a0303be1

Add JID field and a button to send account details with Jabber to user preferences.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Fri, 01 Jun 2007 01:41:27 +0200
parents aa761813d7bd
children afa784d8d58d
files MoinMoin/config/multiconfig.py MoinMoin/userform.py
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Thu May 31 21:31:40 2007 +0200
+++ b/MoinMoin/config/multiconfig.py	Fri Jun 01 01:41:27 2007 +0200
@@ -546,6 +546,7 @@
         ('password', _('Password'), "password", "36", ''),
         ('password2', _('Password repeat'), "password", "36", _('(Only for password change or new account)')),
         ('email', _('Email'), "text", "36", ''),
+        ('jid', _('Jabber ID'), "text", "36", ''),
         ('css_url', _('User CSS URL'), "text", "40", _('(Leave it empty for disabling user CSS)')),
         ('edit_rows', _('Editor size'), "text", "3", ''),
     ]
@@ -556,6 +557,7 @@
         'password': '',
         'password2': '',
         'email': '',
+        'jid': '',
         'css_url': '',
         'edit_rows': "20",
     }
@@ -656,6 +658,9 @@
 
         # check if mail is possible and set flag:
         self.mail_enabled = (self.mail_smarthost is not None or self.mail_sendmail is not None) and self.mail_from
+        
+        # check if jabber bot is available and set flag:
+        self.jabber_enabled = self.bot_host is not None
 
         # Cache variables for the properties below
         self._iwid = self._iwid_full = self._meta_dict = None
--- a/MoinMoin/userform.py	Thu May 31 21:31:40 2007 +0200
+++ b/MoinMoin/userform.py	Fri Jun 01 01:41:27 2007 +0200
@@ -621,6 +621,9 @@
 
         if self.cfg.mail_enabled:
             buttons.append(("account_sendmail", _('Mail me my account data')))
+            
+        if self.cfg.jabber_enabled:
+            buttons.append(("account_sendjabber", _('Send my my account data with Jabber')))
 
         if create_only:
             buttons = [("create_only", _('Create Profile'))]
@@ -731,6 +734,7 @@
         #Column('id', label=('ID'), align='right'),
         Column('name', label=('Username')),
         Column('email', label=('Email')),
+        Column('jabber', label=('Jabber')),
         Column('action', label=_('Action')),
     ]
 
@@ -750,12 +754,21 @@
             (request.formatter.url(1, 'mailto:' + account.email, css='mailto', do_escape=0) +
              request.formatter.text(account.email) +
              request.formatter.url(0)),
+            (request.formatter.url(1, 'xmpp:' + account.jid, css='mailto', do_escape=0) +
+             request.formatter.text(account.jid) +
+             request.formatter.url(0)),
             request.page.link_to(request, text=_('Mail me my account data'),
                                  querystr={"action":"userform",
                                            "email": account.email,
                                            "account_sendmail": "1",
                                            "sysadm": "users", },
-                                 rel='nofollow')
+                                 rel='nofollow'),
+            request.page.link_to(request, text=_('Send me my accound data with Jabber'),
+                                 querystr={"action":"userform",
+                                           "jid": account.jid,
+                                           "account_sendjabber": "1",
+                                           "sysadm": "users", },
+                                  rel='nofollow'),
         ))
 
     if data: