MDL-26140 hide unfinished experimental DTL pages
[moodle.git] / admin / settings / server.php
CommitLineData
11b749ca 1<?php
1ea1bcb3 2
3// This file defines settingpages and externalpages under the "server" category
4
a559f630 5if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
6
7
1ea1bcb3 8// "systempaths" settingpage
9$temp = new admin_settingpage('systempaths', get_string('systempaths','admin'));
eef868d1 10$temp->add(new admin_setting_configselect('gdversion', get_string('gdversion','admin'), get_string('configgdversion', 'admin'), check_gd_version(), array('0' => get_string('gdnot'),
11 '1' => get_string('gd1'),
61240489 12 '2' => get_string('gd2'))));
220a90c5 13$temp->add(new admin_setting_configexecutable('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), ''));
14$temp->add(new admin_setting_configexecutable('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), ''));
6af80cae 15$temp->add(new admin_setting_configexecutable('pathtodot', get_string('pathtodot', 'admin'), get_string('pathtodot_help', 'admin'), ''));
1caea91e 16$ADMIN->add('server', $temp);
1ea1bcb3 17
18
19
20// "email" settingpage
21$temp = new admin_settingpage('mail', get_string('mail','admin'));
f6b923ea 22$temp->add(new admin_setting_configtext('smtphosts', get_string('smtphosts', 'admin'), get_string('configsmtphosts', 'admin'), '', PARAM_RAW));
1ea1bcb3 23$temp->add(new admin_setting_configtext('smtpuser', get_string('smtpuser', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_NOTAGS));
220a90c5 24$temp->add(new admin_setting_configpasswordunmask('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), ''));
3a6c690a 25$temp->add(new admin_setting_configtext('smtpmaxbulk', get_string('smtpmaxbulk', 'admin'), get_string('configsmtpmaxbulk', 'admin'), 1, PARAM_INT));
aa282b10 26$temp->add(new admin_setting_configtext('noreplyaddress', get_string('noreplyaddress', 'admin'), get_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_NOTAGS));
eef868d1 27$temp->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'admin'), get_string('configdigestmailtime', 'admin'), 17, array('00' => '00',
28 '01' => '01',
29 '02' => '02',
30 '03' => '03',
31 '04' => '04',
32 '05' => '05',
33 '06' => '06',
34 '07' => '07',
35 '08' => '08',
36 '09' => '09',
37 '10' => '10',
38 '11' => '11',
39 '12' => '12',
40 '13' => '13',
41 '14' => '14',
42 '15' => '15',
43 '16' => '16',
44 '17' => '17',
45 '18' => '18',
46 '19' => '19',
47 '20' => '20',
48 '21' => '21',
49 '22' => '22',
61240489 50 '23' => '23')));
810944af 51$charsets = get_list_of_charsets();
53146827 52unset($charsets['UTF-8']); // not needed here
810944af 53$options = array();
00ed8abd 54$options['0'] = 'UTF-8';
810944af 55$options = array_merge($options, $charsets);
220a90c5 56$temp->add(new admin_setting_configselect('sitemailcharset', get_string('sitemailcharset', 'admin'), get_string('configsitemailcharset','admin'), '0', $options));
810944af 57$temp->add(new admin_setting_configcheckbox('allowusermailcharset', get_string('allowusermailcharset', 'admin'), get_string('configallowusermailcharset', 'admin'), 0));
6265d463 58$options = array('LF'=>'LF', 'CRLF'=>'CRLF');
59$temp->add(new admin_setting_configselect('mailnewline', get_string('mailnewline', 'admin'), get_string('configmailnewline','admin'), 'LF', $options));
8e5da17a 60if (isloggedin()) {
61 global $USER;
72ce416c 62 $primaryadminemail = $USER->email;
8e5da17a 63 $primaryadminname = fullname($USER, true);
220a90c5 64
8e5da17a 65} else {
66 // no defaults during installation - admin user must be created first
67 $primaryadminemail = NULL;
68 $primaryadminname = NULL;
72ce416c 69}
70$temp->add(new admin_setting_configtext('supportname', get_string('supportname', 'admin'), get_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
71$temp->add(new admin_setting_configtext('supportemail', get_string('supportemail', 'admin'), get_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
3917c07e 72$temp->add(new admin_setting_configtext('supportpage', get_string('supportpage', 'admin'), get_string('configsupportpage', 'admin'), '', PARAM_URL));
1caea91e 73$ADMIN->add('server', $temp);
1ea1bcb3 74
75
90b4d599
AD
76// Jabber settingpage
77$temp = new admin_settingpage('jabber', get_string('jabber', 'admin'));
78$temp->add(new admin_setting_configtext('jabberhost', get_string('jabberhost', 'admin'), get_string('configjabberhost', 'admin'), '', PARAM_RAW));
79$temp->add(new admin_setting_configtext('jabberserver', get_string('jabberserver', 'admin'), get_string('configjabberserver', 'admin'), '', PARAM_RAW));
80$temp->add(new admin_setting_configtext('jabberusername', get_string('jabberusername', 'admin'), get_string('configjabberusername', 'admin'), '', PARAM_RAW));
81$temp->add(new admin_setting_configpasswordunmask('jabberpassword', get_string('jabberpassword', 'admin'), get_string('configjabberpassword', 'admin'), ''));
82$temp->add(new admin_setting_configtext('jabberport', get_string('jabberport', 'admin'), get_string('configjabberport', 'admin'), 5222, PARAM_INT));
83$ADMIN->add('server', $temp);
84
85
1ea1bcb3 86
87// "sessionhandling" settingpage
88$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
35d6a2a4 89$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 1));
1ea1bcb3 90$temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),
91 10800 => get_string('numhours', '', 3),
92 7200 => get_string('numhours', '', 2),
93 5400 => get_string('numhours', '', '1.5'),
94 3600 => get_string('numminutes', '', 60),
95 2700 => get_string('numminutes', '', 45),
96 1800 => get_string('numminutes', '', 30),
97 900 => get_string('numminutes', '', 15),
98 300 => get_string('numminutes', '', 5))));
99$temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
100$temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '/', PARAM_LOCALURL));
e6e13284 101$temp->add(new admin_setting_configtext('sessioncookiedomain', get_string('sessioncookiedomain', 'admin'), get_string('configsessioncookiedomain', 'admin'), '', PARAM_TEXT, 50));
1caea91e 102$ADMIN->add('server', $temp);
1ea1bcb3 103
104
1ea1bcb3 105// "stats" settingpage
90658eef 106$temp = new admin_settingpage('stats', get_string('stats'), 'moodle/site:config', empty($CFG->enablestats));
1ea1bcb3 107$temp->add(new admin_setting_configselect('statsfirstrun', get_string('statsfirstrun', 'admin'), get_string('configstatsfirstrun', 'admin'), 'none', array('none' => get_string('none'),
108 60*60*24*7 => get_string('numweeks','moodle',1),
61240489 109 60*60*24*14 => get_string('numweeks','moodle',2),
110 60*60*24*21 => get_string('numweeks','moodle',3),
111 60*60*24*28 => get_string('nummonths','moodle',1),
112 60*60*24*56 => get_string('nummonths','moodle',2),
113 60*60*24*84 => get_string('nummonths','moodle',3),
114 60*60*24*112 => get_string('nummonths','moodle',4),
115 60*60*24*140 => get_string('nummonths','moodle',5),
116 60*60*24*168 => get_string('nummonths','moodle',6),
117 'all' => get_string('all') )));
5e7206a8 118$temp->add(new admin_setting_configselect('statsmaxruntime', get_string('statsmaxruntime', 'admin'), get_string('configstatsmaxruntime3', 'admin'), 0, array(0 => get_string('untilcomplete'),
61460dd6 119 60*30 => '10 '.get_string('minutes'),
120 60*30 => '30 '.get_string('minutes'),
1ea1bcb3 121 60*60 => '1 '.get_string('hour'),
61240489 122 60*60*2 => '2 '.get_string('hours'),
123 60*60*3 => '3 '.get_string('hours'),
124 60*60*4 => '4 '.get_string('hours'),
125 60*60*5 => '5 '.get_string('hours'),
126 60*60*6 => '6 '.get_string('hours'),
127 60*60*7 => '7 '.get_string('hours'),
128 60*60*8 => '8 '.get_string('hours') )));
5e7206a8 129$temp->add(new admin_setting_configtext('statsruntimedays', get_string('statsruntimedays', 'admin'), get_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
1ea1bcb3 130$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', get_string('statsruntimestart', 'admin'), get_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
131$temp->add(new admin_setting_configtext('statsuserthreshold', get_string('statsuserthreshold', 'admin'), get_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
eef868d1 132$ADMIN->add('server', $temp);
1ea1bcb3 133
134
135// "http" settingpage
136$temp = new admin_settingpage('http', get_string('http', 'admin'));
137$temp->add(new admin_setting_configtext('framename', get_string('framename', 'admin'), get_string('configframename', 'admin'), '_top', PARAM_ALPHAEXT));
afd7b382 138$temp->add(new admin_setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
62ea712f 139$temp->add(new admin_setting_heading('reverseproxy', get_string('reverseproxy', 'admin'), '', ''));
3a4f0a34 140$options = array(
141 0 => 'HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
142 GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
143 GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR => 'HTTP_CLIENT, REMOTE_ADDR',
144 GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'REMOTE_ADDR');
62ea712f 145$temp->add(new admin_setting_configselect('getremoteaddrconf', get_string('getremoteaddrconf', 'admin'), get_string('configgetremoteaddrconf', 'admin'), 0, $options));
5f8bdc17 146$temp->add(new admin_setting_heading('webproxy', get_string('webproxy', 'admin'), get_string('webproxyinfo', 'admin')));
1ea1bcb3 147$temp->add(new admin_setting_configtext('proxyhost', get_string('proxyhost', 'admin'), get_string('configproxyhost', 'admin'), '', PARAM_HOST));
421f60f9 148$temp->add(new admin_setting_configtext('proxyport', get_string('proxyport', 'admin'), get_string('configproxyport', 'admin'), 0, PARAM_INT));
5f8bdc17 149$options = array('HTTP'=>'HTTP');
150if (defined('CURLPROXY_SOCKS5')) {
151 $options['SOCKS5'] = 'SOCKS5';
152}
153$temp->add(new admin_setting_configselect('proxytype', get_string('proxytype', 'admin'), get_string('configproxytype','admin'), 'HTTP', $options));
154$temp->add(new admin_setting_configtext('proxyuser', get_string('proxyuser', 'admin'), get_string('configproxyuser', 'admin'), ''));
eb7f78af 155$temp->add(new admin_setting_configpasswordunmask('proxypassword', get_string('proxypassword', 'admin'), get_string('configproxypassword', 'admin'), ''));
9bc760f2 156$temp->add(new admin_setting_configtext('proxybypass', get_string('proxybypass', 'admin'), get_string('configproxybypass', 'admin'), 'localhost, 127.0.0.1'));
eef868d1 157$ADMIN->add('server', $temp);
1ea1bcb3 158
4fe2250a 159$temp = new admin_settingpage('maintenancemode', get_string('sitemaintenancemode', 'admin'));
160$options = array(0=>get_string('disable'), 1=>get_string('enable'));
161$temp->add(new admin_setting_configselect('maintenance_enabled', get_string('sitemaintenancemode', 'admin'),
162 get_string('helpsitemaintenance', 'admin'), 0, $options));
163$temp->add(new admin_setting_confightmleditor('maintenance_message', get_string('optionalmaintenancemessage', 'admin'),
164 '', ''));
165$ADMIN->add('server', $temp);
1ea1bcb3 166
1ea1bcb3 167$temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin'));
1ea1bcb3 168$temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'),
169 168 => get_string('numdays', '', 7),
170 144 => get_string('numdays', '', 6),
171 120 => get_string('numdays', '', 5),
172 96 => get_string('numdays', '', 4),
173 72 => get_string('numdays', '', 3),
174 48 => get_string('numdays', '', 2),
175 24 => get_string('numdays', '', 1),
176 12 => get_string('numhours', '', 12),
177 6 => get_string('numhours', '', 6),
178 1 => get_string('numhours', '', 1))));
179
a4a57da9 180$temp->add(new admin_setting_configselect('deleteincompleteusers', get_string('deleteincompleteusers', 'admin'), get_string('configdeleteincompleteusers', 'admin'), 0, array(0 => get_string('never'),
181 168 => get_string('numdays', '', 7),
182 144 => get_string('numdays', '', 6),
183 120 => get_string('numdays', '', 5),
184 96 => get_string('numdays', '', 4),
185 72 => get_string('numdays', '', 3),
186 48 => get_string('numdays', '', 2),
187 24 => get_string('numdays', '', 1))));
188
f11f7b41
PS
189$temp->add(new admin_setting_configcheckbox('logguests', get_string('logguests', 'admin'),
190 get_string('logguests_help', 'admin'), 1));
1ea1bcb3 191$temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
192 1000 => get_string('numdays', '', 1000),
193 365 => get_string('numdays', '', 365),
194 180 => get_string('numdays', '', 180),
195 150 => get_string('numdays', '', 150),
196 120 => get_string('numdays', '', 120),
197 90 => get_string('numdays', '', 90),
198 60 => get_string('numdays', '', 60),
cea67da0 199 35 => get_string('numdays', '', 35),
200 10 => get_string('numdays', '', 10),
201 5 => get_string('numdays', '', 5),
202 2 => get_string('numdays', '', 2))));
1ea1bcb3 203
1ee0df06 204
205$temp->add(new admin_setting_configcheckbox('disablegradehistory', get_string('disablegradehistory', 'grades'),
f11f7b41 206 get_string('disablegradehistory_help', 'grades'), 0));
1ee0df06 207
208$temp->add(new admin_setting_configselect('gradehistorylifetime', get_string('gradehistorylifetime', 'grades'),
5cf5cc9b 209 get_string('gradehistorylifetime_help', 'grades'), 0, array(0 => get_string('neverdeletehistory', 'grades'),
1ee0df06 210 1000 => get_string('numdays', '', 1000),
211 365 => get_string('numdays', '', 365),
212 180 => get_string('numdays', '', 180),
213 150 => get_string('numdays', '', 150),
214 120 => get_string('numdays', '', 120),
215 90 => get_string('numdays', '', 90),
216 60 => get_string('numdays', '', 60),
217 30 => get_string('numdays', '', 30))));
218
1ea1bcb3 219$ADMIN->add('server', $temp);
220
221
222
223$ADMIN->add('server', new admin_externalpage('environment', get_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
224$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
225
226
4a575a65 227// "performance" settingpage
228$temp = new admin_settingpage('performance', get_string('performance', 'admin'));
7022dd39 229
c6e1d6af 230$temp->add(new admin_setting_configselect('extramemorylimit', get_string('extramemorylimit', 'admin'),
1c980a57 231 get_string('configextramemorylimit', 'admin'), '512M',
c3935adb 232 // if this option is set to 0, default 128M will be used
7022dd39 233 array( '64M' => '64M',
408278ba 234 '128M' => '128M',
7022dd39 235 '256M' => '256M',
44403309 236 '512M' => '512M',
7022dd39 237 '1024M' => '1024M'
238 )));
1c980a57
PS
239$temp->add(new admin_setting_configtext('curlcache', get_string('curlcache', 'admin'),
240 get_string('configcurlcache', 'admin'), 120, PARAM_INT));
241
242/* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it
134d8a58 243$temp->add(new admin_setting_special_selectsetup('cachetype', get_string('cachetype', 'admin'),
244 get_string('configcachetype', 'admin'), '',
245 array( '' => get_string('none'),
246 'internal' => 'internal',
247 'memcached' => 'memcached',
248 'eaccelerator' => 'eaccelerator')));
bb931a61 249// NOTE: $CFG->rcache is forced to bool in lib/setup.php
392e7363 250$temp->add(new admin_setting_special_selectsetup('rcache', get_string('rcache', 'admin'),
220a90c5 251 get_string('configrcache', 'admin'), 0,
252 array( '0' => get_string('no'),
1bc8aab1 253 '1' => get_string('yes'))));
bb931a61 254$temp->add(new admin_setting_configtext('rcachettl', get_string('rcachettl', 'admin'),
255 get_string('configrcachettl', 'admin'), 10));
256$temp->add(new admin_setting_configtext('intcachemax', get_string('intcachemax', 'admin'),
257 get_string('configintcachemax', 'admin'), 10));
134d8a58 258$temp->add(new admin_setting_configtext('memcachedhosts', get_string('memcachedhosts', 'admin'),
259 get_string('configmemcachedhosts', 'admin'), ''));
260$temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcachedpconn', 'admin'),
261 get_string('configmemcachedpconn', 'admin'), 0,
262 array( '0' => get_string('no'),
263 '1' => get_string('yes'))));
1c980a57 264*/
4a575a65 265$ADMIN->add('server', $temp);
266
1c980a57
PS
267
268$ADMIN->add('server', new admin_externalpage('adminregistration', get_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/registration/index.php"));
269
a559f630 270} // end of speedup