Dotclear

source: plugins/blocNotes/index.php @ 459

Revision 459, 1.9 KB checked in by sacha, 15 years ago (diff)

Ajout des vérifications pour éviter l'exécution des plugins en dehors de Dotclear

Line 
1<?php 
2# ***** BEGIN LICENSE BLOCK *****
3#
4# This file is part of Bloc-Notes.
5# Copyright 2008 Moe (http://gniark.net/)
6#
7# Bloc-Notes is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or
10# (at your option) any later version.
11#
12# Bloc-Notes is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program.  If not, see <http://www.gnu.org/licenses/>.
19#
20# Icons (*.png) are from Tango Icon theme : http://tango.freedesktop.org/Tango_Icon_Gallery
21#
22# ***** END LICENSE BLOCK *****
23if (!defined('DC_CONTEXT_ADMIN')) { return; }
24
25     try
26     {
27          if (!empty($_POST['saveconfig']))
28          {
29               blocNotes::putSettings();
30               http::redirect($p_url.'&saveconfig=1');
31          }
32     }
33     catch (Exception $e)
34     {
35          $core->error->add($e->getMessage());
36     }
37
38     if (isset($_GET['saveconfig']))
39     {
40          $msg = __('Configuration successfully updated.');
41     }
42
43?>
44<html>
45<head>
46     <title><?php echo __('Notebook'); ?></title>
47     <?php echo dcPage::jsPageTabs($default_tab); ?>
48     <style type="text/css">
49          textarea {width:100%;}
50     </style>
51</head>
52<body>
53
54     <h2><?php echo html::escapeHTML($core->blog->name).' &gt '.__('Notebook'); ?></h2>
55
56     <?php 
57          if (!empty($msg)) {echo '<div class="message">'.$msg.'</div><p></p>';}
58     ?>
59
60     <div id="settings" title="<?php echo __('settings'); ?>">
61          <form method="post" action="<?php echo http::getSelfURI(); ?>">
62               <?php blocNotes::form(); ?>
63               
64
65               <p><?php echo $core->formNonce(); ?></p>
66               <p><input type="submit" name="saveconfig" value="<?php echo __('Save configuration'); ?>" /></p>
67          </form>
68     </div>
69
70</body>
71</html>
Note: See TracBrowser for help on using the repository browser.

Sites map