Attachment 'moin-1.5-allow-create-form-disabling.patch'

Download

   1 diff -rux *.pyc sandbox/moin-1.5.0/build/lib/MoinMoin/multiconfig.py /usr/custom/moin-1.5/lib/python2.4/site-packages/MoinMoin/multiconfig.py
   2 --- sandbox/moin-1.5.0/build/lib/MoinMoin/multiconfig.py	Thu Dec 29 03:34:24 2005
   3 +++ /usr/custom/moin-1.5/lib/python2.4/site-packages/MoinMoin/multiconfig.py	Wed Apr 12 15:21:42 2006
   4 @@ -355,6 +355,8 @@
   5      #user_checkbox_remove = ['edit_on_doubleclick', 'show_nonexist_qm', 'show_toolbar', 'show_topbottom',
   6      #                        'show_fancy_diff', 'wikiname_add_spaces', 'remember_me', 'disabled',]
   7      user_checkbox_remove = []
   8 +
   9 +    user_account_creation_enabled = True
  10      
  11      user_form_fields = [
  12          ('name', _('Name'), "text", "36", _("(Use Firstname''''''Lastname)")),
  13 @@ -371,6 +373,7 @@
  14          ##('', _('Date format'), [self._dtfmt_select()])
  15          ##('', _('Preferred language'), [self._lang_select()])
  16      ]
  17 +
  18      user_form_defaults = { # key: default
  19          'name': '',
  20          'aliasname': '',
  21 diff -rux *.pyc sandbox/moin-1.5.0/build/lib/MoinMoin/userform.py /usr/custom/moin-1.5/lib/python2.4/site-packages/MoinMoin/userform.py
  22 --- sandbox/moin-1.5.0/build/lib/MoinMoin/userform.py	Sun Dec 18 00:52:09 2005
  23 +++ /usr/custom/moin-1.5/lib/python2.4/site-packages/MoinMoin/userform.py	Wed Apr 12 15:12:51 2006
  24 @@ -443,6 +443,8 @@
  25          _ = self._
  26          self.make_form()
  27  
  28 +        create_enable = self.cfg.user_account_creation_enabled
  29 +
  30          if self.request.user.valid and not create_only:
  31              buttons = [('save', _('Save'))]
  32              uf_remove = self.cfg.user_form_remove
  33 @@ -538,10 +540,15 @@
  34                  # IMPORTANT: login should be first to be the default
  35                  # button when a user hits ENTER.
  36                  ('login', _('Login')),
  37 -                ("create", _('Create Profile')),
  38              ]
  39 +            if create_enable:
  40 +                buttons.append(("create", _('Create Profile')))
  41              for key, label, type, length, textafter in self.cfg.user_form_fields:
  42 -                if key in ('name', 'password', 'password2', 'email'):
  43 +                if create_enable:
  44 +                    keys = ('name', 'password', 'password2' ,'email')
  45 +                else:
  46 +                    keys = ('name', 'password')
  47 +                if key in keys:
  48                      self.make_row(_(label),
  49                                [ html.INPUT(type=type, size=length, name=key,
  50                                             value=''),

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] (2006-04-12 20:20:56, 2.4 KB) [[attachment:moin-1.5-allow-create-form-disabling.patch]]
  • [get | view] (2006-04-12 20:33:37, 3.0 KB) [[attachment:moin_useradd.py]]
 All files | Selected Files: delete move to page copy to page

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