diff --git a/admin/configvars.php b/admin/configvars.php
new file mode 100644
index 00000000000..17fdf581d94
--- /dev/null
+++ b/admin/configvars.php
@@ -0,0 +1,461 @@
+help = $help;
+ $this->field = $field;
+ $this->warning = $warning;
+ }
+
+ function display_warning() {
+ return false;
+ }
+}
+
+
+
+
+
+////////////////////////////////////////////////////////////////////
+/// Miscellaneous config variables
+////////////////////////////////////////////////////////////////////
+ $misc = array();
+
+
+/// maxeditingtime
+ unset($options);
+ $options[3600] = get_string('numminutes', '', 60);
+ $options[2700] = get_string('numminutes', '', 45);
+ $options[1800] = get_string('numminutes', '', 30);
+ $options[900] = get_string('numminutes', '', 15);
+ $options[300] = get_string('numminutes', '', 5);
+ $options[60] = get_string('numminutes', '', 1);
+
+ $misc['maxeditingtime'] = new configvar (get_string('configmaxeditingtime', 'admin'),
+ choose_from_menu ($options, 'maxeditingtime', $config->maxeditingtime, '', '', '', true) );
+
+/// debug
+ unset($options);
+ $options[7] = $strno;
+ $options[15] = $stryes;
+
+ $misc['debug'] = new configvar (get_string('configdebug', 'admin'),
+ choose_from_menu ($options, 'debug', $config->debug, '', '', '', true) );
+
+/// enablerssfeeds
+class configvarrss extends configvar {
+ function display_warning() {
+ return (!function_exists('utf8_encode'));
+ }
+}
+
+ $misc['enablerssfeeds'] = new configvarrss (get_string('configenablerssfeeds', 'admin'),
+ choose_from_menu ($noyesoptions, 'enablerssfeeds', $config->enablerssfeeds, '', '', '', true),
+ ' You need to add XML support to your PHP installation.' );
+
+
+
+
+////////////////////////////////////////////////////////////////////
+/// OPERATING SYSTEM config variables
+////////////////////////////////////////////////////////////////////
+ $operatingsystem = array();
+
+/// gdversion
+ unset($options);
+ $options[0] = get_string('gdnot');
+ $options[1] = get_string('gd1');
+ $options[2] = get_string('gd2');
+
+ $installed = check_gd_version();
+
+ $operatingsystem['gdversion'] = new configvar (get_string('configgdversion', 'admin'),
+ choose_from_menu ($options, 'gdversion', $installed, '', '', '', true) );
+
+/// dbsessions
+ $operatingsystem['dbsessions'] = new configvar (get_string('configdbsessions', 'admin'),
+ choose_from_menu ($noyesoptions, 'dbsessions', $config->dbsessions, '', '', '', true) );
+
+/// sessiontimeout
+ unset($options);
+ $options[14400] = get_string('numhours', '', 4);
+ $options[10800] = get_string('numhours', '', 3);
+ $options[7200] = get_string('numhours', '', 2);
+ $options[5400] = get_string('numhours', '', '1.5');
+ $options[3600] = get_string('numminutes', '', 60);
+ $options[2700] = get_string('numminutes', '', 45);
+ $options[1800] = get_string('numminutes', '', 30);
+ $options[900] = get_string('numminutes', '', 15);
+ $options[300] = get_string('numminutes', '', 5);
+
+ $operatingsystem['sessiontimeout'] = new configvar (get_string('configsessiontimeout', 'admin'),
+ choose_from_menu ($options, 'sessiontimeout', $config->sessiontimeout, '', '', '', true) );
+
+/// sessioncookie
+ $operatingsystem['sessioncookie'] = new configvar (get_string('configsessioncookie', 'admin'),
+ '' );
+
+/// zip
+ $operatingsystem['zip'] = new configvar (get_string('configzip', 'admin'),
+ '' );
+
+/// unzip
+ $operatingsystem['unzip'] = new configvar (get_string('configunzip', 'admin'),
+ '' );
+
+/// slasharguments
+ unset($options);
+ $options[0] = "file.php?file=/pic.jpg";
+ $options[1] = "file.php/pic.jpg";
+
+ $operatingsystem['slasharguments'] = new configvar (get_string('configslasharguments', 'admin'),
+ choose_from_menu ($options, 'slasharguments', $config->slasharguments, '', '', '', true) );
+
+/// proxyhost
+ $operatingsystem['proxyhost'] = new configvar (get_string('configproxyhost', 'admin'),
+ '' );
+
+/// proxyport
+ $operatingsystem['proxyport'] = new configvar ('',
+ '' );
+
+
+
+////////////////////////////////////////////////////////////////////
+/// PERMISSIONS config variables
+////////////////////////////////////////////////////////////////////
+ $permissions = array();
+
+/// teacherassignteachers
+ $permissions['teacherassignteachers'] = new configvar (get_string('configteacherassignteachers', 'admin'),
+ choose_from_menu ($noyesoptions, 'teacherassignteachers', $config->teacherassignteachers, '', '', '', true) );
+
+/// allowunenroll
+ $permissions['allowunenroll'] = new configvar (get_string('configallowunenroll', 'admin'),
+ choose_from_menu ($noyesoptions, 'allowunenroll', $config->allowunenroll, '', '', '', true) );
+
+/// allusersaresitestudents
+ $permissions['allusersaresitestudents'] = new configvar (get_string('configallusersaresitestudents', 'admin'),
+ choose_from_menu ($noyesoptions, 'allusersaresitestudents', $config->allusersaresitestudents, '', '', '', true) );
+
+/// showsiteparticipantslist
+ unset($options);
+ $options[0] = get_string('siteteachers');
+ $options[1] = get_string('allteachers');
+ $options[2] = get_string('studentsandteachers');
+
+ $permissions['showsiteparticipantslist'] = new configvar (get_string('configshowsiteparticipantslist', 'admin'),
+ choose_from_menu ($options, 'showsiteparticipantslist', $config->showsiteparticipantslist, '', '', '', true) );
+
+/// maxbytes
+ $options = get_max_upload_sizes();
+
+ $permissions['maxbytes'] = new configvar (get_string('configmaxbytes', 'admin'),
+ choose_from_menu ($options, 'maxbytes', $config->maxbytes, '', '', 0, true) );
+
+/// messaging
+ $permissions['messaging'] = new configvar (get_string('configmessaging', 'admin'),
+ choose_from_menu ($noyesoptions, 'messaging', $config->messaging, '', '', '', true) );
+
+
+
+////////////////////////////////////////////////////////////////////
+/// INTERFACE config variables
+////////////////////////////////////////////////////////////////////
+ $interface = array();
+
+/// language settings
+ $interface['lang'] = new configvar ( get_string('configlang', 'admin'),
+ choose_from_menu(get_list_of_languages(), 'lang', $config->lang, '', '', '', true) );
+
+/// language menu
+ $interface['langmenu'] = new configvar ( get_string('configlangmenu', 'admin'),
+ choose_from_menu($noyesoptions, 'langmenu', $config->langmenu, '', '', '', true) );
+
+/// language list
+ $interface['langlist'] = new configvar ( get_string('configlanglist', 'admin'),
+ '' );
+
+/// locale
+ $interface['locale'] = new configvar ( get_string('configlocale', 'admin'),
+ '' );
+
+/// timezone
+ if (abs($config->timezone) > 13) {
+ $config->timezone = 99;
+ }
+ $timenow = time();
+ $timeformat = get_string('strftimedaytime');
+
+ for ($tz = -26; $tz <= 26; $tz++) {
+ $zone = (float)$tz/2.0;
+ $usertime = $timenow + ($tz * 1800);
+ if ($tz == 0) {
+ $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)";
+ } else if ($tz < 0) {
+ $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)";
+ } else {
+ $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)";
+ }
+ }
+
+ $interface['timezone'] = new configvar ( get_string('configtimezone', 'admin'),
+ choose_from_menu ($timezones, 'timezone', $config->timezone, get_string('serverlocaltime'), '', '99', true ) );
+
+/// country
+ $interface['country'] = new configvar ( get_string('configcountry', 'admin'),
+ choose_from_menu (get_list_of_countries(), 'country', $config->country, get_string('selectacountry'), '', 0, true) );
+
+/// framename
+ if (empty($config->framename)) {
+ $config->framename = "_top";
+ }
+
+ $interface['framename'] = new configvar (get_string('configframename', 'admin'),
+ '' );
+
+
+
+
+////////////////////////////////////////////////////////////////////
+/// USER config variables
+////////////////////////////////////////////////////////////////////
+ $user = array();
+
+/// sitepolicy
+ $user['sitepolicy'] = new configvar (get_string('configsitepolicy', 'admin'),
+ '' );
+
+
+/// fullnamedisplay
+ unset($options);
+ $options['language'] = get_string('language');
+ $options['firstname lastname'] = get_string('firstname') . ' + ' . get_string('lastname');
+ $options['lastname firstname'] = get_string('lastname') . ' + ' . get_string('firstname');
+ $options['firstname'] = get_string('firstname');
+
+ $user['fullnamedisplay'] = new configvar (get_string('configfullnamedisplay', 'admin'),
+ choose_from_menu ($options, 'fullnamedisplay', $config->fullnamedisplay, '', '', '', true) );
+
+/// extendedusernamechars
+ $user['extendedusernamechars'] = new configvar (get_string('configextendedusernamechars', 'admin'),
+ choose_from_menu ($noyesoptions, 'extendedusernamechars', $config->extendedusernamechars, '', '', '', true) );
+
+/// autologinguests
+ $user['autologinguests'] = new configvar (get_string('configautologinguests', 'admin'),
+ choose_from_menu ($noyesoptions, 'autologinguests', $config->autologinguests, '', '', '', true) );
+
+
+
+
+
+////////////////////////////////////////////////////////////////////
+/// SECURITY config variables
+////////////////////////////////////////////////////////////////////
+ $security = array();
+
+/// displayloginfailures
+ unset($options);
+ $options[''] = get_string('nobody');
+ $options['admin'] = get_string('administrators');
+ $options['teacher'] = get_string('administratorsandteachers');
+ $options['everybody'] = get_string('everybody');
+
+ $security['displayloginfailures'] = new configvar (get_string('configdisplayloginfailures', 'admin'),
+ choose_from_menu($options, 'displayloginfailures', $config->displayloginfailures, '', '', '', true) );
+
+/// notifyloginfailures
+ unset($options);
+ $options[''] = get_string('nobody');
+ $options['mainadmin'] = get_string('administrator');
+ $options['alladmins'] = get_string('administratorsall');
+
+ $security['notifyloginfailures'] = new configvar (get_string('confignotifyloginfailures', 'admin'),
+ choose_from_menu($options, 'notifyloginfailures', $config->notifyloginfailures, '', '', '', true) );
+
+/// notifyloginthreshold
+ unset($options);
+ for ($i=1; $i<=100; $i++) {
+ $options[$i] = "$i";
+ }
+
+ $security['notifyloginthreshold'] = new configvar (get_string('confignotifyloginthreshold', 'admin'),
+ choose_from_menu($options, 'notifyloginthreshold', $config->notifyloginthreshold, '', '', '', true) );
+
+/// secureforms
+ $security['secureforms'] = new configvar (get_string('configsecureforms', 'admin'),
+ choose_from_menu ($noyesoptions, 'secureforms', $config->secureforms, '', '', '', true) );
+
+/// loginhttps
+ $security['loginhttps'] = new configvar (get_string('configloginhttps', 'admin'),
+ choose_from_menu ($noyesoptions, 'loginhttps', $config->loginhttps, '', '', '', true) );
+
+/// forcelogin
+ $security['forcelogin'] = new configvar (get_string('configforcelogin', 'admin'),
+ choose_from_menu ($noyesoptions, 'forcelogin', $config->forcelogin, '', '', '', true) );
+
+/// forceloginforprofiles
+ $security['forceloginforprofiles'] = new configvar (get_string('configforceloginforprofiles', 'admin'),
+ choose_from_menu ($noyesoptions, 'forceloginforprofiles', $config->forceloginforprofiles, '', '', '', true) );
+
+/// opentogoogle
+ $security['opentogoogle'] = new configvar (get_string('configopentogoogle', 'admin'),
+ choose_from_menu ($noyesoptions, 'opentogoogle', $config->opentogoogle, '', '', '', true) );
+
+/// runclamonupload
+ $security['runclamonupload'] = new configvar (get_string('configrunclamonupload', 'admin'),
+ choose_from_menu($noyesoptions, 'runclamonupload', $config->runclamonupload, '', '', '', true) );
+
+/// pathtoclam
+ $security['pathtoclam'] = new configvar (get_string('configpathtoclam', 'admin'),
+ '' );
+
+/// quarantinedir
+ $security['quaratinedir'] = new configvar (get_string('configquarantinedir', 'admin'),
+ '' );
+
+/// clamfailureonupload
+ unset($options);
+ $options['donothing'] = get_string('configclamdonothing', 'admin');
+ $options['actlikevirus'] = get_string('configclamactlikevirus', 'admin');
+
+ $security['clamfailureonupload'] = new configvar (get_string('configclamfailureonupload', 'admin'),
+ choose_from_menu($options, 'clamfailureonupload', $config->clamfailureonupload, '', '', '', true) );
+
+
+
+
+////////////////////////////////////////////////////////////////////
+/// MAINTENANCE config variables
+////////////////////////////////////////////////////////////////////
+ $maintenance = array();
+
+/// longtimenosee
+ unset($options);
+ $options[0] = get_string('never');
+ $options[1000] = get_string('numdays', '', 1000);
+ $options[365] = get_string('numdays', '', 365);
+ $options[180] = get_string('numdays', '', 180);
+ $options[150] = get_string('numdays', '', 150);
+ $options[120] = get_string('numdays', '', 120);
+ $options[90] = get_string('numdays', '', 90);
+ $options[60] = get_string('numdays', '', 60);
+ $options[30] = get_string('numdays', '', 30);
+ $options[21] = get_string('numdays', '', 21);
+ $options[14] = get_string('numdays', '', 14);
+ $options[7] = get_string('numdays', '', 7);
+
+ $maintenance['longtimenosee'] = new configvar (get_string('configlongtimenosee', 'admin'),
+ choose_from_menu ($options, 'longtimenosee', $config->longtimenosee, '', '', '', true) );
+
+/// deleteunconfirmed
+ unset($options);
+ $options[0] = get_string('never');
+ $options[168] = get_string('numdays', '', 7);
+ $options[144] = get_string('numdays', '', 6);
+ $options[120] = get_string('numdays', '', 5);
+ $options[96] = get_string('numdays', '', 4);
+ $options[72] = get_string('numdays', '', 3);
+ $options[48] = get_string('numdays', '', 2);
+ $options[24] = get_string('numdays', '', 1);
+ $options[12] = get_string('numhours', '', 12);
+ $options[6] = get_string('numhours', '', 6);
+ $options[1] = get_string('numhours', '', 1);
+
+ $maintenance['deleteunconfirmed'] = new configvar (get_string('configdeleteunconfirmed', 'admin'),
+ choose_from_menu ($options, 'deleteunconfirmed', $config->deleteunconfirmed, '', '', '', true) );
+
+/// loglifetime
+ unset($options);
+ $options[0] = get_string('neverdeletelogs');
+ $options[1000] = get_string('numdays', '', 1000);
+ $options[365] = get_string('numdays', '', 365);
+ $options[180] = get_string('numdays', '', 180);
+ $options[150] = get_string('numdays', '', 150);
+ $options[120] = get_string('numdays', '', 120);
+ $options[90] = get_string('numdays', '', 90);
+ $options[60] = get_string('numdays', '', 60);
+ $options[30] = get_string('numdays', '', 30);
+
+ $maintenance['loglifetime'] = new configvar (get_string('configloglifetime', 'admin'),
+ choose_from_menu ($options, 'loglifetime', $config->loglifetime, '', '', '', true) );
+
+
+////////////////////////////////////////////////////////////////////
+/// MAIL config variables
+////////////////////////////////////////////////////////////////////
+ $mail = array();
+
+/// smtphosts
+ $mail['smtphosts'] = new configvar (get_string('configsmtphosts', 'admin'),
+ '' );
+
+/// smtpuser
+ $mail['smtpuser'] = new configvar (get_string('configsmtpuser', 'admin'),
+ '' );
+
+/// smtppass
+ $mail['smtppass'] = new configvar ('',
+ '' );
+
+/// noreplyaddress
+ $mail['noreplyaddress'] = new configvar (get_string('confignoreplyaddress', 'admin'),
+ '' );
+
+/// digestmailtime
+ $hours = array();
+ for ($i=0; $i<=23; $i++) {
+ $hours[$i] = sprintf("%02d",$i);
+ }
+
+ $mail['digestmailtime'] = new configvar (get_string('configdigestmailtime', 'admin'),
+ choose_from_menu($hours, 'digestmailtime', $config->digestmailtime, '', '', 0, true) );
+
+
+
+
+
+////////////////////////////////////////////////////////////////////
+
+ $configvars['interface'] = $interface;
+ $configvars['security'] = $security;
+ $configvars['operatingsystem'] = $operatingsystem;
+ $configvars['maintenance'] = $maintenance;
+ $configvars['mail'] = $mail;
+ $configvars['user'] = $user;
+ $configvars['permissions'] = $permissions;
+ $configvars['misc'] = $misc;
+
+?>