Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (44 sloc) 1.936 kb
ff20af9 Alvaro Lopez Ortega Adds the new admin
alobbs authored
1 # -*- coding: utf-8 -*-
2 #
3 # Cherokee-admin
4 #
5 # Authors:
6 # Alvaro Lopez Ortega <alvaro@alobbs.com>
7 #
8 # Copyright (C) 2010 Alvaro Lopez Ortega
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of version 2 of the GNU General Public
12 # License as published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # 02110-1301, USA.
23 #
24
25 import CTK
26 import Handler
27 from CTK.Plugin import instance_plugin
28
29 URL_APPLY = '/plugin/common/apply'
30 HELPS = [('modules_handlers_common', N_("List & Send"))]
31
32 NOTE_PATHINFO = N_("Allow extra tailing paths")
33 NOTE_DIRLIST = N_("Allow to list directory contents")
34
35
36 class Plugin_common (Handler.PluginHandler):
37 def __init__ (self, key, **kwargs):
38 Handler.PluginHandler.__init__ (self, key, **kwargs)
39 Handler.PluginHandler.AddCommon (self)
40
41 table = CTK.PropsTable()
42 table.Add (_('Allow PathInfo'), CTK.CheckCfgText('%s!allow_pathinfo'%(key), False, _('Allow')), _(NOTE_PATHINFO))
43 table.Add (_('Allow Directory Listing'), CTK.CheckCfgText('%s!allow_dirlist'%(key), True, _('Allow')), _(NOTE_DIRLIST))
44
45 submit = CTK.Submitter (URL_APPLY)
46 submit += table
47
48 self += CTK.RawHTML ('<h2>%s</h2>' %(_('Parsing')))
eca1cc3 Alvaro Lopez Ortega Handler common parameters were not being responsive to events in
alobbs authored
49 self += CTK.Indenter (submit)
ff20af9 Alvaro Lopez Ortega Adds the new admin
alobbs authored
50 self += instance_plugin('file', key, show_document_root=False)
51 self += instance_plugin('dirlist', key, show_document_root=False)
52
e09f720 Alvaro Lopez Ortega Seeding random() once is enough.
alobbs authored
53 CTK.publish ('^%s'%(URL_APPLY), CTK.cfg_apply_post, method="POST")
Something went wrong with that request. Please try again.