mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
admin/roles: sitewide role changes mark site context as dirty
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.
This commit is contained in:
parent
148eb2a749
commit
b3dc845cab
@ -45,6 +45,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// updated allowassigns sitewide...
|
||||
mark_context_dirty($sitecontext->path);
|
||||
}
|
||||
/// displaying form here
|
||||
|
||||
|
@ -43,6 +43,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
// updated allowoverride sitewide...
|
||||
mark_context_dirty($sitecontext->path);
|
||||
}
|
||||
/// displaying form here
|
||||
|
||||
|
@ -117,6 +117,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
// added a role sitewide...
|
||||
mark_context_dirty($sitecontext->path);
|
||||
|
||||
if (empty($errors)) {
|
||||
redirect('manage.php');
|
||||
}
|
||||
@ -228,8 +231,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
@ -239,8 +248,14 @@
|
||||
}
|
||||
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
|
||||
@ -340,6 +355,10 @@
|
||||
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;
|
||||
@ -351,6 +370,10 @@
|
||||
|
||||
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&roleid='.$roleid);
|
||||
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user