Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / admin / settings / server.php
blob90b4ae7239af3aa4ff5b35e9b14a620dc5c25819
1 <?php // $Id$
3 // This file defines settingpages and externalpages under the "server" category
5 // "systempaths" settingpage
6 $temp = new admin_settingpage('systempaths', get_string('systempaths','admin'));
7 $temp->add(new admin_setting_configselect('gdversion', get_string('gdversion','admin'), get_string('configgdversion', 'admin'), check_gd_version(), array('0' => get_string('gdnot'),
8 '1' => get_string('gd1'),
9 '2' => get_string('gd2'))));
10 $temp->add(new admin_setting_configtext('zip', get_string('pathtozip','admin'), get_string('configzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
11 $temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_RAW)); // TODO: add path validation
12 $temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_RAW)); // TODO: add path validation
13 $temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_RAW)); // TODO: add path validation
14 $ADMIN->add('server', $temp, 0);
18 // "email" settingpage
19 $temp = new admin_settingpage('mail', get_string('mail','admin'));
20 $temp->add(new admin_setting_configtext('smtphosts', get_string('smtphosts', 'admin'), get_string('configsmtphosts', 'admin'), '', PARAM_HOST));
21 $temp->add(new admin_setting_configtext('smtpuser', get_string('smtpuser', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_NOTAGS));
22 $temp->add(new admin_setting_configpasswordunmask('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_RAW));
23 $temp->add(new admin_setting_configtext('noreplyaddress', get_string('noreplyaddress', 'admin'), get_string('confignoreplyaddress', 'admin'), 'noreply@' . $_SERVER['HTTP_HOST'], PARAM_NOTAGS));
24 $temp->add(new admin_setting_configtext('allowemailaddresses', get_string('allowemailaddresses', 'admin'), get_string('configallowemailaddresses', 'admin'), '', PARAM_NOTAGS));
25 $temp->add(new admin_setting_configtext('denyemailaddresses', get_string('denyemailaddresses', 'admin'), get_string('configdenyemailaddresses', 'admin'), '', PARAM_NOTAGS));
26 $temp->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'admin'), get_string('configdigestmailtime', 'admin'), 17, array('00' => '00',
27 '01' => '01',
28 '02' => '02',
29 '03' => '03',
30 '04' => '04',
31 '05' => '05',
32 '06' => '06',
33 '07' => '07',
34 '08' => '08',
35 '09' => '09',
36 '10' => '10',
37 '11' => '11',
38 '12' => '12',
39 '13' => '13',
40 '14' => '14',
41 '15' => '15',
42 '16' => '16',
43 '17' => '17',
44 '18' => '18',
45 '19' => '19',
46 '20' => '20',
47 '21' => '21',
48 '22' => '22',
49 '23' => '23')));
50 $charsets = get_list_of_charsets();
51 unset($charsets['UTF-8']); // not needed here
52 $options = array();
53 $options['0'] = get_string('none');
54 $options = array_merge($options, $charsets);
55 $temp->add(new admin_setting_configselect('sitemailcharset', get_string('sitemailcharset', 'admin'), get_string('configsitemailcharset','admin'), '', $options));
56 $temp->add(new admin_setting_configcheckbox('allowusermailcharset', get_string('allowusermailcharset', 'admin'), get_string('configallowusermailcharset', 'admin'), 0));
57 $ADMIN->add('server', $temp, 100);
61 // "sessionhandling" settingpage
62 $temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
63 $temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 0));
64 $temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),
65 10800 => get_string('numhours', '', 3),
66 7200 => get_string('numhours', '', 2),
67 5400 => get_string('numhours', '', '1.5'),
68 3600 => get_string('numminutes', '', 60),
69 2700 => get_string('numminutes', '', 45),
70 1800 => get_string('numminutes', '', 30),
71 900 => get_string('numminutes', '', 15),
72 300 => get_string('numminutes', '', 5))));
73 $temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
74 $temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '/', PARAM_LOCALURL));
75 $ADMIN->add('server', $temp, 50);
79 // "rss" settingpage
80 $temp = new admin_settingpage('rss', get_string('rss'));
81 $temp->add(new admin_setting_configcheckbox('enablerssfeeds', get_string('enablerssfeeds', 'admin'), get_string('configenablerssfeeds', 'admin'), 0));
82 $ADMIN->add('server', $temp);
85 // "debugging" settingpage
86 $temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
87 $temp->add(new admin_setting_special_debug());
88 $temp->add(new admin_setting_special_debugdisplay());
89 $temp->add(new admin_setting_configcheckbox('debugsmtp', get_string('debugsmtp', 'admin'), get_string('configdebugsmtp', 'admin'), 0));
90 $temp->add(new admin_setting_special_perfdebug());
91 $ADMIN->add('server', $temp);
94 // "stats" settingpage
95 $temp = new admin_settingpage('stats', get_string('stats'));
96 $temp->add(new admin_setting_configcheckbox('enablestats', get_string('enablestats', 'admin'), get_string('configenablestats', 'admin'), 0));
97 $temp->add(new admin_setting_configselect('statsfirstrun', get_string('statsfirstrun', 'admin'), get_string('configstatsfirstrun', 'admin'), 'none', array('none' => get_string('none'),
98 60*60*24*7 => get_string('numweeks','moodle',1),
99 60*60*24*14 => get_string('numweeks','moodle',2),
100 60*60*24*21 => get_string('numweeks','moodle',3),
101 60*60*24*28 => get_string('nummonths','moodle',1),
102 60*60*24*56 => get_string('nummonths','moodle',2),
103 60*60*24*84 => get_string('nummonths','moodle',3),
104 60*60*24*112 => get_string('nummonths','moodle',4),
105 60*60*24*140 => get_string('nummonths','moodle',5),
106 60*60*24*168 => get_string('nummonths','moodle',6),
107 'all' => get_string('all') )));
108 $temp->add(new admin_setting_configselect('statsmaxruntime', get_string('statsmaxruntime', 'admin'), get_string('configstatsmaxruntime', 'admin'), 0, array(0 => get_string('untilcomplete'),
109 60*60 => '1 '.get_string('hour'),
110 60*60*2 => '2 '.get_string('hours'),
111 60*60*3 => '3 '.get_string('hours'),
112 60*60*4 => '4 '.get_string('hours'),
113 60*60*5 => '5 '.get_string('hours'),
114 60*60*6 => '6 '.get_string('hours'),
115 60*60*7 => '7 '.get_string('hours'),
116 60*60*8 => '8 '.get_string('hours') )));
117 $temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', get_string('statsruntimestart', 'admin'), get_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
118 $temp->add(new admin_setting_configtext('statsuserthreshold', get_string('statsuserthreshold', 'admin'), get_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
119 $ADMIN->add('server', $temp);
122 // "http" settingpage
123 $temp = new admin_settingpage('http', get_string('http', 'admin'));
124 $temp->add(new admin_setting_configtext('framename', get_string('framename', 'admin'), get_string('configframename', 'admin'), '_top', PARAM_ALPHAEXT));
125 $temp->add(new admin_Setting_configcheckbox('slasharguments', get_string('slasharguments', 'admin'), get_string('configslasharguments', 'admin'), 1));
126 $temp->add(new admin_setting_configtext('proxyhost', get_string('proxyhost', 'admin'), get_string('configproxyhost', 'admin'), '', PARAM_HOST));
127 $temp->add(new admin_setting_configtext('proxyport', get_string('proxyport', 'admin'), get_string('configproxyport', 'admin'), 0, PARAM_INT));
128 $ADMIN->add('server', $temp);
130 $ADMIN->add('server', new admin_externalpage('maintenancemode', get_string('sitemaintenancemode', 'admin'), "$CFG->wwwroot/$CFG->admin/maintenance.php"));
133 $temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin'));
134 $temp->add(new admin_setting_configselect('longtimenosee', get_string('longtimenosee', 'admin'), get_string('configlongtimenosee', 'admin'), 120, array(0 => get_string('never'),
135 1000 => get_string('numdays', '', 1000),
136 365 => get_string('numdays', '', 365),
137 180 => get_string('numdays', '', 180),
138 150 => get_string('numdays', '', 150),
139 120 => get_string('numdays', '', 120),
140 90 => get_string('numdays', '', 90),
141 60 => get_string('numdays', '', 60),
142 30 => get_string('numdays', '', 30),
143 21 => get_string('numdays', '', 21),
144 14 => get_string('numdays', '', 14),
145 7 => get_string('numdays', '', 7) )));
146 $temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'),
147 168 => get_string('numdays', '', 7),
148 144 => get_string('numdays', '', 6),
149 120 => get_string('numdays', '', 5),
150 96 => get_string('numdays', '', 4),
151 72 => get_string('numdays', '', 3),
152 48 => get_string('numdays', '', 2),
153 24 => get_string('numdays', '', 1),
154 12 => get_string('numhours', '', 12),
155 6 => get_string('numhours', '', 6),
156 1 => get_string('numhours', '', 1))));
158 $temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
159 1000 => get_string('numdays', '', 1000),
160 365 => get_string('numdays', '', 365),
161 180 => get_string('numdays', '', 180),
162 150 => get_string('numdays', '', 150),
163 120 => get_string('numdays', '', 120),
164 90 => get_string('numdays', '', 90),
165 60 => get_string('numdays', '', 60),
166 30 => get_string('numdays', '', 30))));
168 $ADMIN->add('server', $temp);
172 $ADMIN->add('server', new admin_externalpage('environment', get_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
173 $ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
176 // "performance" settingpage
177 $temp = new admin_settingpage('performance', get_string('performance', 'admin'));
178 $temp->add(new admin_setting_configselect('cachetype', get_string('cachetype', 'admin'),
179 get_string('configcachetype', 'admin'), false,
180 array( '' => 'none',
181 'internal' => 'internal',
182 'memcached' => 'memcached',
183 'eaccelerator' => 'eaccelerator')));
184 // NOTE: $CFG->rcache is forced to bool in lib/setup.php
185 $temp->add(new admin_setting_configselect('rcache', get_string('rcache', 'admin'),
186 get_string('configrcache', 'admin'), false,
187 array( '0' => 'false',
188 '1' => 'true')));
189 $temp->add(new admin_setting_configtext('rcachettl', get_string('rcachettl', 'admin'),
190 get_string('configrcachettl', 'admin'), 10));
191 $temp->add(new admin_setting_configtext('intcachemax', get_string('intcachemax', 'admin'),
192 get_string('configintcachemax', 'admin'), 10));
193 $temp->add(new admin_setting_configtext('memcachedhosts', get_string('memcachedhosts', 'admin'),
194 get_string('configmemcachedhosts', 'admin'), ''));
195 $temp->add(new admin_setting_configselect('memcachedpconn', get_string('memcachedpconn', 'admin'),
196 get_string('configmemcachedpconn', 'admin'), false,
197 array( '0' => 'false',
198 '1' => 'true')));
199 $ADMIN->add('server', $temp);
201 if (file_exists("$CFG->dirroot/$CFG->admin/mysql/frame.php")) {
202 $ADMIN->add('server', new admin_externalpage('database', get_string('managedatabase'), "$CFG->wwwroot/$CFG->admin/mysql/frame.php"));