-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup_controller.php
More file actions
41 lines (33 loc) · 1.12 KB
/
setup_controller.php
File metadata and controls
41 lines (33 loc) · 1.12 KB
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
39
40
41
<?php
// no direct access
defined('EMONCMS_EXEC') or die('Restricted access');
function setup_controller()
{
global $path,$session,$route,$mysqli,$fullwidth;
$result = false;
require_once "Modules/setup/setup_model.php";
$setup = new Setup($mysqli);
$setup_access = false;
if ($setup->status()=="unconfigured") {
$setup_access = true;
}
if ($route->action=="set_status" && $setup_access) {
$route->format = "text";
$result = $setup->set_status(get("mode"));
}
if ($session["write"] || $setup_access || $route->is_ap) {
$setup_write = false;
if ($session["write"] || $setup_access) {
$setup_write = true;
}
if ($route->action=="") {
if (file_exists("Modules/network/network_view.php")) {
$result = view("Modules/network/network_view.php",array("mode"=>"setup", "write"=>$setup_write));
} else {
return ''; // empty strings force user back to login
}
}
}
$fullwidth = false;
return array('content'=>$result, 'fullwidth'=>true);
}