forked from eventum/eventum
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
127 lines (102 loc) · 3.56 KB
/
init.php
File metadata and controls
127 lines (102 loc) · 3.56 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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php
/*
* This file is part of the Eventum (Issue Tracking System) package.
*
* @copyright (c) Eventum Team
* @license GNU General Public License, version 2 or later (GPL-2+)
*
* For the full copyright and license information,
* please see the COPYING and AUTHORS files
* that were distributed with this source code.
*/
if (!file_exists(__DIR__ . '/config/config.php') || !filesize(__DIR__ . '/config/config.php')) {
// redirect to setup
if (PHP_SAPI == 'cli') {
throw new RuntimeException('Eventum is not configured');
}
header('Location: setup/');
exit(0);
}
// setup change some PHP settings
ini_set('memory_limit', '512M');
// prevent session from messing up the browser cache
ini_set('session.cache_limiter', 'nocache');
require_once __DIR__ . '/globals.php';
$define = function ($name, $value) {
if (defined($name)) {
return;
}
define($name, $value);
};
// include local site config. may override any default
require_once APP_CONFIG_PATH . '/config.php';
/**
* Path for local overrides:
* APP_LOCAL_PATH/crm
* APP_LOCAL_PATH/custom_field
* APP_LOCAL_PATH/include
* APP_LOCAL_PATH/partner
* APP_LOCAL_PATH/templates
* APP_LOCAL_PATH/workflow
*/
$define('APP_LOCAL_PATH', APP_CONFIG_PATH);
$define('APP_COOKIE', 'eventum');
// define the user_id of system user
$define('APP_SYSTEM_USER_ID', 1);
// email address of anonymous user.
// if you want anonymous users getting access to your eventum.
$define('APP_ANON_USER', '');
// if full text searching is enabled
$define('APP_ENABLE_FULLTEXT', false);
$define('APP_FULLTEXT_SEARCH_CLASS', 'MySQL_Fulltext_Search');
$define('APP_AUTH_BACKEND', 'Mysql_Auth_Backend');
$define('APP_AUTH_BACKEND_ALLOW_FALLBACK', false);
$define('APP_DEFAULT_ASSIGNED_EMAILS', 1);
$define('APP_DEFAULT_NEW_EMAILS', 0);
$define('APP_DEFAULT_COPY_OF_OWN_ACTION', 0);
$define('APP_RELATIVE_URL', '/');
$define('APP_COOKIE_URL', APP_RELATIVE_URL);
$define('APP_COOKIE_DOMAIN', null);
$define('APP_DEFAULT_LOCALE', 'en_US');
$define('APP_CHARSET', 'UTF-8');
$define('APP_DEFAULT_TIMEZONE', 'UTC');
$define('APP_DEFAULT_WEEKDAY', 0);
if (!defined('APP_EMAIL_ENCODING')) {
if (APP_CHARSET == 'UTF-8') {
define('APP_EMAIL_ENCODING', '8bit');
} else {
define('APP_EMAIL_ENCODING', '7bit');
}
}
// Number of failed attempts before Back-Off locking kicks in.
// If set to false do not use Back-Off locking.
$define('APP_FAILED_LOGIN_BACKOFF_COUNT', false);
// How many minutes to lock account for during Back-Off
$define('APP_FAILED_LOGIN_BACKOFF_MINUTES', 15);
$define('APP_HIDE_CLOSED_STATS_COOKIE', 'eventum_hide_closed_stats');
// if set, normal calls to eventum are redirected to a maintenance page while
// requests to /manage/ still work
$define('APP_MAINTENANCE', false);
require_once APP_PATH . '/autoload.php';
Misc::stripInput($_POST);
// set default timezone
date_default_timezone_set(APP_DEFAULT_TIMEZONE);
Eventum\Monolog\Logger::initialize();
Language::setup();
// set charset
header('Content-Type: text/html; charset=' . APP_CHARSET);
// display maintenance message if requested.
if (APP_MAINTENANCE) {
$is_manage = (strpos($_SERVER['PHP_SELF'], '/manage/') !== false);
if (!$is_manage) {
$tpl = new Template_Helper();
$tpl->setTemplate('maintenance.tpl.html');
$tpl->displayTemplate();
exit(0);
}
}
// Default IRC category
$define('APP_EVENTUM_IRC_CATEGORY_DEFAULT', 'default');
$define('APP_EVENTUM_IRC_CATEGORY_REMINDER', APP_EVENTUM_IRC_CATEGORY_DEFAULT);
Eventum\DebugBarManager::initialize();
Eventum\Extension\ExtensionManager::getManager();