mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-61477 admin: Allow plugins to act as alternate policy handlers
The patch introduces a new site setting 'sitepolicyhandler' that can be either empty or contain a plugin component name. If it is empty, the site policy feature keeps working as before and the core keeps the control over it. If a plugin is specified, it is expected to implement the callback 'site_policy_handler' in its lib.php file. The callback should return a URL to a script where the user can accept the site policies. The plugin itself is responsible for setting the 'policyagreed' flag in the users table. The callback may return an empty value, in which case the user can continue using the site without being redirected. The patch adds support for a new pre-config flag NO_SITEPOLICY_CHECK. This constant should be defined and set to true if we should not check the user's policyagreed status during the require_login(). This is for pages where the user actually accepts the site policies and helps to avoid the redirect loop.
- Loading branch information
1 parent
a2fc9a4
commit 0bdc578
Showing
5 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters