Merge branch 'MDL-62144-master' of git://github.com/damyon/moodle
[moodle.git] / auth / upgrade.txt
blob138cbbc9781bcb429e8e09309a317356492118ec
1 This files describes API changes in /auth/* - plugins,
2 information provided here is intended especially for developers.
4 === 3.5 ===
6 * The auth_db and auth_ldap plugins' implementations of update_user_record() have been removed and both now
7   call the new implementation added in the base class.
8 * Self registration plugins should use core_privacy\local\sitepolicy\manager instead of directly checking
9   $CFG->sitepolicy , especially in custom signup forms. See https://docs.moodle.org/dev/Site_policy_handler
11 === 3.3 ===
13 * Authentication plugins have been migrated to use the admin settings API.  Plugins should use a settings.php file to
14   manage configurations rather than using the old config.html files. See how the helper function
15   upgrade_fix_config_auth_plugin_names() can be used to convert the legacy settings to the new ones. Another helper
16   function upgrade_fix_config_auth_plugin_defaults() can be used to populate the settings with default values so that
17   they are not falsely reported as newly added ones.
18 * The function 'print_auth_lock_options' has been replaced by 'display_auth_lock_options' which uses the admin settings API.
19   See auth_manual as an exmple of how it can be used.  More information can be found in MDL-12689.
20 * The list of supported identity providers (SSO IdP) returned by the 'loginpage_idp_list' method (used to render the
21   login page and login block links) now supports a new key 'iconurl' which should be used instead of the legacy 'icon'.
23 === 3.2 ===
25 * New auth hook - pre_user_login_hook() - available, triggered right after the user object is created.
26   This can be used to modify the user object before any authentication errors are raised.
27 * The block_login now displays the loginpage_idp_list() links as well as main login page.
28 * The authentication plugin auth_radius has been moved to https://github.com/moodlehq/moodle-auth_radius
29 * New auth_email::user_signup_with_confirmation() method has a new optional parameter $confirmationurl to provide a different
30   confirmation URL.
31 * New signup_is_enabled() function available in lib/authlib.php to safely check if sign-up is enabled in the site.
33 === 3.0 ===
35 * login_signup_form::signup_captcha_enabled() now calls is_captcha_enabled() from the current auth plugin instead of from auth_email
37 === 2.9 ===
39 * Do not update user->firstaccess from any auth plugin, the complete_user_login() does it automatically.
41 * Add user_add_password_history() to user_signup() method.
43 * New auth hook - pre_loginpage_hook() - available, triggered before redirecting to the login page.
45 === 2.8 ===
47 * \core\session\manager::session_exists() now verifies the session is active
48   instead of only checking the session data is present in low level session handler
50 * MNet is no longer sending logs between the client and parent sites. auth_plugin_mnet::refresh_log() is now deprecated. There is
51   no alternative. Please don't use this function.
53 === 2.7 ===
55 * If you are returning a url in method change_password_url() from config, please make sure it is set before trying to use it.
57 === 2.6 ===
59 * can_be_manually_set() - This function was introduced in the base class and returns false by default. If overriden by
60   an authentication plugin to return true, the authentication plugin will be able to be manually set for users. For example,
61   when bulk uploading users you will be able to select it as the authentication method they use.
63 === 2.4 ===
65 required changes in code:
66 * use role_get_name() or role_fix_names() if you need any role names, using role.name
67   directly from database is not correct any more
69 optional - no changes needed:
70 * add support for custom user signup form - see auth_plugin_base::signup_form() function
72 === 2.2 ===
74 required changes in code:
75 * the correct sequence to set up global $USER is:
76     $user = get_complete_user_data('username', $username); // or $user = authenticate_user_login()
77     enrol_check_plugins($user);
78     session_set_user($user);