-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsite-config.php
executable file
·51 lines (41 loc) · 1.73 KB
/
site-config.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
<?php
require_once (dirname(__FILE__, 2) . '/config/dblib-mysql.php');
global $school_info;
$centre = getSchoolInfo('Nodes');
global $agora, $isAgora, $isBlocs, $diskPercentNodes;
if (isset($school_info['status_nodes']) && ($school_info['status_nodes'] !== 'active')) {
header('Location: ' . WWWROOT . 'error.php?s=moodle&' . $school_info['status_nodes'] . '=' . $centre);
exit;
}
$isAgora = true;
$isBlocs = false;
define('CENTRE', $centre);
define('DB_NAME', $agora['nodes']['userprefix'] . $school_info['id_nodes']);
define('DB_HOST', $school_info['dbhost_nodes']);
define('UPLOADS', 'wp-content/uploads/' . $agora['nodes']['userprefix'] . $school_info['id_nodes']);
define('ENVIRONMENT', $agora['server']['enviroment']);
define('SCHOOL_CODE', $school_info['code']);
define('SCHOOL_TYPE', $school_info['type']);
// Check for subdomain
if (!empty($school_info['url_type']) && ($school_info['url_type'] === 'subdomain') && !empty($school_info['url_host'])) {
define('WP_SITEURL', $agora['server']['html']);
define('WP_HOME', $agora['server']['html']);
} else {
define('WP_SITEURL', $agora['server']['html'] . $centre . '/');
define('WP_HOME', $agora['server']['html'] . $centre . '/');
}
$diskPercentNodes = $school_info['diskPercent_nodes'] ?? 0;
if (isset($agora['iseoi']) && $agora['iseoi']) {
define('XTEC_MAIL_IDAPP', 'AGORAEOI');
} elseif (isset($agora['iseoi'])) {
define('XTEC_MAIL_IDAPP', 'AGORA');
} else {
define('XTEC_MAIL_IDAPP', 'XTECBLOCS');
}
// Load only the plugin files associated with the current type of school to improve the performance.
if (isset($agora['isProjecte']) && !$agora['isProjecte']) {
$agora['nodes']['plugins_to_remove'] = [
'astra-sites',
'wpforms-lite',
];
}