Permalink
Browse files

Merge branch 'w28_MDL-28313_m20_enroldb' of git://github.com/skodak/m…

…oodle into MOODLE_20_STABLE
  • Loading branch information...
samhemelryk committed Jul 18, 2011
2 parents a3fe534 + deba736 commit 78092d6742abb7a16a4a260e24bfb7e7fcee1ed3
Showing with 51 additions and 8 deletions.
  1. +7 −7 enrol/database/db/install.php
  2. +43 −0 enrol/database/db/upgrade.php
  3. +1 −1 enrol/database/version.php
@@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -62,9 +61,9 @@ function xmldb_enrol_database_install() {
set_config('localuserfield', $CFG->enrol_localuserfield, 'enrol_database');
unset_config('enrol_localuserfield');
}
if (isset($CFG->enrol_localrolefield)) {
set_config('localrolefield', $CFG->enrol_localrolefield, 'enrol_database');
unset_config('enrol_localrolefield');
if (isset($CFG->enrol_db_localrolefield)) {
set_config('localrolefield', $CFG->enrol_db_localrolefield, 'enrol_database');
unset_config('enrol_db_localrolefield');
}
if (isset($CFG->enrol_remotecoursefield)) {
set_config('remotecoursefield', $CFG->enrol_remotecoursefield, 'enrol_database');
@@ -74,9 +73,9 @@ function xmldb_enrol_database_install() {
set_config('remoteuserfield', $CFG->enrol_remoteuserfield, 'enrol_database');
unset_config('enrol_remoteuserfield');
}
if (isset($CFG->enrol_remoterolefield)) {
set_config('remoterolefield', $CFG->enrol_remoterolefield, 'enrol_database');
unset_config('enrol_remoterolefield');
if (isset($CFG->enrol_db_remoterolefield)) {
set_config('remoterolefield', $CFG->enrol_db_remoterolefield, 'enrol_database');
unset_config('enrol_db_remoterolefield');
}
if (isset($CFG->enrol_db_defaultcourseroleid)) {
set_config('defaultrole', $CFG->enrol_db_defaultcourseroleid, 'enrol_database');
@@ -96,6 +95,7 @@ function xmldb_enrol_database_install() {
unset_config('enrol_db_ignorehiddencourse');
}
unset_config('enrol_db_disableunenrol');
@@ -0,0 +1,43 @@
<?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/>.
/**
* Database enrolment plugin upgrade.
*
* @package enrol
* @subpackage database
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
function xmldb_enrol_database_upgrade($oldversion) {
global $DB;
$dbman = $DB->get_manager();
// fix leftovers after incorrect 2.x upgrade in install.php
if ($oldversion < 2010073101) {
unset_config('enrol_db_localrolefield');
unset_config('enrol_db_remoterolefield');
unset_config('enrol_db_disableunenrol');
upgrade_plugin_savepoint(true, 2010073101, 'enrol', 'database');
}
return true;
}
@@ -26,5 +26,5 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2010073100;
$plugin->version = 2010073101;
//TODO: should we add cron sync?

0 comments on commit 78092d6

Please sign in to comment.