forked from howardjones/network-weathermap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editor.php
38 lines (27 loc) · 1.53 KB
/
editor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
// This file is from Network Weathermap v0.98
require_once dirname(__FILE__) . '/lib/all.php';
//require_once dirname(__FILE__) . '/lib/EditorUI.php';
use Weathermap\Editor\EditorUI;
// so that you can't have the editor active, and not know about it.
$editorEnabled = false;
// If we're embedded in the Cacti UI (included from weathermap-cacti-plugin-editor.php), then authentication has happened. Enable the editor.
if (isset($cameFromHost) && $cameFromHost == true) {
$editorEnabled = true;
} else {
$cameFromHost = false;
}
$hostType = isset($hostType) ? $hostType : '';
$hostEditorURL = isset($hostEditorURL) ? $hostEditorURL : 'editor.php';
$hostPluginURL = isset($hostPluginURL) ? $hostPluginURL : '';
if (!$editorEnabled) {
print "<p>The editor has not been enabled for standalone use yet.</p>";
print "<h3>Cacti</h3><p>You <b>do not</b> need to do this to use the editor from within Cacti - just give users permission to edit maps in the <a href='../../user_admin.php'>User Management page</a>.</p>";
print "<h3>Standalone Use</h3><p>For standalone use, you need to set ENABLED=true at the top of " . basename(__FILE__) . "</p>";
print "<p>Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. Not limiting access in some way can be a security risk. There is more information in the install guide section of the manual.</p>";
exit;
}
$ui = new EditorUI();
$ui->moduleChecks();
chdir(dirname(__FILE__));
$ui->main($_REQUEST, $_COOKIE, $cameFromHost);