32 Commits

Author SHA1 Message Date
Marina Glancy
1727c939ba MDL-61477 admin: sitepolicy handler API
- Define sitepolicy handler manager class, base class and the core handler
- Allow to set a plugin as sitepolicyhandler that implements the sitepolicy API
- Modify web services to return information from the 3rd party handler instead of core if needed
2018-03-15 11:32:55 +08:00
David Mudrák
0bdc578567 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.
2018-03-15 09:31:41 +08:00
Sam Hemelryk
a2ed6e69f9 MDL-44255 user: tidied up phpdocs and coding style 2014-02-24 09:23:47 +13:00
Frederic Massart
4373103084 MDL-34460 Librairies: Replaced deprecated get_context_instance() 2012-07-26 13:23:28 +08:00
Andrew Davis
d38755249d message MDL-25148 using method on $PAGE to allow or disallow popup notifications 2010-11-11 06:11:43 +00:00
Petr Skoda
b593d49d59 MDL-24570 multiple sitepolicy fixes + adding new separate guest user policy
AMOS BEGIN
 MOV [configsitepolicy,core_admin],[sitepolicy_help,core_admin]
AMOS END
2010-10-09 18:13:33 +00:00
Petr Skoda
f685e83030 MDL-14679 fixed remaining old style set_field()s 2010-09-03 18:14:55 +00:00
Dan Poltawski
e6cdc5ed8a user/policy: MDL-23812 set PAGE context and appropriately use moodle_url for button
Thanks to Myles Carrick for the patch!
2010-08-15 21:14:02 +00:00
Petr Skoda
a685593466 MDL-21233 moodle_url improvemewnts, code simplification, more diagnostics; fixed several regressions 2010-01-16 15:39:56 +00:00
Petr Skoda
dc6896efe0 MDL-21198 used new simple_button class when doing OUTPUT->confirm() - more consistent and hopefully easier to remember than html_form::make_button() ;-) 2010-01-03 20:47:13 +00:00
Petr Skoda
aa6c1ced0a MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-04 08:11:02 +00:00
samhemelryk
ce221eb52d user MDL-19825 Added set_url calls, replaced deprecated functions, and boilderplate 2009-09-25 04:02:46 +00:00
samhemelryk
caa8363f83 user MDL-19825 Upgraded print_header and build_navigation calls to use PAGE and OUTPUT equivilants 2009-09-02 08:36:16 +00:00
nicolasconnault
f2f085ee68 MDL-19825 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno 2009-08-20 08:50:22 +00:00
nicolasconnault
0ab75c34ba MDL-19825 Converted all print_footer() calls 2009-08-06 14:08:20 +00:00
nicolasconnault
8fa89bfd04 MDL-19825 Migrated calls to print_heading 2009-08-06 08:15:05 +00:00
dongsheng
4e244ba8b9 "MDL-14129, fix print_error" 2008-06-13 07:07:45 +00:00
skodak
a5d424df7c MDL-14679 converted some get/set_field() 2008-06-02 21:39:23 +00:00
dongsheng
5a2a53316f MDL-14129, remove all the other error() call 2008-04-04 02:54:20 +00:00
nicolasconnault
0be6f67819 MDL-10870 All files updated to new build_navigation() method. Most are untested, because they are not easily accessible within a moodle site. 2007-08-17 19:09:11 +00:00
skodak
9eb64c947a MDL-9825, MDL-9798, MDL-9799 - new workaround for the object trouble in IE caused by UFO; reverting previous patches; merged from MOODLE_18_STABLE 2007-05-16 18:17:14 +00:00
skodak
e61c34cfe5 MDL-9823 Disclaimer HRef is repeated twice in the Link - Policy.php for some urls; merged from MOODLE_18_STABLE 2007-05-15 19:42:53 +00:00
skodak
2b53417835 MDL-9798 fallback to html mimetype when missing index.php, index.html; merged from MOODLE_18_STABLE 2007-05-15 08:41:55 +00:00
skodak
28b2891e4c MDL-9798 workaround for handling of object tag in buggy IE; merged from MOODLE_18_STABLE 2007-05-15 08:33:22 +00:00
skodak
d04d6bcbec MDL-9190 Site policy xhtml compliance and other minor fixes; merged from MOODLE_18_STABLE 2007-04-03 09:51:53 +00:00
skodak
86a1ba04fd replace all uses of isset($USER->id) with empty() to allow proper operation of $CFG->notloggedinroleid hack 2006-09-02 11:44:04 +00:00
moodler
cbfad4d3d2 SOme XHTML fixes 2005-04-02 09:42:53 +00:00
moodler
e5b02a0878 Fixed a notice 2005-02-10 05:12:27 +00:00
moodler
ebb906d9da Prevent message window on site policy page 2005-01-30 04:52:13 +00:00
moodler
59b39c7380 Tweaks to the policy form (wider iframe and added a proper question to answer) 2004-11-29 08:10:37 +00:00
moodler
957b51989c After agreeing to site policy, you get redirected back to where you
were going.

Also, guests get asked to agree for EVERY SESSION.
2004-11-29 06:22:12 +00:00
moodler
027a160469 New feature: Site Policy Agreements.
If the admin specifies a Policy Agreement (via URL in the config variables)
then each user is required to see and agree to that document once before
continuing.

To get everyone to see it again (on an update, say) one just needs to issue:

   UPDATE user SET policyagreed = 0
2004-11-29 05:30:36 +00:00