-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.php
executable file
·53 lines (45 loc) · 1.27 KB
/
index.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* This is the main loader and controller init script for the Propagator project
* It just loads the config, creates a controller and invokes it. See
* lib/Propagator.php for the main project code.
*
* @author Shlomi Noach <[email protected]>
* @license Apache 2.0 license. See LICENSE document for more info
* @created 2013-10-25
*
**/
/**
* This file and others in this project are forked from Box Anemometer,
* see https://github.com/box/Anemometer
* Box Anemometer authors and license are:
*
* @author Gavin Towey <[email protected]> and Geoff Anderson <[email protected]>
* @license Apache 2.0 license. See LICENSE document for more info
*
**/
set_include_path( get_include_path() . PATH_SEPARATOR . "./lib");
require "Helpers.php";
require "Propagator.php";
error_reporting(E_ALL);
$action = (isset($_REQUEST['action']) && !empty($_REQUEST['action'])) ? $_REQUEST['action'] : 'index';
$conf = array();
include "conf/config.inc.php";
if (empty($conf))
{
$action = 'noconfig';
}
$controller = new Propagator($conf);
if(!$controller->get_auth_user()) {
print "Unauthorized access";
throw new Exception("Unauthorized access");
}
if (is_callable(array($controller, $action)))
{
$controller->$action();
}
else
{
print "Invalid action ($action)";
}
?>