<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jackermann</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jackermann"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Jackermann"/>
	<updated>2026-06-23T11:57:31Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_3.2_release_notes&amp;diff=51679</id>
		<title>Moodle 3.2 release notes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_3.2_release_notes&amp;diff=51679"/>
		<updated>2017-01-04T18:54:09Z</updated>

		<summary type="html">&lt;p&gt;Jackermann: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Releases]] &amp;gt; {{FULLPAGENAME}}&lt;br /&gt;
 &lt;br /&gt;
Release date: 5 December 2016&lt;br /&gt;
&lt;br /&gt;
Here is [https://tracker.moodle.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQuery=project+%3D+mdl+AND+resolution+%3D+fixed+AND+fixVersion+in+%28%223.2%22%29+ORDER+BY+priority+DESC&amp;amp;runQuery=true&amp;amp;clear=true the full list of fixed issues in 3.2].&lt;br /&gt;
&lt;br /&gt;
See our [https://docs.moodle.org/32/en/New_features New Features page] for a more user-friendly introduction to Moodle 3.2 with screenshots.&lt;br /&gt;
&lt;br /&gt;
If you are upgrading from previous version, make sure you read the [https://docs.moodle.org/32/en/Upgrading Upgrading] documentation. &lt;br /&gt;
&lt;br /&gt;
==Server requirements==&lt;br /&gt;
&lt;br /&gt;
These are just the minimum supported versions. We recommend keeping all of your software up-to-date.&lt;br /&gt;
&lt;br /&gt;
* Moodle upgrade:  Moodle 2.7 or later (if upgrading from earlier versions, you must upgrade to 2.7.14 as a first step)&lt;br /&gt;
* PHP version: minimum PHP 5.6.5 (&#039;&#039;&#039;important!&#039;&#039;&#039; minimum PHP version has changed since Moodle 3.1). PHP 7.0 is supported but has some [https://docs.moodle.org/dev/Moodle_and_PHP7#Can_I_use_PHP7_yet.3F engine limitations]. PHP 7.1 is supported (released 1.12.2016.&lt;br /&gt;
&lt;br /&gt;
=== Database requirements ===&lt;br /&gt;
&lt;br /&gt;
Moodle supports the following database servers. Again, version numbers are just the minimum supported version. We recommend running the latest stable version of any software.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Database&lt;br /&gt;
! Minimum version&lt;br /&gt;
! Recommended&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.postgresql.org/ PostgreSQL]&lt;br /&gt;
| 9.1&lt;br /&gt;
| Latest&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.mysql.com/ MySQL]&lt;br /&gt;
| 5.5.31&lt;br /&gt;
| Latest&lt;br /&gt;
|-&lt;br /&gt;
| [https://mariadb.org/ MariaDB]&lt;br /&gt;
| 5.5.31&lt;br /&gt;
| Latest&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.microsoft.com/en-us/server-cloud/products/sql-server/ Microsoft SQL Server]&lt;br /&gt;
| 2008&lt;br /&gt;
| Latest&lt;br /&gt;
|-&lt;br /&gt;
| [http://www.oracle.com/us/products/database/overview/index.html Oracle Database]&lt;br /&gt;
| 10.2&lt;br /&gt;
| Latest&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Client requirements==&lt;br /&gt;
&lt;br /&gt;
=== Browser support ===&lt;br /&gt;
Moodle is compatible with any standards compliant web browser. We regularly test Moodle with the following browsers:&lt;br /&gt;
&lt;br /&gt;
Desktop:&lt;br /&gt;
* Chrome&lt;br /&gt;
* Firefox&lt;br /&gt;
* Safari&lt;br /&gt;
* Edge&lt;br /&gt;
* Internet Explorer&lt;br /&gt;
&lt;br /&gt;
Mobile:&lt;br /&gt;
* MobileSafari&lt;br /&gt;
* Google Chrome&lt;br /&gt;
&lt;br /&gt;
For the best experience and optimum security, we recommend that you keep your browser up to date. https://whatbrowser.org&lt;br /&gt;
&lt;br /&gt;
Note: Legacy browsers with known compatibility issues with Moodle 3.2:&lt;br /&gt;
* Internet Explorer 10 and below&lt;br /&gt;
* Safari 7 and below&lt;br /&gt;
&lt;br /&gt;
==Major features==&lt;br /&gt;
&lt;br /&gt;
===Highlights===&lt;br /&gt;
&lt;br /&gt;
* MDL-55071, MDL-55074 - New &amp;quot;Boost&amp;quot; Bootstrap 4 theme, usability improvements of the navigation&lt;br /&gt;
* MDL-54682 - [https://docs.moodle.org/32/en/Messaging Messaging] UI improvements&lt;br /&gt;
* MDL-52777 - [https://docs.moodle.org/32/en/User_tours User tours] - walkthoughs/instructional overlays for first time user on page&lt;br /&gt;
* MDL-38158 - Pluggable media players in Moodle; Video.JS player&lt;br /&gt;
* MDL-55324 - Easier embedding videos in audios in Atto editor with poster, subtitles and other attributes&lt;br /&gt;
* MDL-54987 - New chart API and library&lt;br /&gt;
&lt;br /&gt;
===Mobile app===&lt;br /&gt;
&lt;br /&gt;
* MDL-53870 - Support for offline quizzes in the Mobile app&lt;br /&gt;
* MDL-53777 - Include support for login via the browser in the new Moodle Mobile admin tool&lt;br /&gt;
* MDL-55059 - Support Smart App Banners for iOS&lt;br /&gt;
* MDL-56607 - Move mobile settings to top-level admin&lt;br /&gt;
&lt;br /&gt;
===External tool (LTI)===&lt;br /&gt;
&lt;br /&gt;
* MDL-49609 - Add LTI Content Item support&lt;br /&gt;
* MDL-47113 - Open LTI Tools in new Window, add link when popup is blocked&lt;br /&gt;
* MDL-53832 - LTI v2.0 support&lt;br /&gt;
&lt;br /&gt;
===Assignment===&lt;br /&gt;
&lt;br /&gt;
* MDL-38105 - Allow negative score for rubric and change default grade calculation method&lt;br /&gt;
* MDL-29795 - [https://docs.moodle.org/32/en/Using_Assignment#Overriding_assignment_deadlines Assignment deadline overrides] for an individual or group&lt;br /&gt;
* MDL-54872 - Sort blind marked assignment by blind ID instead of userid&lt;br /&gt;
&lt;br /&gt;
===Quiz===&lt;br /&gt;
&lt;br /&gt;
* MDL-48629 - Change the separator for matching correct answer feedback&lt;br /&gt;
* MDL-3782 - Allow multiple answers in cloze MULTICHOICE question type&lt;br /&gt;
* MDL-55200 - Show coordinates in ddmarker questions to simplify dropzone creation&lt;br /&gt;
* MDL-27072 - Quiz reports now work on very large courses, rather than running out of memory&lt;br /&gt;
&lt;br /&gt;
===Choice===&lt;br /&gt;
&lt;br /&gt;
* MDL-18592 - Allow teacher to make choices for students&lt;br /&gt;
* MDL-11369 - Show choice deadline in the course calendar&lt;br /&gt;
* MDL-55140 - Allow to specify open and close dates separately&lt;br /&gt;
* MDL-37946 - When choice display is set horizontal or vertical apply it to both options and results display&lt;br /&gt;
&lt;br /&gt;
===Forum===&lt;br /&gt;
&lt;br /&gt;
* MDL-18599 - Upon restore, association of &amp;quot;owner&amp;quot; of single simple discussion forum type defaults to user completing restore. Solution: hide author of the first post&lt;br /&gt;
* MDL-37669 - Forum: Make &amp;quot;Mark as read on notification&amp;quot; a user preference&lt;br /&gt;
* MDL-55982 - Add support for automatic locking of an individual forum discussion after a period of inactivity&lt;br /&gt;
&lt;br /&gt;
===Other activity modules===&lt;br /&gt;
&lt;br /&gt;
* MDL-55327 - Lesson: option to duplicate pages&lt;br /&gt;
* MDL-55868 - Book: various usability improvements&lt;br /&gt;
* MDL-56100 - Folder: Display in recent activity block&lt;br /&gt;
* MDL-54945 - Workshop: integrate with portfolio API&lt;br /&gt;
* MDL-48944 - Survey: activity completion condition on survey completion&lt;br /&gt;
* MDL-44712 - SCORM: improve Multi-SCO completion handing in activity completion&lt;br /&gt;
* MDL-55158 - Database activity: add start and end dates to the calendar&lt;br /&gt;
* MDL-14448, MDL-55464, MDL-55254, MDL-55251, MDL-49029 - Add standard capability &amp;quot;mod/xxxxx:view&amp;quot; to Lesson, Label, Database, Chat and Choice activities&lt;br /&gt;
* MDL-55866 - Remember editor disabled setting on a per-activity setting&lt;br /&gt;
&lt;br /&gt;
===Global search===&lt;br /&gt;
&lt;br /&gt;
* MDL-54794 - Add users to global search&lt;br /&gt;
* MDL-54973 - Add messages to global search&lt;br /&gt;
* MDL-55127 - Add database entries to global search&lt;br /&gt;
* MDL-53222 - Revise admin settings/report for global search for improved usability&lt;br /&gt;
&lt;br /&gt;
===Other improvements===&lt;br /&gt;
&lt;br /&gt;
* MDL-30179 - Allow teacher to toggle to/from &amp;quot;user view&amp;quot; in the User report in the gradebook (some items may be hidden for students but not teachers)&lt;br /&gt;
* MDL-53048 - New &amp;quot;password&amp;quot; fields that are not auto-filled by password managers&lt;br /&gt;
* MDL-55767 - [https://docs.moodle.org/32/en/Competency_frameworks Competency frameworks import]&lt;br /&gt;
* MDL-29110 - Specify welcome email sender in enrol_self, or send emails from system noreply address&lt;br /&gt;
* MDL-22078 - Store &amp;quot;End date&amp;quot; for each course to be used in reports and analytics&lt;br /&gt;
* MDL-53399 - &#039;Activity chooser off/on&#039; option moved to user preferences&lt;br /&gt;
* MDL-54751 - Introduce asynchronous module deletion so that recycle bin backup does not slow down editing process for the teacher&lt;br /&gt;
* MDL-55981 - By default non-editing teacher should not be able to access all groups (roles in upgraded sites are not changed)&lt;br /&gt;
* MDL-31356 - IMS Enterprise enrol plugin added features&lt;br /&gt;
* MDL-43230 - Support revoking awarded badges&lt;br /&gt;
* MDL-50286 - Allow to filter report_log by origin : Logs clogged up with events listed as origin cli&lt;br /&gt;
* MDL-51749 - Add Ability to Export Calendar for user or group events&lt;br /&gt;
* MDL-50888 - Antivirus: Implement ClamAV virus scanning using unix sockets.&lt;br /&gt;
* MDL-54617 - Always show count of online users in the online users block&lt;br /&gt;
* MDL-54680 - Offer cartridges in LTI provider&lt;br /&gt;
&lt;br /&gt;
=== For administrators ===&lt;br /&gt;
&lt;br /&gt;
Please read carefully: [https://docs.moodle.org/32/en/Upgrading#Possible_issues_that_may_affect_you_in_Moodle_3.2 Possible issues that may affect you in Moodle 3.2]&lt;br /&gt;
&lt;br /&gt;
* MDL-44467 - Return-Path should use no-reply address instead of support email; use only no-reply email or allowed domains in &amp;quot;From&amp;quot; header&lt;br /&gt;
* MDL-48468 - Add a Redis cache store to Moodle core&lt;br /&gt;
* MDL-39117 - Add a APCu cache store to Moodle core&lt;br /&gt;
* MDL-54947 - Update PostgreSQL binary (bytea) handling and improve connection performance&lt;br /&gt;
* MDL-48766 - Support IPv6 in IP lookup tool&lt;br /&gt;
* MDL-55124 - Support for connection pooler (pgbouncer) in PostgreSQL connection&lt;br /&gt;
* MDL-55916 - Maintenance mode should serve a http 503 instead of a 200&lt;br /&gt;
* MDL-54606 - Sessions: Add support for Redis as a session_class_handler&lt;br /&gt;
* MDL-53366 - Antivirus clamav: Remove &amp;quot;Quarantine directory&amp;quot; settings parameter.&lt;br /&gt;
* MDL-55791 - Add capability to allow certain users through Maintenance mode&lt;br /&gt;
&lt;br /&gt;
==== Plugins removal ====&lt;br /&gt;
&lt;br /&gt;
If you are using any of the following you need to download and install the plugins or otherwise they will be removed following 3.2 upgrade:&lt;br /&gt;
&lt;br /&gt;
* MDL-55837 - Themes [https://moodle.org/plugins/theme_base Base] and [https://moodle.org/plugins/theme_canvas Canvas] - these themes can not be used by themselves but they may be used as parent themes&lt;br /&gt;
* MDL-49533 - Repository [https://github.com/moodlehq/moodle-repository_alfresco Alfresco] for Alfresco 4.2 and below, see [https://docs.moodle.org/32/en/Alfresco_repository Alfresco repository documentation]&lt;br /&gt;
* MDL-55927 - Authentication method [https://github.com/moodlehq/moodle-auth_radius Radius]. This plugin uses mcrypt library and is not compatible with PHP 7.1&lt;br /&gt;
* MDL-38158 - Media players [https://github.com/moodlehq/moodle-media_flowplayerflash Flowplayer], [https://github.com/moodlehq/moodle-media_wmp Windows media player], [https://github.com/moodlehq/moodle-media_realplayer RealPlayer], [https://github.com/moodlehq/moodle-media_quicktime Quicktime] - these media players were present in Moodle 3.1 but removed in 3.2. They need to be installed in media/player directory&lt;br /&gt;
&lt;br /&gt;
=== Web services ===&lt;br /&gt;
&lt;br /&gt;
* MDL-31465 - Incorporate user suspension into web services&lt;br /&gt;
* MDL-45639 - Web Service for SSO (auto-login from the app to the site)&lt;br /&gt;
* MDL-55923 - Improve the behavior of deleted tokens on password reset&lt;br /&gt;
* MDL-55928 - New Web Service gradereport_user_get_grade_items&lt;br /&gt;
* MDL-55100 - New Web Service core_course_get_courses_by_field&lt;br /&gt;
&lt;br /&gt;
=== For developers ===&lt;br /&gt;
&lt;br /&gt;
* MDL-55071, MDL-55074 - New &amp;quot;Boost&amp;quot; Bootstrap 4 theme, block and navigation changes (see [[Boost_Navigation]] and [[Themes|Themes]])&lt;br /&gt;
* MDL-38158 - Introduction of Media players plugin type (see [[Media_players|Media players]])&lt;br /&gt;
* MDL-50937 - JQuery updated to version 3.1 (see [[jQuery]])&lt;br /&gt;
* MDL-54987 - New chart API and library (see [[Charts_API]])&lt;br /&gt;
* MDL-55727 - AMD modal module introduced (see [[AMD_Modal|AMD Modal documentation]])&lt;br /&gt;
* MDL-52127 - Linting for Javascript with ESLint (see [[Linting#Javascript_.28ESLint.29|Linting Javascript]])&lt;br /&gt;
* MDL-55058 - Linting for CSS with stylelint (see [[Linting#CSS.2FSCSS.2FLESS_.28stylelint.29|Linting CSS]])&lt;br /&gt;
* MDL-48114 - Moodle can now be downloaded via composer (see [[Composer#Use_composer_to_download_moodle_code|Composer]])&lt;br /&gt;
* MDL-55091 - phpunit has been upgraded to 5.x&lt;br /&gt;
* MDL-55072 - Behat now supports different themes. (See [[Running_acceptance_test]])&lt;br /&gt;
* MDL-55048 - Grunt and npm build dependencies now require node version 4 or above&lt;br /&gt;
* MDL-31243 - New get_with_capability_sql function for retrieving SQL for finding users with capability in the given context&lt;br /&gt;
* MDL-49599 - Boxnet v1 API is now deprecated&lt;br /&gt;
* MDL-53306 - New authentication plugin method added which is called before user login (see [[Authentication_plugins#pre_user_login_hook.28.26.24user.29|Authentication plugins]])&lt;br /&gt;
* MDL-47162 - Course ID is now required in message events  &lt;br /&gt;
* MDL-55141 - Debugging option added for scheduled tasks from CLI (see [https://docs.moodle.org/en/Administration_via_command_line#Scheduled_tasks Scheduled tasks documentation])&lt;br /&gt;
* MDL-54941 - Add filesize as a new field returned in all the Web Services returning file information&lt;br /&gt;
* MDL-56082 - Expose external authentication methods (loginpage_idp_list) in login block (see [[Authentication_plugins#loginpage_idp_list.28.29|Authentication plugins]])&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Moodle 3.1 release notes]]&lt;br /&gt;
 &lt;br /&gt;
[[Category:Release notes]]&lt;br /&gt;
[[Category:Moodle 3.2]]&lt;br /&gt;
 &lt;br /&gt;
[[fr:Notes de mise à jour de Moodle 3.2]]&lt;br /&gt;
[[es:Notas de Moodle 3.2]]&lt;/div&gt;</summary>
		<author><name>Jackermann</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Authentication_plugins&amp;diff=51678</id>
		<title>Authentication plugins</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Authentication_plugins&amp;diff=51678"/>
		<updated>2017-01-04T17:18:04Z</updated>

		<summary type="html">&lt;p&gt;Jackermann: /* Interfacing to API&amp;#039;s */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
This page first gives an &#039;&#039;&#039;overview&#039;&#039;&#039; of the &#039;&#039;authentication process&#039;&#039; and then explains how &#039;&#039;authentication modules&#039;&#039; can be &#039;&#039;&#039;created&#039;&#039;&#039; using hooks to take over from the native authentication in Moodle.&lt;br /&gt;
=== Overview of Moodle authentication process ===&lt;br /&gt;
[[File:1.9.11_login_element.png|203px||thumb|right|The login UI element in Moodle 1.9]]The authentication use case in Moodle starts when a user clicks on the Login link in the UI or if they try to access a protected page. There are two broad classes of authentication plugins, the regular type where moodle handles the password and ones where the password is handled by a 3rd party page eg SAML, OpenID etc.&lt;br /&gt;
&lt;br /&gt;
For the regular plugins the following happens (skipping some minor details and rarer scenarios):&lt;br /&gt;
&lt;br /&gt;
# The default login page (&amp;lt;tt&amp;gt;/login/index.php&amp;lt;/tt&amp;gt;) is displayed. OR, if a system administrator has set the Alternate Login URL on the &amp;quot;Manage authentication&amp;quot; page, that URL will be displayed.&lt;br /&gt;
# A user enters their credentials and submits the form.&lt;br /&gt;
# The handler code in &amp;lt;tt&amp;gt;/login/index.php&amp;lt;/tt&amp;gt; runs:&lt;br /&gt;
## Gets a list of enabled authentication plugins.&lt;br /&gt;
## Runs &amp;lt;tt&amp;gt;loginpage_hook()&amp;lt;/tt&amp;gt; for each plugin, in case any of them needs to intercept the login request.&lt;br /&gt;
## Checks to make sure that the username meets Moodle&#039;s criteria (alphanumeric, with periods and hyphens allowed).&lt;br /&gt;
## Calls &amp;lt;tt&amp;gt;authenticate_user_login()&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;/lib/moodlelib.php&amp;lt;/tt&amp;gt;, which returns a &amp;lt;code&amp;gt;$user&amp;lt;/code&amp;gt; object. (Details of this code follow this main outline.)&lt;br /&gt;
## Determines whether authentication was successful (by checking whether &amp;lt;code&amp;gt;$user&amp;lt;/code&amp;gt; is a valid object) and, if not, sends them back to the login page with an error message. Otherwise, it figures out where to send the user based on their original page request, whether their password is expired, etc., and redirects them there.&lt;br /&gt;
&lt;br /&gt;
For the 3rd party auth plugins the process could look like this (eg CAS, SAML, OpenID etc):&lt;br /&gt;
# Access a protected page but isn&#039;t logged in, so moodle calls &amp;lt;tt&amp;gt;pre_loginpage_hook()&amp;lt;/tt&amp;gt; on each enabled plugin, which may redirect to the 3rd party login page&lt;br /&gt;
# Or if they go directly to the login page moodle calls &amp;lt;tt&amp;gt;loginpage_hook()&amp;lt;/tt&amp;gt; on each enabled plugin, which may redirect to the 3rd party login page&lt;br /&gt;
# The user enters their credentials and authenticates on the 3rd party page&lt;br /&gt;
# The remote authentication service redirects back to moodle with an assertion, such as a single use token or encrypted response in a query param&lt;br /&gt;
# The auth plugin now validates the token or decrypts the assertion, does any other checking as required and then logs the user in using &amp;lt;tt&amp;gt;complete_user_login($user)&amp;lt;/tt&amp;gt;. If this happens inside &amp;lt;tt&amp;gt;pre_loginpage_hook()&amp;lt;/tt&amp;gt; then the user continues on their way, or if inside &amp;lt;tt&amp;gt;loginpage_hook()&amp;lt;/tt&amp;gt; or another custom page then the plugin should redirect to the wantsurl.&lt;br /&gt;
&lt;br /&gt;
Note that in this scenario above &amp;lt;tt&amp;gt;user_login($username, $password)&amp;lt;/tt&amp;gt; is never called and should probably return false.&lt;br /&gt;
&lt;br /&gt;
==History==&lt;br /&gt;
Authentication plugins exist from 1.9&lt;br /&gt;
==Example==&lt;br /&gt;
[http://moodle.org/plugins/view.php?plugin=auth_googleoauth2 Google / Facebook / Messenger Oauth2 Authentication plugin]&lt;br /&gt;
&lt;br /&gt;
==Template==&lt;br /&gt;
Please see Moodle &#039;&#039;&#039;none&#039;&#039;&#039; authentication plugin (auth/none), it&#039;s the perfect plugin template to start with.&lt;br /&gt;
&lt;br /&gt;
==Naming convention==&lt;br /&gt;
==File structure==&lt;br /&gt;
# Choose a name for your plugin.  We&#039;ll use &#039;sentry&#039; as an example below; change it to whatever name you have chosen.&lt;br /&gt;
# Under your Moodle installation root, create the directory &amp;lt;tt&amp;gt;/auth/sentry&amp;lt;/tt&amp;gt;.  It should be sibling to existing auth plugin directories: &#039;db&#039;, &#039;nologin&#039;, &#039;none&#039;, etc.&lt;br /&gt;
# Create the file &amp;lt;tt&amp;gt;/auth/sentry/auth.php&amp;lt;/tt&amp;gt;.  Within the file, create a class &amp;lt;tt&amp;gt;auth_plugin_sentry&amp;lt;/tt&amp;gt; that extends &amp;lt;tt&amp;gt;auth_plugin_base&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;/lib/authlib.php&amp;lt;/tt&amp;gt;.  (You will need to &amp;lt;code&amp;gt;require_once&amp;lt;/code&amp;gt; the authlib file.)&lt;br /&gt;
# Implement the &amp;lt;tt&amp;gt;user_login()&amp;lt;/tt&amp;gt; function in your &amp;lt;tt&amp;gt;auth.php&amp;lt;/tt&amp;gt; file, and create or override additional functions based on your plugin&#039;s requirements.&lt;br /&gt;
# Log in to your Moodle installation as a site administrator and find, in the site administrator block, the page &amp;quot;Users -&amp;gt; Authentication -&amp;gt; Manage authentication&amp;quot;.  You will see your plugin in the list, appearing as &amp;lt;nowiki&amp;gt;[[auth_sentrytitle]]&amp;lt;/nowiki&amp;gt;.  You can enable it and move it up and down in the order.  &#039;&#039;&#039;At this point, with the plugin enabled, your plugin is registered and will be used by Moodle in its authentication process.&#039;&#039;&#039;&lt;br /&gt;
# If you don&#039;t like seeing &amp;lt;nowiki&amp;gt;[[auth_sentrytitle]]&amp;lt;/nowiki&amp;gt; as the name of your plugin in the Moodle UI, you&#039;ll need to create language files for your plugin.  Do this by creating the directory &amp;lt;tt&amp;gt;/auth/sentry/lang&amp;lt;/tt&amp;gt;, and under it, a directory for each language that your installation needs to support.  (Example: &amp;lt;tt&amp;gt;/auth/sentry/lang/en&amp;lt;/tt&amp;gt;.)  Within each of these language directories, create a file called &amp;lt;tt&amp;gt;auth_sentry.php&amp;lt;/tt&amp;gt;.  That file should set the desired value for &amp;lt;code&amp;gt;$string[&#039;auth_sentrytitle&#039;] for that language (use $string[&#039;pluginname&#039;] for Moodle2)&amp;lt;/code&amp;gt;.  You can also set the plugin description by setting &amp;lt;code&amp;gt;$string[&#039;auth_sentrydescription&#039;]&amp;lt;/code&amp;gt;, and you can also assign other translatable strings that your plugin uses, in these files.  &#039;&#039;&#039;Note:&#039;&#039;&#039; A folder named like &#039;&#039;&#039;en&#039;&#039;&#039; may not work for everyone. Please refer to the lang folder under your moodle installation directory to get an idea about the language/locale codes used in your moodle installation. For example, the lang folder in own users system contained folders named &#039;&#039;&#039;en&#039;&#039;&#039; and &#039;&#039;&#039;zh-cn&#039;&#039;&#039;. He emulated the same in the lang folder of the auth plugin and the plugin picked up the title and description strings immediately. ([[Places_to_search_for_lang_strings|More info on how Moodle handles language]]).&lt;br /&gt;
# If you want to configure your plugin through the Moodle UI, implement &amp;lt;tt&amp;gt;config_form()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;process_config()&amp;lt;/tt&amp;gt; in the plugin class.  You might find it convenient to use the &#039;db&#039; plugin as a model for this.  The plugin&#039;s config settings can then be managed through the Manage authentication page by clicking on the Settings link for that plugin, and the values will be stored in the &amp;lt;tt&amp;gt;mdl_config_plugins&amp;lt;/tt&amp;gt; table in the database.&lt;br /&gt;
&lt;br /&gt;
==Interfacing to API&#039;s==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;authenticate_user_login()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
That&#039;s the main outline, but a lot of interesting stuff happens in &amp;lt;tt&amp;gt;authenticate_user_login()&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
# It gets a list of enabled authentication plugins.&lt;br /&gt;
# It looks up the username in the mdl_user table to see if they are allowed to log in, and which authentication plugin handles their login requests. (This will be the plugin that handled their first-ever login request.)&lt;br /&gt;
# It creates a user object, which will contain the data from &amp;lt;tt&amp;gt;mdl_user&amp;lt;/tt&amp;gt; if the username is known; if not, it will be an empty object.&lt;br /&gt;
# It does the following with the authentication plugin (note that for a username unknown to Moodle, it will do these steps for each authenticated plugin until one succeeds or it has tried them all):&lt;br /&gt;
## Calls the &amp;lt;tt&amp;gt;user_login()&amp;lt;/tt&amp;gt; function provided by that plugin, which returns a boolean value based on whether the credentials authenticate or not. If the result is false (not authenticated), skips the rest of the steps below and continues to the next plugin.&lt;br /&gt;
## If the plugin authenticates against an external system (not Moodle&#039;s user database), its &amp;lt;tt&amp;gt;update_user_record()&amp;lt;/tt&amp;gt; function is called to get the user&#039;s name, contact info, etc.&lt;br /&gt;
## Creates the Moodle user record if it doesn&#039;t already exist.&lt;br /&gt;
## Calls the plugin&#039;s &amp;lt;tt&amp;gt;sync_roles()&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
## Notifies each enabled authentication plugin that the user successfully authenticated, by calling each one&#039;s &amp;lt;tt&amp;gt;user_authenticated_hook()&amp;lt;/tt&amp;gt; function.&lt;br /&gt;
# It returns the user object if everything was successful, or false if no plugin was able to successfully authenticate the credentials.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_login($username, $password)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
This must be rewritten by plugin to return boolean value, returns true if the username and password work and false if they are wrong or don&#039;t exist.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;can_change_password()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns true if this authentication plugin can change users&#039; password.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : false&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;change_password_url()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns the URL for changing the users&#039; passwords, or empty if the default URL can be used.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;can_edit_profile()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns true if this authentication plugin can edit the users&#039; profile.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : true&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;edit_profile_url()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns the URL for editing users&#039; profile, or empty if the defaults URL can be used.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;is_internal()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns true if this authentication plugin is &amp;quot;internal&amp;quot;.  Internal plugins use password hashes from Moodle user table for authentication.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : true&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;prevent_local_passwords()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Indicates if password hashes should be stored in local moodle database.  This function automatically returns the opposite boolean of what is_internal() returns.  Returning true means MD5 password hashes will be stored in the user table.  Returning false means flag &#039;not_cached&#039; will be stored there instead.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : !$this-&amp;gt;is_internal()&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;is_synchronised_with_external()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Indicates if moodle should automatically update internal user records with data from external sources using the information from get_userinfo() method.  This function automatically returns the opposite boolean of what is_internal() returns.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : !$this-&amp;gt;is_internal()&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_update_password($user, $newpassword)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Update the user&#039;s password.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_update($olduser, $newuser)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Called when the user record is updated. It will modify the user information in external database.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_delete($olduser)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
User delete requested. Internal user record had been deleted.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;can_reset_password()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns true if plugin allows resetting of internal password.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : false&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;can_signup()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns true if plugin allows resetting of internal password.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : false&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_signup($user, $notify=true)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Sign up a new user ready for confirmation, password is passed in plaintext.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;can_confirm()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns true if plugin allows confirming of new users.&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Return type&#039;&#039;&#039; : boolean&lt;br /&gt;
; &#039;&#039;&#039;Default return value&#039;&#039;&#039; : false&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_confirm($username, $confirmsecret)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Confirm the new user as registered.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_exists($username)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Checks if user exists in external db.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;password_expire($username)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Returns number of days to user password expires.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;sync_roles()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Sync roles for this user - usually creator&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;get_userinfo($username)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Read user information from external database and returns it as array.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;config_form($config, $err, $user_fields)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Prints a form for configuring this authentication plugin. It&#039;s called from admin/auth.php, and outputs a full page with a form for configuring this plugin.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;validate_form($form, $err)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Validate form data.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;process_config($config)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Processes and stores configuration data for this authentication plugin.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;loginpage_hook()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Hook for overriding behaviour of login page.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;pre_loginpage_hook()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Hook for overriding behaviour of prior to redirecting to the login page, eg redirecting to an external login url for SAML or OpenID authentication. If you implement this you should also implement loginpage_hook as the user may go directly to the login page.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;user_authenticated_hook($user, $username, $password)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Post authentication hook. This method is called from authenticate_user_login() for all enabled auth plugins.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;prelogout_hook()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Pre logout hook.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;postlogout_hook()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
This method replace the prelogout_hook method to avoid authentication plugins redirects before the user logout event being triggered. &lt;br /&gt;
At the moment the only authentication plugin using this method is CAS (SSO).&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;logoutpage_hook()&amp;lt;/tt&amp;gt;===&lt;br /&gt;
Hook for overriding behaviour of logout page.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;can_be_manually_set()&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
This function was introduced in the base class and returns false by default. If overriden by an authentication plugin to return true, the authentication plugin will be able to be manually set for users. For example, when bulk uploading users you will be able to select it as the authentication method they use.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt; loginpage_idp_list() &amp;lt;/tt&amp;gt; ===&lt;br /&gt;
Override this method and return a list of Identification Providers (IDPs) that your authentication plugin supports. An array of associative arrays containing url, icon and name for the IDP. These will be displayed on the login page and in the login block.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;tt&amp;gt;pre_user_login_hook(&amp;amp;$user)&amp;lt;/tt&amp;gt;===&lt;br /&gt;
This method is called from authenticate_user_login() right after the user object is generated. This gives the auth plugin an option to make modification to the user object before the verification process starts.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Authentication API]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=102070 Overview of entire authentication code flow] forum discussion&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=42 User authentication forum]&lt;br /&gt;
* Moodle Docs [[:en:Manage authentication|Manage authentication]]&lt;br /&gt;
* [[:en:Authentication FAQ|Authentication FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Authentication]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[fr:Méthodes_d&#039;authentification]]&lt;/div&gt;</summary>
		<author><name>Jackermann</name></author>
	</entry>
</feed>