Attachment 'SystemAdmin.patch'

Download

   1 diff -r 54d9588300de MoinMoin/userform/admin.py
   2 --- a/MoinMoin/userform/admin.py	Sat Aug 16 10:37:40 2008 +0200
   3 +++ b/MoinMoin/userform/admin.py	Tue Aug 26 15:31:52 2008 +0200
   4 @@ -10,7 +10,7 @@
   5  from MoinMoin import user, wikiutil
   6  from MoinMoin.util.dataset import TupleDataset, Column
   7  from MoinMoin.Page import Page
   8 -
   9 +from MoinMoin.widget import html
  10  
  11  def do_user_browser(request):
  12      """ Browser for SystemAdmin macro. """
  13 @@ -62,13 +62,16 @@
  14                                               },
  15                                      rel='nofollow')
  16  
  17 -        recoverpass_link = request.page.link_to(
  18 -                            request, text=_('Mail account data'),
  19 -                            querystr={"action": "recoverpass",
  20 -                                      "email": account.email,
  21 -                                      "account_sendmail": "1",
  22 -                                      "sysadm": "users", },
  23 -                            rel='nofollow')
  24 +        # creates the POST data for recoverpass
  25 +        url = request.page.url(request)
  26 +        ret = html.FORM(action=url)
  27 +        ret.append(html.INPUT(type='hidden', name='action', value='recoverpass'))
  28 +        ret.append(html.INPUT(type='hidden', name='email', value=account.email))
  29 +        ret.append(html.INPUT(type='hidden', name='account_sendmail', value="1"))
  30 +        ret.append(html.INPUT(type='hidden', name='sysadm', value="users"))
  31 +        ret.append(html.INPUT(type='submit', name='recoverpass', value=_('Mail account data')))
  32 +
  33 +        recoverpass_link =  unicode(unicode(ret))
  34  
  35          if account.email:
  36              email_link = (request.formatter.url(1, 'mailto:' + account.email, css='mailto') +
  37 @@ -97,7 +100,7 @@
  38  
  39          browser = DataBrowserWidget(request)
  40          browser.setData(data)
  41 -        return browser.toHTML()
  42 +        return browser.toHTML(method="POST")
  43  
  44      # No data
  45      return ''
  46 diff -r 54d9588300de MoinMoin/widget/browser.py
  47 --- a/MoinMoin/widget/browser.py	Sat Aug 16 10:37:40 2008 +0200
  48 +++ b/MoinMoin/widget/browser.py	Tue Aug 26 15:31:52 2008 +0200
  49 @@ -93,11 +93,15 @@
  50          common[2] = self._makeoption(self._notempty, value == self.__notempty, self.__notempty)
  51          return '\n'.join(common + result)
  52  
  53 -    def format(self):
  54 +    def format(self, method="GET"):
  55 +        """
  56 +        formats the table
  57 +        @param method: GET or POST method
  58 +        """
  59          fmt = self.request.formatter
  60  
  61          result = []
  62 -        result.append(fmt.rawHTML('<form action="%s/%s" method="GET" name="%sform">' % (self.request.getScriptname(), wikiutil.quoteWikinameURL(self.request.page.page_name), self.data_id)))
  63 +        result.append(fmt.rawHTML('<form action="%s/%s" method="%s" name="%sform">' % (self.request.getScriptname(), wikiutil.quoteWikinameURL(self.request.page.page_name), method, self.data_id)))
  64          result.append(fmt.div(1))
  65  
  66          havefilters = False
  67 @@ -189,6 +193,9 @@
  68  
  69      toHTML = format # old name of "format" function DEPRECATED, will be removed in 1.7
  70  
  71 -    def render(self):
  72 -        self.request.write(self.format())
  73 +    def render(self, method="GET"):
  74 +        """
  75 +        @param method: GET or POST method
  76 +        """
  77 +        self.request.write(self.format(method=method))
  78  

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2008-08-26 13:33:29, 3.2 KB) [[attachment:SystemAdmin.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.