major whitespace cleanup - fixed \r line-ending
[moodle.git] / admin / settings / server.php
CommitLineData
1ea1bcb3 1<?php // $Id$
2
3// This file defines settingpages and externalpages under the "server" category
4
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_PATH));
11$temp->add(new admin_setting_configtext('unzip', get_string('pathtounzip','admin'), get_string('configunzip', 'admin'), '', PARAM_PATH));
12$temp->add(new admin_setting_configtext('pathtodu', get_string('pathtodu', 'admin'), get_string('configpathtodu', 'admin'), '', PARAM_PATH));
13$temp->add(new admin_setting_configtext('aspellpath', get_string('aspellpath', 'admin'), get_string('edhelpaspellpath'), '', PARAM_PATH));
14$ADMIN->add('server', $temp, 0);
15
16
17
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_configtext('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')));
50if (!empty($CFG->unicodedb)) { // These options are only available if running under unicodedb
51 unset($options);
52 unset($charsets);
53 $charsets = get_list_of_charsets();
54 $options['0'] = get_string('none');
55 $options = array_merge($options, $charsets);
56 $temp->add(new admin_setting_configselect('sitemailcharset', get_string('sitemailcharset', 'admin'), get_string('configsitemailcharset','admin'), '', $options));
57 $temp->add(new admin_setting_configcheckbox('allowusermailcharset', get_string('allowusermailcharset', 'admin'), get_string('configallowusermailcharset', 'admin'), 0));
58}
59$ADMIN->add('server', $temp, 100);
60
61
62
63// "sessionhandling" settingpage
64$temp = new admin_settingpage('sessionhandling', get_string('sessionhandling', 'admin'));
65$temp->add(new admin_setting_configcheckbox('dbsessions', get_string('dbsessions', 'admin'), get_string('configdbsessions', 'admin'), 0));
66$temp->add(new admin_setting_configselect('sessiontimeout', get_string('sessiontimeout', 'admin'), get_string('configsessiontimeout', 'admin'), 7200, array(14400 => get_string('numhours', '', 4),
67 10800 => get_string('numhours', '', 3),
68 7200 => get_string('numhours', '', 2),
69 5400 => get_string('numhours', '', '1.5'),
70 3600 => get_string('numminutes', '', 60),
71 2700 => get_string('numminutes', '', 45),
72 1800 => get_string('numminutes', '', 30),
73 900 => get_string('numminutes', '', 15),
74 300 => get_string('numminutes', '', 5))));
75$temp->add(new admin_setting_configtext('sessioncookie', get_string('sessioncookie', 'admin'), get_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
76$temp->add(new admin_setting_configtext('sessioncookiepath', get_string('sessioncookiepath', 'admin'), get_string('configsessioncookiepath', 'admin'), '/', PARAM_LOCALURL));
77$ADMIN->add('server', $temp, 50);
78
79
80
81// "rss" settingpage
82$temp = new admin_settingpage('rss', get_string('rss'));
83$temp->add(new admin_setting_configcheckbox('enablerssfeeds', get_string('enablerssfeeds', 'admin'), get_string('configenablerssfeeds', 'admin'), 0));
84$ADMIN->add('server', $temp);
85
86
87// "debugging" settingpage
88$temp = new admin_settingpage('debugging', get_string('debugging', 'admin'));
89$temp->add(new admin_setting_special_debug());
90$temp->add(new admin_setting_special_perfdebug());
91$ADMIN->add('server', $temp);
92
93
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);
120
121
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'), '', PARAM_INT));
128$ADMIN->add('server', $temp);
129
130$ADMIN->add('server', new admin_externalpage('sitefiles', get_string('sitefiles'), $CFG->wwwroot . '/files/index.php?id=' . SITEID));
131
132$ADMIN->add('server', new admin_externalpage('maintenancemode', get_string('sitemaintenancemode', 'admin'), "$CFG->wwwroot/$CFG->admin/maintenance.php"));
133
134
135$temp = new admin_settingpage('cleanup', get_string('cleanup', 'admin'));
136$temp->add(new admin_setting_configselect('longtimenosee', get_string('longtimenosee', 'admin'), get_string('configlongtimenosee', 'admin'), 120, array(0 => get_string('never'),
137 1000 => get_string('numdays', '', 1000),
138 365 => get_string('numdays', '', 365),
139 180 => get_string('numdays', '', 180),
140 150 => get_string('numdays', '', 150),
141 120 => get_string('numdays', '', 120),
142 90 => get_string('numdays', '', 90),
143 60 => get_string('numdays', '', 60),
144 30 => get_string('numdays', '', 30),
145 21 => get_string('numdays', '', 21),
146 14 => get_string('numdays', '', 14),
147 7 => get_string('numdays', '', 7) )));
148$temp->add(new admin_setting_configselect('deleteunconfirmed', get_string('deleteunconfirmed', 'admin'), get_string('configdeleteunconfirmed', 'admin'), 168, array(0 => get_string('never'),
149 168 => get_string('numdays', '', 7),
150 144 => get_string('numdays', '', 6),
151 120 => get_string('numdays', '', 5),
152 96 => get_string('numdays', '', 4),
153 72 => get_string('numdays', '', 3),
154 48 => get_string('numdays', '', 2),
155 24 => get_string('numdays', '', 1),
156 12 => get_string('numhours', '', 12),
157 6 => get_string('numhours', '', 6),
158 1 => get_string('numhours', '', 1))));
159
160$temp->add(new admin_setting_configselect('loglifetime', get_string('loglifetime', 'admin'), get_string('configloglifetime', 'admin'), 0, array(0 => get_string('neverdeletelogs'),
161 1000 => get_string('numdays', '', 1000),
162 365 => get_string('numdays', '', 365),
163 180 => get_string('numdays', '', 180),
164 150 => get_string('numdays', '', 150),
165 120 => get_string('numdays', '', 120),
166 90 => get_string('numdays', '', 90),
167 60 => get_string('numdays', '', 60),
168 30 => get_string('numdays', '', 30))));
169
170$ADMIN->add('server', $temp);
171
172
173
174$ADMIN->add('server', new admin_externalpage('environment', get_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
175$ADMIN->add('server', new admin_externalpage('phpinfo', get_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
176
177
178if (file_exists("$CFG->dirroot/$CFG->admin/mysql/frame.php")) {
179 $ADMIN->add('server', new admin_externalpage('database', get_string('managedatabase'), "$CFG->wwwroot/$CFG->admin/mysql/frame.php"));
180}
181
182?>