]> git.mjollnir.org Git - moodle.git/commitdiff
Reload the guest role using new defaults
authormoodler <moodler>
Tue, 12 Sep 2006 07:10:49 +0000 (07:10 +0000)
committermoodler <moodler>
Tue, 12 Sep 2006 07:10:49 +0000 (07:10 +0000)
21 files changed:
lib/db/mysql.php
lib/db/postgres7.php
mod/assignment/version.php
mod/chat/version.php
mod/choice/version.php
mod/data/version.php
mod/exercise/version.php
mod/forum/version.php
mod/glossary/version.php
mod/hotpot/version.php
mod/journal/version.php
mod/label/version.php
mod/lams/version.php
mod/lesson/version.php
mod/quiz/version.php
mod/resource/version.php
mod/scorm/version.php
mod/survey/version.php
mod/wiki/version.php
mod/workshop/version.php
version.php

index fa3e6f1771db9b1e8749dcb850dc39dfe51e5f2e..fdc23462c024439f40ee9a58de367db549f4910d 100644 (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;
 }
 
index 44ef464074a61be7f88d06b0a7889150a290278d..0f27ecaeaf9ba336fe7aa9c72873ce199e96eba9 100644 (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;
 }
 
index 85ee874603e79f4727f1195aa4bccff2073b1c23..b05f960bdec55263e63c739170fa9b50d4bbb485 100644 (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;
 
index 5edab92c8dcb935dc55d482cd63aff47f52317be..7047231e56817b21bd67ee58de885724762cd62c 100644 (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)?
 
index b9e78c19415bf192402c452274eef693c8e534fb..6f51c4a531a3d26cf57f832ee643a011ddf3cb62 100644 (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;
 
index ab7009d64d43c6de37b1ce3be38743cd3d9d2b80..08d22db307a48e956f838a9949f62b14c6e197d0 100644 (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;
 
index 1e54d56e09ae0d82770352ceaf1f42a1737581a4..08d22db307a48e956f838a9949f62b14c6e197d0 100644 (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;
 
index 6faadfdca1af78b06ed3cfceaa9823754309af2c..3f3250b3c6fb6495ae4859a63e7feaaea01b18c7 100644 (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;
 
index ec6ad12f409251ea07e394c0482220e7b9472d63..f439db0cffc801c2fe7f852ed6a5cab5e3ff511c 100644 (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)
 
index b6dbdef88b26011fb1b16ad9ce489dcdf81ff373..6ccfd3203d9b2c43ff6dac7086871a7b648d0d5c 100644 (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)
index 1e54d56e09ae0d82770352ceaf1f42a1737581a4..08d22db307a48e956f838a9949f62b14c6e197d0 100644 (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;
 
index f2373372f7b7245135559d37f26a8948e5af8423..4b732f5fe9da5604a23a436124ebf5da5e133819 100644 (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)
 
index 7f4e96ace4864ee90c1ba33e2f163916c9ed9ef2..0557a37f92b2685961b43a37f302e2993c8c583f 100644 (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)
 
index d5ace47412faf926dec7253b946f83e9c1a96eca..7858dc965b39f2d880a73fdc892d83796b38d90d 100644 (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)
 
index be8dcd05a36338df252a16c0ce383e4fd4fb6008..02b0c6f8cf5b810c7048ff6a0a6a84d7433a5d57 100644 (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)?
 
index b9e78c19415bf192402c452274eef693c8e534fb..6f51c4a531a3d26cf57f832ee643a011ddf3cb62 100644 (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;
 
index c31c6528374588ea3f48f7235f85b73bddccf990..319b8e93efd6724282491af411dbcee823617eca 100755 (executable)
@@ -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)?
 
index b9e78c19415bf192402c452274eef693c8e534fb..6f51c4a531a3d26cf57f832ee643a011ddf3cb62 100644 (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;
 
index 751953c29ee0923e4bca09399cb0e2a906439b88..42b8d586796c1b22da81890b6eb67b872d8bb2be 100644 (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)
 
index 54a4e0bf6c36ad536afbe254e9b5b14f0acf3faa..08d22db307a48e956f838a9949f62b14c6e197d0 100644 (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;
 
index d9f6b19588fa4ffa84a97f529df4eb791f4c265d..0b8ebb34163420dd8b7a43847f9e2ac50fb6e2d7 100644 (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