-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.php
executable file
·211 lines (185 loc) · 7.04 KB
/
settings.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?php
require_once __DIR__ . '/local/agora/lib.php';
get_debug();
// Specific Àgora params
$CFG->isagora = true;
$CFG->iseoi = $agora['iseoi'];
$CFG->isodissea = false;
$CFG->isalexandria = false;
$CFG->center = $school_info['code'] ?? $school_info['id_moodle'];
// The following line calculates correctly the diskPercent (uploading files will be disabled when diskPercent >= 100)
$CFG->diskPercent = $school_info['diskPercent_moodle'] ?? 0;
$CFG->userquota = 0; // Block private files
// Force values for standard Moodle params to ensure proper values
$CFG->legacyfilesinnewcourses = false;
$CFG->updateautocheck = false;
$CFG->disableupdatenotifications = true;
$CFG->disableupdateautodeploy = true;
$CFG->disableonclickaddoninstall = true;
$CFG->updateminmaturity = 0;
$CFG->updatenotifybuilds = false;
$CFG->core_media_enable_mp3 = false;
$CFG->core_media_enable_html5audio = true;
$CFG->core_media_enable_html5video = true;
$CFG->repositorygetfiletimeout = 300;
$CFG->alternateloginurl = '';
$CFG->mymoodleredirect = false;
$CFG->enablestats = false;
$CFG->enableanalytics = false;
$CFG->themedesignermode = false;
$CFG->cachejs = true;
$CFG->langcache = true;
$CFG->langstringcache = true;
$CFG->slasharguments = true;
$CFG->themelist = 'xtecboost';
$CFG->useexternalyui = false;
$CFG->yuicomboloading = true;
$CFG->cachetemplates = true;
$CFG->timezone = 99; // Changed by default to Server's local time
$CFG->cronremotepassword = '';
$CFG->cronclionly = 1;
// Encryption in https is provided by the load balancer.
$CFG->sslproxy = true;
// Captcha keys
$CFG->recaptchapublickey = $agora['recaptchapublickey'];
$CFG->recaptchaprivatekey = $agora['recaptchaprivatekey'];
// E-mail
$CFG->smtphosts = $agora['mail']['server'];
$CFG->smtpuser = $agora['mail']['username'];
$CFG->smtppass = $agora['mail']['userpwd'];
$CFG->noreplyaddress = $agora['mail']['reply'];
// $CFG->supportemail = $agora['mail']['reply'];
$CFG->smtpsecure = 'tls';
$CFG->smtpmaxbulk = 15;
$CFG->emailfromvia = 0;
// Cleanup
$CFG->disablegradehistory = 1;
$CFG->tempdatafoldercleanup = 24;
// Rules
$CFG->forceloginforprofiles = 1;
$CFG->opentogoogle = 0;
// Ajax & Javascript
$CFG->enableajax = 1;
$CFG->disablecourseajax = 0;
// Backups
$CFG->backup_auto_active = 0;
// Tell Moodle not to be worried if cron executes every 10 minutes
$CFG->expectedcronfrequency = 600;
// These variable define DEFAULT block variables for new courses
$CFG->defaultblocks_override = ':calendar_month,activity_modules';
// Language parameters
$CFG->langotherroot = __DIR__ . '/langpacks/';
$CFG->langlocalroot = __DIR__ . '/langpacks/';
$CFG->skiplangupgrade = true;
// Path of the cacheconfig.php file, to have only one MUC file for Àgora (instead of having one for each site in moodledata/usuX/muc/config.php).
$CFG->altcacheconfigpath = __DIR__ . '/local/agora/muc/';
$CFG->siteidentifier = $CFG->dbuser;
// Cache servers configuration for MUC, used in custom cacheconfig.php
$CFG->memcache_servers = (!empty($agora['moodle2']['memcache_servers'])) ? $agora['moodle2']['memcache_servers'] : '';
$CFG->memcache_prefix = $CFG->dbuser . '_';
$CFG->redis_servers = (!empty($agora['moodle2']['redis_servers'])) ? $agora['moodle2']['redis_servers'] : '';
$CFG->redis_prefix = $CFG->dbuser . '_';
// Session configuration
$CFG->session_handler_class = '\core\session\database'; // Default
$CFG->session_database_acquire_lock_timeout = 120;
$CFG->sessioncookie = $CFG->dbuser;
if (!empty($agora['moodle2']['redis_session_servers'])) {
$CFG->session_handler_class = '\core\session\redis';
$CFG->session_redis_host = $agora['moodle2']['redis_session_servers'];
$CFG->session_redis_port = 6379; // Optional
$CFG->session_redis_database = 0; // Optional, default is db 0
$CFG->session_redis_auth = ''; // Optional, default is don't set one
$CFG->session_redis_prefix = $CFG->redis_prefix . 'sess_'; // Optional, default is don't set one
$CFG->session_redis_acquire_lock_timeout = 120;
$CFG->session_redis_lock_expire = 7200;
// Move locking. Default location is moodledata
$CFG->local_redislock_redis_server = $agora['moodle2']['redis_session_servers'];
$CFG->lock_factory = '\\local_redislock\\lock\\redis_lock_factory';
$CFG->local_redislock_logging = false;
} else {
$CFG->lock_factory = '\\core\\lock\\db_record_lock_factory';
}
// MUC configuration
if (!empty($agora['server']['root'])) {
$CFG->agora_muc_path = $agora['server']['root'] . $agora['moodle2']['localmuc'] . '/' . $CFG->dbuser;
$CFG->cachedir = $CFG->agora_muc_path . '/cache';
$CFG->localcachedir = $CFG->agora_muc_path . '/localcache';
}
// if (isset($agora['proxy']['host']) && !empty($agora['proxy']['host'])) {
// $CFG->proxyhost = $agora['proxy']['host'];
// $CFG->proxyport = $agora['proxy']['port'];
// $CFG->proxyuser = $agora['proxy']['user'];
// $CFG->proxypassword = $agora['proxy']['pass'];
//}
$CFG->customusermenuitems = 'profile,moodle|/user/profile.php
messages,message|/message/index.php
grades,grades|/grade/report/mygrades.php
badges,badges|/badges/mybadges.php
calendar,core_calendar|/calendar/view.php?view=month';
$CFG->forced_plugin_settings = [
'block_configurable_reports' => [
'sqlsecurity' => true,
'dbhost' => '',
'dbname' => '',
'dbuser' => '',
'dbpass' => '',
],
'logstore_standard' => [
'loglifetime' => 365 * 2,
],
'filter_wiris' => [
'uninstall' => 1,
],
'backup' => [
'loglifetime' => 7,
'backup_auto_delete_days' => 365,
'backup_auto_min_kept' => 1,
],
'tool_recyclebin' => [
// 'coursebinenable' => 1,
'coursebinexpiry' => 604800,
'categorybinenable' => 1,
'categorybinexpiry' => 604800,
]
];
// $CFG->enable_hour_restrictions = 1; /* Set in database */
// This param (hour_restrictions) can be serialized. This is useful for setting it in database
// Values for days: 0 = sunday, 1 = monday, ..., 6 = saturday
if ($CFG->iseoi) {
$CFG->hour_restrictions = [
['start' => '16:00', 'end' => '23:59', 'days' => '1|2|3|4|5',],
['start' => '00:00', 'end' => '23:59', 'days' => '0|6',],
];
} else {
$CFG->hour_restrictions = [
['start' => '9:00', 'end' => '13:59', 'days' => '1|2|3|4|5',],
['start' => '15:00', 'end' => '16:59', 'days' => '1|2|3|4|5',],
];
}
// Extensions added to allow the upload of these files in assignments.
$CFG->customfiletypes = [
(object)[
'extension' => 'py',
'type' => 'text/x-python',
'icon' => 'archive',
'customdescription' => 'Python file',
],
(object)[
'extension' => 'pyc',
'type' => 'application/x-python-code',
'icon' => 'archive',
'customdescription' => 'Python file code',
],
(object)[
'extension' => 'pyo',
'type' => 'application/x-python-code',
'icon' => 'archive',
'customdescription' => 'Python file code',
],
(object)[
'extension' => 'ipynb',
'type' => 'application/vnd.jupyter',
'icon' => 'archive',
'customdescription' => 'Jupyter Notebook',
],
];