}
echo str_pad($table->name, 40). " - ";
- $DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
+ try {
+ $DB->change_database_structure("ALTER TABLE {$table->name} ENGINE = $engine");
+ } catch (moodle_exception $e) {
+ echo $e->getMessage()."\n";
+ $skipped++;
+ continue;
+ }
echo "DONE\n";
$converted++;
}
$this->add_action_buttons(false, get_string('addhost', 'mnet'));
}
- function validation($data) {
+ function validation($data, $files) {
global $DB;
$wwwroot = $data['wwwroot'];
$this->add_action_buttons(false);
}
- function validation($data) {
+ function validation($data, $files) {
$errors = array();
if ($data['oldpublickey'] == $data['public_key']) {
return;
global $CFG;
$mform =& $this->_form;
+ $mnetprofileimportfields = '';
+ if (isset($CFG->mnetprofileimportfields)) {
+ $mnetprofileimportfields = str_replace(',', ', ', $CFG->mnetprofileimportfields);
+ }
+
+ $mnetprofileexportfields = '';
+ if (isset($CFG->mnetprofileexportfields)) {
+ $mnetprofileexportfields = str_replace(',', ', ', $CFG->mnetprofileexportfields);
+ }
$mform->addElement('hidden', 'hostid', $this->_customdata['hostid']);
$fields = mnet_profile_field_options();
$select = $mform->addElement('select', 'importfields', get_string('importfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
- $mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileimportfields));
+ $mform->addElement('checkbox', 'importdefault', get_string('leavedefault', 'mnet'), $mnetprofileimportfields);
// Fields to export ----------------------------------------------------
$mform->addElement('header', 'export', get_string('exportfields', 'mnet'));
$select = $mform->addElement('select', 'exportfields', get_string('exportfields', 'mnet'), $fields['optional']);
$select->setMultiple(true);
- $mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), str_replace(',', ', ', $CFG->mnetprofileexportfields));
+ $mform->addElement('checkbox', 'exportdefault', get_string('leavedefault', 'mnet'), $mnetprofileexportfields);
$this->add_action_buttons();
}
function definition() {
$mform =& $this->_form;
$mnet_peer =& $this->_customdata['peer'];
- $myservices =& mnet_get_service_info($mnet_peer);
+ $myservices = mnet_get_service_info($mnet_peer);
$mform->addElement('hidden', 'hostid', $mnet_peer->id);
// Add a category for backups
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
- // Create a page for general backup defaults
+ // Create a page for general backups configuration and defaults.
$temp = new admin_settingpage('backupgeneralsettings', new lang_string('generalbackdefaults', 'backup'), 'moodle/backup:backupcourse');
+
+ // General configuration section.
+ $temp->add(new admin_setting_configselect('backup/loglifetime', new lang_string('loglifetime', 'backup'), new lang_string('configloglifetime', 'backup'), 30, array(
+ 1 => new lang_string('numdays', '', 1),
+ 2 => new lang_string('numdays', '', 2),
+ 3 => new lang_string('numdays', '', 3),
+ 5 => new lang_string('numdays', '', 5),
+ 7 => new lang_string('numdays', '', 7),
+ 10 => new lang_string('numdays', '', 10),
+ 14 => new lang_string('numdays', '', 14),
+ 20 => new lang_string('numdays', '', 20),
+ 30 => new lang_string('numdays', '', 30),
+ 60 => new lang_string('numdays', '', 60),
+ 90 => new lang_string('numdays', '', 90),
+ 120 => new lang_string('numdays', '', 120),
+ 180 => new lang_string('numdays', '', 180),
+ 365 => new lang_string('numdays', '', 365)
+ )));
+
+ // General defaults section.
+ $temp->add(new admin_setting_heading('generalsettings', new lang_string('generalsettings', 'backup'), ''));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', new lang_string('generalusers','backup'), new lang_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', new lang_string('generalanonymize','backup'), new lang_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
$ADMIN->add('backups', $temp);
-/// "backups" settingpage
+ // Create a page for automated backups configuration and defaults.
$temp = new admin_settingpage('automated', new lang_string('automatedsetup','backup'), 'moodle/backup:backupcourse');
+
+ // Automated configuration section.
$temp->add(new admin_setting_configselect('backup/backup_auto_active', new lang_string('active'), new lang_string('autoactivedescription', 'backup'), 0, array(
0 => new lang_string('autoactivedisabled', 'backup'),
1 => new lang_string('autoactiveenabled', 'backup'),
500 => '500');
$temp->add(new admin_setting_configselect('backup/backup_auto_keep', new lang_string('keep'), new lang_string('backupkeephelp'), 1, $keepoptoins));
-
+ // Automated defaults section.
$temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), ''));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1));
echo $OUTPUT->notification('Please be patient and wait for this to complete...', 'notifysuccess');
+ set_time_limit(0);
+
if ($tables = $DB->get_tables()) {
$DB->set_debug(true);
foreach ($tables as $table) {
$fulltable = $DB->get_prefix().$table;
- $DB->change_database_structure("ALTER TABLE $fulltable ENGINE=INNODB");
+ try {
+ $DB->change_database_structure("ALTER TABLE $fulltable ENGINE=INNODB");
+ } catch (moodle_exception $e) {
+ echo $OUTPUT->notification(s($e->getMessage()).'<br />'.s($e->debuginfo));
+ }
}
$DB->set_debug(false);
}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-$string['configintrotimezones'] = 'This page will search for new information about world timezones (including daylight savings time rules) and update your local database with this information. These locations will be checked, in order: {$a} This procedure is generally very safe and can not break normal installations. Do you wish to update your timezones now?';
+$string['configintrotimezones'] = 'This page will search for new information about world timezones (including daylight savings time rules) and update your local database with this information. These locations will be checked, in order: {$a} Do you wish to update your timezones now?';
$string['importtimezones'] = 'Update complete list of timezones';
$string['importtimezonescount'] = '{$a->count} entries imported from {$a->source}';
$string['importtimezonesfailed'] = 'No sources found! (Bad news)';
+++ /dev/null
-<?php
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
-
-/**
- * Run database functional tests.
- *
- * @package tool
- * @subpackage unittest
- * @copyright 2008 Petr Skoda {@link http://skodak.org}
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-define('NO_OUTPUT_BUFFERING', true);
-
-require(dirname(__FILE__) . '/../../../config.php');
-require_once($CFG->libdir.'/adminlib.php');
-
-require_once('simpletestlib.php');
-require_once('simpletestcoveragelib.php');
-require_once('ex_simple_test.php');
-require_once('ex_reporter.php');
-
-$showpasses = optional_param('showpasses', false, PARAM_BOOL);
-$codecoverage = optional_param('codecoverage', false, PARAM_BOOL);
-$selected = optional_param_array('selected', array(), PARAM_INT);
-
-// Print the header and check access.
-admin_externalpage_setup('tooldbtest');
-echo $OUTPUT->header();
-
-global $UNITTEST;
-$UNITTEST = new stdClass();
-
-if (!data_submitted()) {
- $selected = array();
- for ($i=0; $i<=10; $i++) {
- $selected[$i] = 1;
- }
-}
-
-
-$dbinfos = array();
-$tests = array();
-
-$dbinfos[0] = array('name'=>"Current database ($CFG->dblibrary/$CFG->dbtype)", 'installed'=>true, 'configured'=>true); // TODO: localise
-if (data_submitted() and !empty($selected[0])) {
- $tests[0] = $DB;
-}
-
-for ($i=1; $i<=10; $i++) {
- $name = 'func_test_db_'.$i;
- if (!isset($CFG->$name)) {
- continue;
- }
- list($library, $driver, $dbhost, $dbuser, $dbpass, $dbname, $prefix, $dboptions) = $CFG->$name;
- $dbinfos[$i] = array('name'=>"External database $i ($library/$driver/$dbhost/$dbname/$prefix)", 'installed'=>false, 'configured'=>false);
-
- $classname = "{$driver}_{$library}_moodle_database";
- re