-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
73 lines (63 loc) · 2.4 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
require_once "web.lib/db.php";
require_once "web.lib/web.php";
require_once "web.lib/html.php";
require_once "web.lib/roles.php";
require_once "web.lib/functions.php";
include_once "conf/module.conf.php";
define("LIBPATH", str_replace("\\", "/", dirname(__FILE__).'/lib'));
define("FILE_ROOT", str_replace("\\", "/", dirname(__FILE__)."/files/"));
define("MEDIA_ROOT", str_replace("\\", "/", dirname(__FILE__)."/media/"));
define("ROOT", str_replace("\\", "/", dirname(__FILE__)));
set_include_path(get_include_path() . PATH_SEPARATOR . LIBPATH);
require_once "crystal-0.4/Crystal.php";
// ============== Init web ==============
function init_PRE_ALL(&$w) {
global $modules;
// add this to the audit table!
$blacklist = array();
foreach ($modules as $name => $options) {
if ($options['audit'] === false) {
$blacklist[] = array($name,"*");
} else if ($options['audit'] === true && $options['audit_blacklist']) {
foreach($options['audit_blacklist'] as $action) {
$blacklist[]=array($name,$action);
}
}
}
$w->Admin->addAuditLogEntry($blacklist);
// set the top navigation
$nav = array();
if ($w->auth->loggedIn()) {
$nav[]=$w->menuLink("main/index","Home");
$nav[]=$w->menuLink("inbox/index","Inbox".$w->service('Inbox')->inboxCountMarker());
$nav[]=$w->menuLink("news/index","News".$w->service('News')->getUserNewsCountMarker());
foreach ($modules as $name => $options) {
if ($options['topmenu'] && $name != "inbox" && $name != "news") {
$w->menuLink($name."/index",ucfirst($name),$nav);
}
}
}
$w->ctx("top_navigation", $nav);
}
//=============== Timezone ======================
date_default_timezone_set('Australia/Sydney');
//=============== init web.php ==================
$web = new Web();
$db_config = array(
'hostname' => 'localhost',
'username' => 'flow_user',
'password'=> '4UVCy@a8dd',
'database' => 'flow',
'driver' => 'mysql'
);
$web->db = Crystal::db($db_config);
$web->setPreHandlers("init");
$web->setModules($modules);
$web->setLogLevel("info");
$web->_webroot = "https://flow.pyramidpower.com.au";
define("WEBROOT", $web->_webroot);
//============== Initial Context Items =========
$web->ctx("COMPANY_NAME","Pyramid Power");
//============== start application =============
$web->start();