2009-11-01 10:32:02 +00:00
|
|
|
<?php
|
2006-09-03 14:52:43 +00:00
|
|
|
|
|
|
|
// This file defines settingpages and externalpages under the "server" category
|
|
|
|
|
2007-10-28 22:35:00 +00:00
|
|
|
if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
|
|
|
|
|
|
|
|
2006-09-03 14:52:43 +00:00
|
|
|
// "systempaths" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('systempaths', new lang_string('systempaths','admin'));
|
|
|
|
$temp->add(new admin_setting_configselect('gdversion', new lang_string('gdversion','admin'), new lang_string('configgdversion', 'admin'), check_gd_version(), array('0' => new lang_string('gdnot'),
|
|
|
|
'1' => new lang_string('gd1'),
|
|
|
|
'2' => new lang_string('gd2'))));
|
|
|
|
$temp->add(new admin_setting_configexecutable('pathtodu', new lang_string('pathtodu', 'admin'), new lang_string('configpathtodu', 'admin'), ''));
|
|
|
|
$temp->add(new admin_setting_configexecutable('aspellpath', new lang_string('aspellpath', 'admin'), new lang_string('edhelpaspellpath'), ''));
|
|
|
|
$temp->add(new admin_setting_configexecutable('pathtodot', new lang_string('pathtodot', 'admin'), new lang_string('pathtodot_help', 'admin'), ''));
|
2009-01-11 09:41:48 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
2006-09-03 14:52:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
MDL-27171 messages: admin settings reordering
This includes:
* most email settings go from general admin setings to email plugin settings
* digestmailtime goes to mod/forum/settings.php
* supportname, supportemail and supportpage go to Support contact page
* all jabber settings go from general admin setings to jabber plugin settings
AMOS BEGIN
MOV [jabberhost,admin],[jabberhost,message_jabber]
MOV [configjabberhost,admin],[configjabberhost,message_jabber]
MOV [jabberserver,admin],[jabberserver,message_jabber]
MOV [configjabberserver,admin],[configjabberserver,message_jabber]
MOV [jabberusername,admin],[jabberusername,message_jabber]
MOV [configjabberusername,admin],[configjabberusername,message_jabber]
MOV [jabberpassword,admin],[jabberpassword,message_jabber]
MOV [configjabberpassword,admin],[configjabberpassword,message_jabber]
MOV [jabberport,admin],[jabberport,message_jabber]
MOV [configjabberport,admin],[configjabberport,message_jabber]
MOV [digestmailtime,admin],[digestmailtime,forum]
MOV [configdigestmailtime,admin],[configdigestmailtime,forum]
MOV [allowusermailcharset,admin],[allowusermailcharset,message_email]
MOV [configallowusermailcharset,admin],[configallowusermailcharset,message_email]
MOV [mailnewline,admin],[mailnewline,message_email]
MOV [configmailnewline,admin],[configmailnewline,message_email]
MOV [noreplyaddress,admin],[noreplyaddress,message_email]
MOV [confignoreplyaddress,admin],[confignoreplyaddress,message_email]
MOV [sitemailcharset,admin],[sitemailcharset,message_email]
MOV [configsitemailcharset,admin],[configsitemailcharset,message_email]
MOV [smtphosts,admin],[smtphosts,message_email]
MOV [configsmtphosts,admin],[configsmtphosts,message_email]
MOV [smtpmaxbulk,admin],[smtpmaxbulk,message_email]
MOV [configsmtpmaxbulk,admin],[configsmtpmaxbulk,message_email]
MOV [smtpuser,admin],[smtpuser,message_email]
MOV [configsmtpuser,admin],[configsmtpuser,message_email]
MOV [smtppass,admin],[smtppass,message_email]
AMOS END
Signed-off-by: Ruslan Kabalin <ruslan.kabalin@luns.net.uk>
2011-05-12 12:11:47 +01:00
|
|
|
// "supportcontact" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('supportcontact', new lang_string('supportcontact','admin'));
|
2007-10-02 21:38:53 +00:00
|
|
|
if (isloggedin()) {
|
|
|
|
global $USER;
|
2007-08-06 07:53:31 +00:00
|
|
|
$primaryadminemail = $USER->email;
|
2007-10-02 21:38:53 +00:00
|
|
|
$primaryadminname = fullname($USER, true);
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2007-10-02 21:38:53 +00:00
|
|
|
} else {
|
|
|
|
// no defaults during installation - admin user must be created first
|
|
|
|
$primaryadminemail = NULL;
|
|
|
|
$primaryadminname = NULL;
|
2007-08-06 07:53:31 +00:00
|
|
|
}
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'), new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
|
|
|
$temp->add(new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'), new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS));
|
|
|
|
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
|
2009-01-11 09:41:48 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
2006-09-03 14:52:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// "sessionhandling" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('sessionhandling', new lang_string('sessionhandling', 'admin'));
|
|
|
|
$temp->add(new admin_setting_configcheckbox('dbsessions', new lang_string('dbsessions', 'admin'), new lang_string('configdbsessions', 'admin'), 1));
|
|
|
|
$temp->add(new admin_setting_configselect('sessiontimeout', new lang_string('sessiontimeout', 'admin'), new lang_string('configsessiontimeout', 'admin'), 7200, array(14400 => new lang_string('numhours', '', 4),
|
|
|
|
10800 => new lang_string('numhours', '', 3),
|
|
|
|
7200 => new lang_string('numhours', '', 2),
|
|
|
|
5400 => new lang_string('numhours', '', '1.5'),
|
|
|
|
3600 => new lang_string('numminutes', '', 60),
|
|
|
|
2700 => new lang_string('numminutes', '', 45),
|
|
|
|
1800 => new lang_string('numminutes', '', 30),
|
|
|
|
900 => new lang_string('numminutes', '', 15),
|
|
|
|
300 => new lang_string('numminutes', '', 5))));
|
|
|
|
$temp->add(new admin_setting_configtext('sessioncookie', new lang_string('sessioncookie', 'admin'), new lang_string('configsessioncookie', 'admin'), '', PARAM_ALPHANUM));
|
|
|
|
$temp->add(new admin_setting_configtext('sessioncookiepath', new lang_string('sessioncookiepath', 'admin'), new lang_string('configsessioncookiepath', 'admin'), '', PARAM_RAW));
|
|
|
|
$temp->add(new admin_setting_configtext('sessioncookiedomain', new lang_string('sessioncookiedomain', 'admin'), new lang_string('configsessioncookiedomain', 'admin'), '', PARAM_RAW, 50));
|
2009-01-11 09:41:48 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
2006-09-03 14:52:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// "stats" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('stats', new lang_string('stats'), 'moodle/site:config', empty($CFG->enablestats));
|
|
|
|
$temp->add(new admin_setting_configselect('statsfirstrun', new lang_string('statsfirstrun', 'admin'), new lang_string('configstatsfirstrun', 'admin'), 'none', array('none' => new lang_string('none'),
|
|
|
|
60*60*24*7 => new lang_string('numweeks','moodle',1),
|
|
|
|
60*60*24*14 => new lang_string('numweeks','moodle',2),
|
|
|
|
60*60*24*21 => new lang_string('numweeks','moodle',3),
|
|
|
|
60*60*24*28 => new lang_string('nummonths','moodle',1),
|
|
|
|
60*60*24*56 => new lang_string('nummonths','moodle',2),
|
|
|
|
60*60*24*84 => new lang_string('nummonths','moodle',3),
|
|
|
|
60*60*24*112 => new lang_string('nummonths','moodle',4),
|
|
|
|
60*60*24*140 => new lang_string('nummonths','moodle',5),
|
|
|
|
60*60*24*168 => new lang_string('nummonths','moodle',6),
|
|
|
|
'all' => new lang_string('all') )));
|
|
|
|
$temp->add(new admin_setting_configselect('statsmaxruntime', new lang_string('statsmaxruntime', 'admin'), new lang_string('configstatsmaxruntime3', 'admin'), 0, array(0 => new lang_string('untilcomplete'),
|
|
|
|
60*30 => '10 '.new lang_string('minutes'),
|
|
|
|
60*30 => '30 '.new lang_string('minutes'),
|
|
|
|
60*60 => '1 '.new lang_string('hour'),
|
|
|
|
60*60*2 => '2 '.new lang_string('hours'),
|
|
|
|
60*60*3 => '3 '.new lang_string('hours'),
|
|
|
|
60*60*4 => '4 '.new lang_string('hours'),
|
|
|
|
60*60*5 => '5 '.new lang_string('hours'),
|
|
|
|
60*60*6 => '6 '.new lang_string('hours'),
|
|
|
|
60*60*7 => '7 '.new lang_string('hours'),
|
|
|
|
60*60*8 => '8 '.new lang_string('hours') )));
|
|
|
|
$temp->add(new admin_setting_configtext('statsruntimedays', new lang_string('statsruntimedays', 'admin'), new lang_string('configstatsruntimedays', 'admin'), 31, PARAM_INT));
|
|
|
|
$temp->add(new admin_setting_configtime('statsruntimestarthour', 'statsruntimestartminute', new lang_string('statsruntimestart', 'admin'), new lang_string('configstatsruntimestart', 'admin'), array('h' => 0, 'm' => 0)));
|
|
|
|
$temp->add(new admin_setting_configtext('statsuserthreshold', new lang_string('statsuserthreshold', 'admin'), new lang_string('configstatsuserthreshold', 'admin'), 0, PARAM_INT));
|
2006-09-20 21:00:45 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
2006-09-03 14:52:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// "http" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('http', new lang_string('http', 'admin'));
|
|
|
|
$temp->add(new admin_setting_configcheckbox('slasharguments', new lang_string('slasharguments', 'admin'), new lang_string('configslasharguments', 'admin'), 1));
|
|
|
|
$temp->add(new admin_setting_heading('reverseproxy', new lang_string('reverseproxy', 'admin'), '', ''));
|
2008-09-23 05:18:42 +00:00
|
|
|
$options = array(
|
|
|
|
0 => 'HTTP_CLIENT_IP, HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
|
|
|
|
GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'HTTP_X_FORWARDED_FOR, REMOTE_ADDR',
|
|
|
|
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR => 'HTTP_CLIENT, REMOTE_ADDR',
|
|
|
|
GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR|GETREMOTEADDR_SKIP_HTTP_CLIENT_IP => 'REMOTE_ADDR');
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configselect('getremoteaddrconf', new lang_string('getremoteaddrconf', 'admin'), new lang_string('configgetremoteaddrconf', 'admin'), 0, $options));
|
|
|
|
$temp->add(new admin_setting_heading('webproxy', new lang_string('webproxy', 'admin'), new lang_string('webproxyinfo', 'admin')));
|
|
|
|
$temp->add(new admin_setting_configtext('proxyhost', new lang_string('proxyhost', 'admin'), new lang_string('configproxyhost', 'admin'), '', PARAM_HOST));
|
|
|
|
$temp->add(new admin_setting_configtext('proxyport', new lang_string('proxyport', 'admin'), new lang_string('configproxyport', 'admin'), 0, PARAM_INT));
|
2007-12-30 19:42:51 +00:00
|
|
|
$options = array('HTTP'=>'HTTP');
|
|
|
|
if (defined('CURLPROXY_SOCKS5')) {
|
|
|
|
$options['SOCKS5'] = 'SOCKS5';
|
|
|
|
}
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configselect('proxytype', new lang_string('proxytype', 'admin'), new lang_string('configproxytype','admin'), 'HTTP', $options));
|
|
|
|
$temp->add(new admin_setting_configtext('proxyuser', new lang_string('proxyuser', 'admin'), new lang_string('configproxyuser', 'admin'), ''));
|
|
|
|
$temp->add(new admin_setting_configpasswordunmask('proxypassword', new lang_string('proxypassword', 'admin'), new lang_string('configproxypassword', 'admin'), ''));
|
|
|
|
$temp->add(new admin_setting_configtext('proxybypass', new lang_string('proxybypass', 'admin'), new lang_string('configproxybypass', 'admin'), 'localhost, 127.0.0.1'));
|
2006-09-20 21:00:45 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
2006-09-03 14:52:43 +00:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('maintenancemode', new lang_string('sitemaintenancemode', 'admin'));
|
|
|
|
$options = array(0=>new lang_string('disable'), 1=>new lang_string('enable'));
|
|
|
|
$temp->add(new admin_setting_configselect('maintenance_enabled', new lang_string('sitemaintenancemode', 'admin'),
|
|
|
|
new lang_string('helpsitemaintenance', 'admin'), 0, $options));
|
|
|
|
$temp->add(new admin_setting_confightmleditor('maintenance_message', new lang_string('optionalmaintenancemessage', 'admin'),
|
2009-05-31 14:42:29 +00:00
|
|
|
'', ''));
|
|
|
|
$ADMIN->add('server', $temp);
|
2006-09-03 14:52:43 +00:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('cleanup', new lang_string('cleanup', 'admin'));
|
|
|
|
$temp->add(new admin_setting_configselect('deleteunconfirmed', new lang_string('deleteunconfirmed', 'admin'), new lang_string('configdeleteunconfirmed', 'admin'), 168, array(0 => new lang_string('never'),
|
|
|
|
168 => new lang_string('numdays', '', 7),
|
|
|
|
144 => new lang_string('numdays', '', 6),
|
|
|
|
120 => new lang_string('numdays', '', 5),
|
|
|
|
96 => new lang_string('numdays', '', 4),
|
|
|
|
72 => new lang_string('numdays', '', 3),
|
|
|
|
48 => new lang_string('numdays', '', 2),
|
|
|
|
24 => new lang_string('numdays', '', 1),
|
|
|
|
12 => new lang_string('numhours', '', 12),
|
|
|
|
6 => new lang_string('numhours', '', 6),
|
|
|
|
1 => new lang_string('numhours', '', 1))));
|
|
|
|
|
|
|
|
$temp->add(new admin_setting_configselect('deleteincompleteusers', new lang_string('deleteincompleteusers', 'admin'), new lang_string('configdeleteincompleteusers', 'admin'), 0, array(0 => new lang_string('never'),
|
|
|
|
168 => new lang_string('numdays', '', 7),
|
|
|
|
144 => new lang_string('numdays', '', 6),
|
|
|
|
120 => new lang_string('numdays', '', 5),
|
|
|
|
96 => new lang_string('numdays', '', 4),
|
|
|
|
72 => new lang_string('numdays', '', 3),
|
|
|
|
48 => new lang_string('numdays', '', 2),
|
|
|
|
24 => new lang_string('numdays', '', 1))));
|
|
|
|
|
|
|
|
$temp->add(new admin_setting_configcheckbox('logguests', new lang_string('logguests', 'admin'),
|
|
|
|
new lang_string('logguests_help', 'admin'), 1));
|
|
|
|
$temp->add(new admin_setting_configselect('loglifetime', new lang_string('loglifetime', 'admin'), new lang_string('configloglifetime', 'admin'), 0, array(0 => new lang_string('neverdeletelogs'),
|
|
|
|
1000 => new lang_string('numdays', '', 1000),
|
|
|
|
365 => new lang_string('numdays', '', 365),
|
|
|
|
180 => new lang_string('numdays', '', 180),
|
|
|
|
150 => new lang_string('numdays', '', 150),
|
|
|
|
120 => new lang_string('numdays', '', 120),
|
|
|
|
90 => new lang_string('numdays', '', 90),
|
|
|
|
60 => new lang_string('numdays', '', 60),
|
|
|
|
35 => new lang_string('numdays', '', 35),
|
|
|
|
10 => new lang_string('numdays', '', 10),
|
|
|
|
5 => new lang_string('numdays', '', 5),
|
|
|
|
2 => new lang_string('numdays', '', 2))));
|
|
|
|
|
|
|
|
|
|
|
|
$temp->add(new admin_setting_configcheckbox('disablegradehistory', new lang_string('disablegradehistory', 'grades'),
|
|
|
|
new lang_string('disablegradehistory_help', 'grades'), 0));
|
|
|
|
|
|
|
|
$temp->add(new admin_setting_configselect('gradehistorylifetime', new lang_string('gradehistorylifetime', 'grades'),
|
|
|
|
new lang_string('gradehistorylifetime_help', 'grades'), 0, array(0 => new lang_string('neverdeletehistory', 'grades'),
|
|
|
|
1000 => new lang_string('numdays', '', 1000),
|
|
|
|
365 => new lang_string('numdays', '', 365),
|
|
|
|
180 => new lang_string('numdays', '', 180),
|
|
|
|
150 => new lang_string('numdays', '', 150),
|
|
|
|
120 => new lang_string('numdays', '', 120),
|
|
|
|
90 => new lang_string('numdays', '', 90),
|
|
|
|
60 => new lang_string('numdays', '', 60),
|
|
|
|
30 => new lang_string('numdays', '', 30))));
|
2007-11-08 08:59:26 +00:00
|
|
|
|
2006-09-03 14:52:43 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('server', new admin_externalpage('environment', new lang_string('environment','admin'), "$CFG->wwwroot/$CFG->admin/environment.php"));
|
|
|
|
$ADMIN->add('server', new admin_externalpage('phpinfo', new lang_string('phpinfo'), "$CFG->wwwroot/$CFG->admin/phpinfo.php"));
|
2006-09-03 14:52:43 +00:00
|
|
|
|
|
|
|
|
2006-10-30 15:58:46 +00:00
|
|
|
// "performance" settingpage
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp = new admin_settingpage('performance', new lang_string('performance', 'admin'));
|
2009-03-26 02:09:28 +00:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configtext('numcoursesincombo', new lang_string('numcoursesincombo', 'admin'), new lang_string('numcoursesincombo_help', 'admin'), 500));
|
2011-03-14 17:04:06 +08:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configselect('extramemorylimit', new lang_string('extramemorylimit', 'admin'),
|
|
|
|
new lang_string('configextramemorylimit', 'admin'), '512M',
|
2009-03-30 04:42:55 +00:00
|
|
|
// if this option is set to 0, default 128M will be used
|
2009-03-26 02:09:28 +00:00
|
|
|
array( '64M' => '64M',
|
2009-03-30 09:17:44 +00:00
|
|
|
'128M' => '128M',
|
2009-03-26 02:09:28 +00:00
|
|
|
'256M' => '256M',
|
2009-04-15 03:53:03 +00:00
|
|
|
'512M' => '512M',
|
2009-03-26 02:09:28 +00:00
|
|
|
'1024M' => '1024M'
|
|
|
|
)));
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configtext('curlcache', new lang_string('curlcache', 'admin'),
|
|
|
|
new lang_string('configcurlcache', 'admin'), 120, PARAM_INT));
|
2010-07-13 14:15:40 +00:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_configtext('curltimeoutkbitrate', new lang_string('curltimeoutkbitrate', 'admin'),
|
|
|
|
new lang_string('curltimeoutkbitrate_help', 'admin'), 56, PARAM_INT));
|
2010-07-13 14:15:40 +00:00
|
|
|
/* //TODO: we need to fix code instead of relying on slow rcache, enable this once we have some code that is actually using it
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_special_selectsetup('cachetype', new lang_string('cachetype', 'admin'),
|
|
|
|
new lang_string('configcachetype', 'admin'), '',
|
|
|
|
array( '' => new lang_string('none'),
|
2008-04-01 08:47:43 +00:00
|
|
|
'internal' => 'internal',
|
|
|
|
'memcached' => 'memcached',
|
|
|
|
'eaccelerator' => 'eaccelerator')));
|
2007-01-14 23:02:13 +00:00
|
|
|
// NOTE: $CFG->rcache is forced to bool in lib/setup.php
|
2011-12-06 11:07:55 +13:00
|
|
|
$temp->add(new admin_setting_special_selectsetup('rcache', new lang_string('rcache', 'admin'),
|
|
|
|
new lang_string('configrcache', 'admin'), 0,
|
|
|
|
array( '0' => new lang_string('no'),
|
|
|
|
'1' => new lang_string('yes'))));
|
|
|
|
$temp->add(new admin_setting_configtext('rcachettl', new lang_string('rcachettl', 'admin'),
|
|
|
|
new lang_string('configrcachettl', 'admin'), 10));
|
|
|
|
$temp->add(new admin_setting_configtext('intcachemax', new lang_string('intcachemax', 'admin'),
|
|
|
|
new lang_string('configintcachemax', 'admin'), 10));
|
|
|
|
$temp->add(new admin_setting_configtext('memcachedhosts', new lang_string('memcachedhosts', 'admin'),
|
|
|
|
new lang_string('configmemcachedhosts', 'admin'), ''));
|
|
|
|
$temp->add(new admin_setting_configselect('memcachedpconn', new lang_string('memcachedpconn', 'admin'),
|
|
|
|
new lang_string('configmemcachedpconn', 'admin'), 0,
|
|
|
|
array( '0' => new lang_string('no'),
|
|
|
|
'1' => new lang_string('yes'))));
|
2010-07-13 14:15:40 +00:00
|
|
|
*/
|
2006-10-30 15:58:46 +00:00
|
|
|
$ADMIN->add('server', $temp);
|
|
|
|
|
2010-07-13 14:15:40 +00:00
|
|
|
|
2011-12-06 11:07:55 +13:00
|
|
|
$ADMIN->add('server', new admin_externalpage('adminregistration', new lang_string('registration','admin'), "$CFG->wwwroot/$CFG->admin/registration/index.php"));
|
2010-07-13 14:15:40 +00:00
|
|
|
|
2007-10-28 22:35:00 +00:00
|
|
|
} // end of speedup
|