Attachment 'togglesplash.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - togglesplash action
   4 
   5     This is the backend of the ToggleSplash macro
   6     
   7     @copyright: 2007 by Oliver Siemoneit
   8     @license: GNU GPL, see COPYING for details.
   9 """
  10 
  11 from MoinMoin.Page import Page
  12 from MoinMoin import wikiutil
  13 
  14 def execute(pagename, request):
  15     _ = request.getText
  16     page = Page(request, pagename)
  17      
  18     if not request.user.valid:
  19         return page.send_page(request,
  20             msg = _('Please log in first.'))
  21 
  22     if request.form.has_key('action') and request.form.has_key('ticket'):
  23         if not wikiutil.checkTicket(request, request.form['ticket'][0]):
  24             return page.send_page(request,
  25                 msg = _('Please use the interactive user interface.'))
  26         if request.form.has_key('toggle_splash'):
  27             request.user.show_splash = request.cfg.show_splash
  28             request.user.save()
  29             return page.send_page(request, msg = _("User preferences saved!"))
  30         else:
  31             request.user.show_splash = ''
  32             request.user.save()
  33             return page.send_page(request, msg = _("User preferences saved!"))
  34 
  35     return page.send_page(request, msg = _('Please use the interactive user interface.'))

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] (2007-01-20 22:13:02, 5.4 KB) [[attachment:AdminSplash.diff]]
  • [get | view] (2007-01-19 16:26:31, 1.5 KB) [[attachment:ToggleSplash.py]]
  • [get | view] (2007-01-19 16:21:49, 0.4 KB) [[attachment:multiconfig.diff]]
  • [get | view] (2007-01-19 16:25:35, 1.3 KB) [[attachment:request__init__.diff]]
  • [get | view] (2007-01-20 22:13:30, 1.2 KB) [[attachment:togglesplash.py]]
  • [get | view] (2007-01-19 16:24:18, 0.5 KB) [[attachment:user.diff]]
 All files | Selected Files: delete move to page copy to page

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