Attachment 'moin1-5-4-1wikiaction.patch'
Download 1 --- wikiaction_old.py 2006-11-20 18:56:58.000000000 +0100
2 +++ wikiaction.py 2006-11-20 21:59:04.000000000 +0100
3 @@ -522,10 +522,25 @@
4 def do_edit(pagename, request):
5 _ = request.getText
6
7 - if not request.user.may.write(pagename):
8 - Page(request, pagename).send_page(request,
9 +
10 + # Check if pagename is an existing page
11 + if Page(request, pagename).exists() == True:
12 + # User allowed to edit? If not, return with error msg
13 + if not request.user.may.write(pagename):
14 + Page(request, pagename).send_page(request,
15 msg = _('You are not allowed to edit this page.'))
16 - return
17 + return
18 +
19 + # Page does not exist? Check if pagename does still exist on disc.
20 + # If it does, kill it so as to have no acl conflicts when recreating it.
21 + elif Page(request, pagename).exists(True) == True:
22 + checklist = [0, 1]
23 + for use_underlay in checklist:
24 + pagedir = Page(request, pagename).getPagePath(use_underlay=use_underlay, check_create=0)
25 + if os.path.exists(pagedir):
26 + import distutils.dir_util
27 + distutils.dir_util.remove_tree(pagedir)
28 +
29
30 valideditors = ['text', 'gui',]
31 editor = ''
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.