Attachment 'moin156-usernamespace2.patch'
Download 1 diff -u -r moin-1.5.6-orig/MoinMoin/action/MyPages.py moin-1.5.6/MoinMoin/action/MyPages.py
2 --- moin-1.5.6-orig/MoinMoin/action/MyPages.py 2006-07-10 07:13:46.000000000 -0400
3 +++ moin-1.5.6/MoinMoin/action/MyPages.py 2006-11-13 11:18:05.000000000 -0500
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.6-orig/MoinMoin/multiconfig.py moin-1.5.6/MoinMoin/multiconfig.py
33 --- moin-1.5.6-orig/MoinMoin/multiconfig.py 2006-10-08 09:16:29.000000000 -0400
34 +++ moin-1.5.6/MoinMoin/multiconfig.py 2006-11-13 11:14:43.000000000 -0500
35 @@ -460,6 +460,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.6-orig/MoinMoin/Page.py moin-1.5.6/MoinMoin/Page.py
44 --- moin-1.5.6-orig/MoinMoin/Page.py 2006-10-08 11:37:04.000000000 -0400
45 +++ moin-1.5.6/MoinMoin/Page.py 2006-11-13 11:21:15.000000000 -0500
46 @@ -1422,7 +1422,7 @@
47
48 @param request: the request object
49 """
50 - if request.user.valid and request.user.name == self.page_name:
51 + if request.user.valid and request.cfg.user_namespace+request.user.name == self.page_name:
52 missingpage = wikiutil.getSysPage(request, 'MissingHomePage')
53 else:
54 missingpage = wikiutil.getSysPage(request, 'MissingPage')
55 diff -u -r moin-1.5.6-orig/MoinMoin/user.py moin-1.5.6/MoinMoin/user.py
56 --- moin-1.5.6-orig/MoinMoin/user.py 2006-10-08 09:06:37.000000000 -0400
57 +++ moin-1.5.6/MoinMoin/user.py 2006-11-13 13:28:37.000000000 -0500
58 @@ -913,7 +913,7 @@
59 wikiname, pagename = wikiutil.getInterwikiHomePage(self._request,
60 self.name)
61 if wikiname == 'Self':
62 - if not wikiutil.isStrictWikiname(self.name):
63 + if not wikiutil.isStrictWikiname(pagename):
64 markup = '["%s"]' % pagename
65 else:
66 markup = pagename
67 diff -u -r moin-1.5.6-orig/MoinMoin/wikiutil.py moin-1.5.6/MoinMoin/wikiutil.py
68 --- moin-1.5.6-orig/MoinMoin/wikiutil.py 2006-10-08 09:03:28.000000000 -0400
69 +++ moin-1.5.6/MoinMoin/wikiutil.py 2006-11-13 11:15:35.000000000 -0500
70 @@ -734,6 +734,9 @@
71 if not username:
72 return None # anon user
73
74 + if request.cfg.user_namespace:
75 + username = request.cfg.user_namespace + username
76 +
77 homewiki = request.cfg.user_homewiki
78 if homewiki == request.cfg.interwikiname:
79 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.You are not allowed to attach a file to this page.