Attachment 'moin153-usernamespace.patch'

Download

   1 diff -u -r moin-1.5.3-orig/MoinMoin/action/MyPages.py moin-1.5.3/MoinMoin/action/MyPages.py
   2 --- moin-1.5.3-orig/MoinMoin/action/MyPages.py	2006-04-15 17:13:22.000000000 -0400
   3 +++ moin-1.5.3/MoinMoin/action/MyPages.py	2006-05-08 15:14:41.000000000 -0400
   4 @@ -29,8 +29,12 @@
   5          wikiurl = wikiutil.mapURL(request, wikiurl)
   6          homepageurl = wikiutil.join_wiki(wikiurl, wikitail)
   7          request.http_redirect('%s?action=MyPages' % homepageurl)
   8 -        
   9 -    homepage = Page(request, username)
  10 +
  11 +    homepagename = username
  12 +    if request.cfg.user_namespace:
  13 +        homepagename = request.cfg.user_namespace + username
  14 +
  15 +    homepage = Page(request, homepagename)
  16      if not homepage.exists():
  17          return homepage.send_page(request,
  18              msg = _('Please first create a homepage before creating additional pages.'))
  19 @@ -48,9 +52,9 @@
  20  the group pages.
  21  
  22  ||'''Add a new personal page:'''||'''Related access control list group:'''||
  23 -||[[NewPage(HomepageReadWritePageTemplate,read-write page,%(username)s)]]||["%(username)s/ReadWriteGroup"]||
  24 -||[[NewPage(HomepageReadPageTemplate,read-only page,%(username)s)]]||["%(username)s/ReadGroup"]||
  25 -||[[NewPage(HomepagePrivatePageTemplate,private page,%(username)s)]]||%(username)s only||
  26 +||[[NewPage(HomepageReadWritePageTemplate,read-write page,%(homepagename)s)]]||["%(homepagename)s/ReadWriteGroup"]||
  27 +||[[NewPage(HomepageReadPageTemplate,read-only page,%(homepagename)s)]]||["%(homepagename)s/ReadGroup"]||
  28 +||[[NewPage(HomepagePrivatePageTemplate,private page,%(homepagename)s)]]||["%(homepagename)s"] only||
  29  
  30  """, formatted=False)
  31      pagecontent = pagecontent % locals()
  32 diff -u -r moin-1.5.3-orig/MoinMoin/multiconfig.py moin-1.5.3/MoinMoin/multiconfig.py
  33 --- moin-1.5.3-orig/MoinMoin/multiconfig.py	2006-04-07 14:22:01.000000000 -0400
  34 +++ moin-1.5.3/MoinMoin/multiconfig.py	2006-05-08 15:14:25.000000000 -0400
  35 @@ -439,6 +439,7 @@
  36      user_transient_fields =  ['id', 'valid', 'may', 'auth_username', 'trusted', 'password', 'password2', 'auth_method', 'auth_attribs']
  37  
  38      user_homewiki = 'Self' # interwiki name for where user homepages are located
  39 +    user_namespace = '' # Prefix for all user homepages, such as "User/"
  40  
  41      unzip_single_file_size = 2.0 * 1000**2
  42      unzip_attachments_space = 200.0 * 1000**2
  43 diff -u -r moin-1.5.3-orig/MoinMoin/wikiutil.py moin-1.5.3/MoinMoin/wikiutil.py
  44 --- moin-1.5.3-orig/MoinMoin/wikiutil.py	2006-04-09 08:59:40.000000000 -0400
  45 +++ moin-1.5.3/MoinMoin/wikiutil.py	2006-05-08 15:14:17.000000000 -0400
  46 @@ -731,6 +731,9 @@
  47      if not username:
  48          return None # anon user
  49  
  50 +    if request.cfg.user_namespace:
  51 +        username = request.cfg.user_namespace + username
  52 +
  53      homewiki = request.cfg.user_homewiki
  54      if homewiki == request.cfg.interwikiname:
  55          homewiki = 'Self'

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-05-08 19:27:44, 2.8 KB) [[attachment:moin153-usernamespace.patch]]
  • [get | view] (2006-05-11 15:13:53, 3.4 KB) [[attachment:moin153-usernamespace2.patch]]
  • [get | view] (2006-11-13 16:29:39, 3.4 KB) [[attachment:moin156-usernamespace.patch]]
  • [get | view] (2006-11-13 18:32:28, 4.0 KB) [[attachment:moin156-usernamespace2.patch]]
 All files | Selected Files: delete move to page copy to page

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