keeping version number in sync
[moodle.git] / admin / settings / server.php
CommitLineData
1ea1bcb3 1<?php // $Id$
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'))));
665958c2 13$temp->add(new admin_setting_configtext('zip', get_string('pathtozip','admin'), get_string('configzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
14$temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
15$temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_RAW)); // TODO: add path validation
16$temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_RAW)); // TODO: add path validation
1ea1bcb3 17$ADMIN->add('server', $temp, 0);
18
19
20
21// "email" settingpage
22$temp = new admin_settingpage('mail', get_string('mail','admin'));
23$temp->add(new admin_setting_configtext('smtphosts', get_string('smtphosts', 'admin'), get_string('configsmtphosts', 'admin'), '', PARAM_HOST));
24$temp->add(new admin_setting_configtext('smtpuser', get_string('smtpuser', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_NOTAGS));
54bb33eb 25$temp->add(new admin_setting_configpasswordunmask('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_RAW));
1ea1bcb3 26$temp->add(new admin_setting_configtext('noreplyaddress', get_string('noreplyaddress', 'admin'), get_string('confignoreplyaddress', 'admin'), 'noreply@' . $_SERVER['HTTP_HOST'], PARAM_NOTAGS));
27$temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
28$temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
eef868d1 29$temp->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'admin'), get_string('configdigestmailtime', 'admin'), 17, array('00' => '00',
30 '01' => '01',
31 '02' => '02',
32 '03' => '03',
33 '04' => '04',
34 '05' => '05',
35 '06' => '06',
36 '07' => '07',
37 '08' => '08',
38 '09' => '09',
39 '10' => '10',
40 '11' => '11',
41 '12' => '12',
42 '13' => '13',
43 '14' => '14',
44 '15' => '15',
45 '16' => '16',
46 '17' => '17',
47 '18' => '18',
48 '19' => '19',
49 '20' => '20',
50 '21' => '21',
51 '22' => '22',
61240489 52 '23' => '23')));
810944af 53$charsets = get_list_of_charsets();
53146827 54unset($charsets['UTF-8']); // not needed here
810944af 55$options = array();
56$options['0'] = get_string('none');
57$options = array_merge($options, $charsets);
58$temp->add(new admin_setting_configselect('sitemailcharset', get_string('sitemailcharset', 'admin'), get_string('configsitemailcharset','admin'), '', $options));
59$temp->add(new admin_setting_configcheckbox('allowusermailcharset', get_string('allowusermailcharset', 'admin'), get_string('configallowusermailcharset', 'admin'), 0));
8e5da17a 60if (isloggedin()) {
61 global $USER;
72ce416c 62 $primaryadminemail = $USER->email;
8e5da17a 63 $primaryadminname = fullname($USER, true);
64
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));
1ea1bcb3 73$ADMIN->add('server', $temp, 100);
74
75
76
77// "sessionhandling" settingpage
78$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
79$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 0));
80$temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),
81 10800 => get_string('numhours', '', 3),
82 7200 => get_string('numhours', '', 2),
83 5400 => get_string('numhours', '', '1.5'),
84 3600 => get_string('numminutes', '', 60),
85 2700 => get_string('numminutes', '', 45),
86 1800 => get_string('numminutes', '', 30),
87 900 => get_string('numminutes', '', 15),
88 300 => get_string('numminutes', '', 5))));
89$temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
90$temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '/', PARAM_LOCALURL));
91$ADMIN->add('server', $temp, 50);
92
93
94
95// "rss" settingpage
96$temp = new admin_settingpage('rss', get_string('rss'));
97$temp->add(new admin_setting_configcheckbox('enablerssfeeds', get_string('enablerssfeeds', 'admin'), get_string('configenablerssfeeds', 'admin'), 0));
98$ADMIN->add('server', $temp);
99
100
101// "debugging" settingpage
102$temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
103$temp->add(new admin_setting_special_debug());
47b8b9eb 104$temp->add(new admin_setting_special_debugdisplay());
29c5c63e 105$temp->add(new admin_setting_configcheckbox('xmlstrictheaders', get_string('xmlstrictheaders', 'admin'), get_string('configxmlstrictheaders', 'admin'), 0));
854f5ef0 106$temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
1ea1bcb3 107$temp->add(new admin_setting_special_perfdebug());
eef868d1 108$ADMIN->add('server', $temp);
1ea1bcb3 109
110
111// "stats" settingpage
112$temp = new admin_settingpage('stats', get_string('stats'));
113$temp->add(new admin_setting_configcheckbox('enablestats', get_string('enablestats', 'admin'), get_string('configenablestats', 'admin'), 0));
114$temp->add(new admin_setting_configselect('statsfirstrun', get_string('statsfirstrun', 'admin'), get_string('configstatsfirstrun', 'admin'), 'none', array('none' => get_string('none'),
115 60*60*24*7 => get_string('numweeks','moodle',1),
61240489 116 60*60*24*14 => get_string('numweeks','moodle',2),
117 60*60*24*21 => get_string('numweeks','moodle',3),
118 60*60*24*28 => get_string('nummonths','moodle',1),
119 60*60*24*56 => get_string('nummonths','moodle',2),
120 60*60*24*84 => get_string('nummonths','moodle',3),
121 60*60*24*112 => get_string('nummonths','moodle',4),
122 60*60*24*140 => get_string('nummonths','moodle',5),
123 60*60*24*168 => get_string('nummonths','moodle',6),
124 'all' => get_string('all') )));
1ea1bcb3 125$temp->add(new admin_setting_configselect('statsmaxruntime', get_string('statsmaxruntime', 'admin'), get_string('configstatsmaxruntime', 'admin'), 0, array(0 => get_string('untilcomplete'),
126 60*60 => '1 '.get_string('hour'),
61240489 127 60*60*2 => '2 '.get_string('hours'),
128 60*60*3 => '3 '.get_string('hours'),
129 60*60*4 => '4 '.get_string('hours'),
130 60*60*5 => '5 '.get_string('hours'),
131 60*60*6 => '6 '.get_string('hours'),
132 60*60*7 => '7 '.get_string('hours'),
133 60*60*8 => '8 '.get_string('hours') )));
1ea1bcb3 134$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', get_string('statsruntimestart', 'admin'), get_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
135$temp->add(new admin_setting_configtext('statsuserthreshold', get_string('statsuserthreshold', 'admin'), get_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
eef868d1 136$ADMIN->add('server', $temp);
1ea1bcb3 137
138
139// "http" settingpage
140$temp = new admin_settingpage('http', get_string('http', 'admin'));
141$temp->add(new admin_setting_configtext('framename', get_string('framename', 'admin'), get_string('configframename', 'admin'), '_top', PARAM_ALPHAEXT));
142$temp->add(new admin_Setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
143$temp->add(new admin_setting_configtext('proxyhost', get_string('proxyhost', 'admin'), get_string('configproxyhost', 'admin'), '', PARAM_HOST));
421f60f9 144$temp->add(new admin_setting_configtext('proxyport', get_string('proxyport', 'admin'), get_string('configproxyport', 'admin'), 0, PARAM_INT));
eef868d1 145$ADMIN->add('server', $temp);
1ea1bcb3 146
1ea1bcb3 147$ADMIN->add('server', new admin_externalpage('maintenancemode', get_string('sitemaintenancemode', 'admin'), "$CFG->wwwroot/$CFG->admin/maintenance.php"));
148
149
150$temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin'));
151$temp->add(new admin_setting_configselect('longtimenosee', get_string('longtimenosee', 'admin'), get_string('configlongtimenosee', 'admin'), 120, array(0 => get_string('never'),
152 1000 => get_string('numdays', '', 1000),
61240489 153 365 => get_string('numdays', '', 365),
154 180 => get_string('numdays', '', 180),
155 150 => get_string('numdays', '', 150),
156 120 => get_string('numdays', '', 120),
157 90 => get_string('numdays', '', 90),
158 60 => get_string('numdays', '', 60),
159 30 => get_string('numdays', '', 30),
160 21 => get_string('numdays', '', 21),
161 14 => get_string('numdays', '', 14),
162 7 => get_string('numdays', '', 7) )));
1ea1bcb3 163$temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'),
164 168 => get_string('numdays', '', 7),
165 144 => get_string('numdays', '', 6),
166 120 => get_string('numdays', '', 5),
167 96 => get_string('numdays', '', 4),
168 72 => get_string('numdays', '', 3),
169 48 => get_string('numdays', '', 2),
170 24 => get_string('numdays', '', 1),
171 12 => get_string('numhours', '', 12),
172 6 => get_string('numhours', '', 6),
173 1 => get_string('numhours', '', 1))));
174
175$temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
176 1000 => get_string('numdays', '', 1000),
177 365 => get_string('numdays', '', 365),
178 180 => get_string('numdays', '', 180),
179 150 => get_string('numdays', '', 150),
180 120 => get_string('numdays', '', 120),
181 90 => get_string('numdays', '', 90),
182 60 => get_string('numdays', '', 60),
183 30 => get_string('numdays', '', 30))));
184
185$ADMIN->add('server', $temp);
186
187
188
189$ADMIN->add('server', new admin_externalpage('environment', get_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
190$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
191
192
4a575a65 193// "performance" settingpage
194$temp = new admin_settingpage('performance', get_string('performance', 'admin'));
bb931a61 195$temp->add(new admin_setting_configselect('cachetype', get_string('cachetype', 'admin'),
1bc8aab1 196 get_string('configcachetype', 'admin'), '',
197 array( '' => get_string('none'),
bb931a61 198 'internal' => 'internal',
199 'memcached' => 'memcached',
200 'eaccelerator' => 'eaccelerator')));
201// NOTE: $CFG->rcache is forced to bool in lib/setup.php
202$temp->add(new admin_setting_configselect('rcache', get_string('rcache', 'admin'),
1bc8aab1 203 get_string('configrcache', 'admin'), 0,
204 array( '0' => get_string('no'),
205 '1' => get_string('yes'))));
bb931a61 206$temp->add(new admin_setting_configtext('rcachettl', get_string('rcachettl', 'admin'),
207 get_string('configrcachettl', 'admin'), 10));
208$temp->add(new admin_setting_configtext('intcachemax', get_string('intcachemax', 'admin'),
209 get_string('configintcachemax', 'admin'), 10));
210$temp->add(new admin_setting_configtext('memcachedhosts', get_string('memcachedhosts', 'admin'),
211 get_string('configmemcachedhosts', 'admin'), ''));
212$temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcachedpconn', 'admin'),
1bc8aab1 213 get_string('configmemcachedpconn', 'admin'), 0,
214 array( '0' => get_string('no'),
215 '1' => get_string('yes'))));
4a575a65 216$ADMIN->add('server', $temp);
217
1ea1bcb3 218if (file_exists("$CFG->dirroot/$CFG->admin/mysql/frame.php")) {
219 $ADMIN->add('server', new admin_externalpage('database', get_string('managedatabase'), "$CFG->wwwroot/$CFG->admin/mysql/frame.php"));
220}
221
a559f630 222} // end of speedup
223
1ea1bcb3 224?>