36 lines
1.4 KiB
Plaintext

$OpenBSD: patch-editor_php,v 1.1 2011/09/27 11:15:00 sthen Exp $
Allow editor to be enabled via a config file rather than editing the
editor.php script itself.
--- editor.php.orig Fri Feb 18 22:52:38 2011
+++ editor.php Fri Feb 18 22:52:47 2011
@@ -6,13 +6,6 @@ require_once 'Weathermap.class.php';
// so that you can't have the editor active, and not know about it.
$ENABLED=false;
-if(! $ENABLED)
-{
- print "<p>The editor has not been enabled yet. You need to set ENABLED=true at the top of editor.php</p>";
- print "<p>Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. There is more information in the install guide section of the manual.</p>";
- exit();
-}
-
// sensible defaults
$mapdir='configs';
$cacti_base = '../../';
@@ -21,6 +14,13 @@ $ignore_cacti=FALSE;
$configerror = '';
$config_loaded = @include_once 'editor-config.php';
+
+if(! $ENABLED)
+{
+ print "<p>The editor has not been enabled yet. You need to set ENABLED=true at the top of editor-config.php</p>";
+ print "<p>Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. There is more information in the install guide section of the manual.</p>";
+ exit();
+}
// these are all set via the Editor Settings dialog, in the editor, now.
$use_overlay = FALSE; // set to TRUE to enable experimental overlay showing VIAs