Reload the guest role using new defaults

This commit is contained in:
moodler
2006-09-12 07:10:49 +00:00
parent 2e85fffeb1
commit 8d158ed44f
21 changed files with 44 additions and 20 deletions
+13 -1
View File
@@ -2186,6 +2186,7 @@ function main_upgrade($oldversion=0) {
execute_sql("ALTER TABLE {$CFG->prefix}course_sections CHANGE sequence sequence text NULL AFTER section");
}
// table to keep track of course page access times, used in online participants block, and participants list
if ($oldversion < 2006091200) {
execute_sql("CREATE TABLE {$CFG->prefix}user_lastaccess (
@@ -2199,7 +2200,18 @@ function main_upgrade($oldversion=0) {
PRIMARY KEY (`id`)
)TYPE=MYISAM COMMENT ='time user last accessed any page in a course';", true);
}
if ($oldversion < 2006091211) { // Reload the guest roles completely with new defaults
if ($guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) {
delete_records('capabilities');
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
foreach ($guestroles as $guestrole) {
delete_records('role_capabilities', 'roleid', $guestrole->id);
assign_capability('moodle/legacy:guest', CAP_ALLOW, $guestrole->id, $sitecontext->id);
}
}
}
return $result;
}
+12
View File
@@ -1800,6 +1800,18 @@ function main_upgrade($oldversion=0) {
execute_sql("CREATE UNIQUE INDEX {$CFG->prefix}user_lastaccess_useridcourseid_idx ON {$CFG->prefix}user_lastaccess (userid, courseid);", true);
}
if ($oldversion < 2006091211) { // Reload the guest roles completely with new defaults
if ($guestroles = get_roles_with_capability('moodle/legacy:guest', CAP_ALLOW)) {
delete_records('capabilities');
$sitecontext = get_context_instance(CONTEXT_SYSTEM, SITEID);
foreach ($guestroles as $guestrole) {
delete_records('role_capabilities', 'roleid', $guestrole->id);
assign_capability('moodle/legacy:guest', CAP_ALLOW, $guestrole->id, $sitecontext->id);
}
}
}
return $result;
}
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900; // The (date) version of this module
$module->version = 2006091200; // The (date) version of this module
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 300; // How often should cron check this module (seconds)?
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0;
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006081700;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006082700;
$module->version = 2006091200;
$module->requires = 2006082600; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006090400;
$module->version = 2006091200;
$module->requires = 2006082600; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)
+1 -1
View File
@@ -3,7 +3,7 @@
/// Code fragment to define the version of hotpot
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006083101; // release date of this version (see note below)
$module->version = 2006091200; // release date of this version (see note below)
$module->release = 'v2.2.0'; // human-friendly version name (used in mod/hotpot/lib.php)
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0; // period for cron to check this module (secs)
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900; // The current module version (Date: YYYYMMDDXX)
$module->version = 2006091200; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006091100; // The current module version (Date: YYYYMMDDXX)
$module->version = 2006091200; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006090700; // The current module version (Date: YYYYMMDDXX)
$module->version = 2006091200; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006082500; // The (date) version of this module
$module->version = 2006091200; // The (date) version of this module
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0;
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900; // The (date) version of this module
$module->version = 2006091200; // The (date) version of this module
$module->requires = 2006080900; // The version of Moodle that is required
$module->cron = 0; // How often should cron check this module (seconds)?
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006080900;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 0;
+1 -1
View File
@@ -5,7 +5,7 @@
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
$module->version = 2006091003; // The current module version (Date: YYYYMMDDXX)
$module->version = 2006091200; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2006080900; // The current module version (Date: YYYYMMDDXX)
$module->cron = 0; // Period for cron to check this module (secs)
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006090500;
$module->version = 2006091200;
$module->requires = 2006080900; // Requires this Moodle version
$module->cron = 60;
+1 -1
View File
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
$version = 2006090600; // YYYYMMDD = date
$version = 2006091211; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.7 dev'; // Human-friendly version name