]> git.mjollnir.org Git - moodle.git/commitdiff
admin/roles: sitewide role changes mark site context as dirty
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:10:37 +0000 (07:10 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:10:37 +0000 (07:10 +0000)
And will force a reload of $USER->access for all logged-in users
on their next request.

We will have to tell admins of large sites to avoid making role changes
at busy times, as it does generate extra load.

admin/roles/allowassign.php
admin/roles/allowoverride.php
admin/roles/manage.php

index a17796c80fb1fe4b9733876ad9139174eb376f82..0827a6a1b4c9ba8c59c6a94793177a1330aba30f 100755 (executable)
@@ -45,6 +45,8 @@
                 }
             }
         }
+        // updated allowassigns sitewide...
+        mark_context_dirty($sitecontext->path);
     }
 /// displaying form here
 
index 87a4ec04732b4d369f4246adc0107820afe67b93..17c28c68c6278a110fb1e3db2913bc638bfb2540 100755 (executable)
@@ -43,6 +43,8 @@
                 }
             }
         }
+        // updated allowoverride sitewide...
+        mark_context_dirty($sitecontext->path);
     }
 /// displaying form here
 
index 09f647fef772e174498ffecd2d20c6fc4d50a6a6..2a7734125e787455baeb30bade054708f7a12398 100755 (executable)
                     }
                 }
 
+                // added a role sitewide...
+                mark_context_dirty($sitecontext->path);
+
                 if (empty($errors)) {
                     redirect('manage.php');
                 }
                         } 
                     }                    
 
+                    // edited a role sitewide...
+                    mark_context_dirty($sitecontext->path);
+
                     redirect('manage.php');
                 }
+
+                // edited a role sitewide - with errors, but still...
+                mark_context_dirty($sitecontext->path);
             }
             break;
 
             }
             if ($confirm and data_submitted() and confirm_sesskey()) {
                 if (!delete_role($roleid)) {
+
+                    // partially deleted a role sitewide...?
+                    mark_context_dirty($sitecontext->path);
+
                     error('Could not delete role with ID '.$roleid);
                 }
+                // deleted a role sitewide...
+                mark_context_dirty($sitecontext->path);
 
             } else if (confirm_sesskey()){
                 // show confirmation
             if ($newrole = create_role($currentfullname, $currentshortname, $description)) {
                 // dupilcate all the capabilities
                 role_cap_duplicate($sourcerole, $newrole);
+
+                // dup'ed a role sitewide...
+                mark_context_dirty($sitecontext->path);
+
             }
             redirect('manage.php');
             break;
 
             if ($confirm and data_submitted() and confirm_sesskey()) {
                 reset_role_capabilities($roleid);
+
+                // reset a role sitewide...
+                mark_context_dirty($sitecontext->path);
+
                 redirect('manage.php?action=view&amp;roleid='.$roleid);
 
             } else {