Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Authentication Plugin: Email Authentication

Author: Martin Dougiamas
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 259 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes


Class: auth_plugin_email  - X-Ref

Email authentication plugin.

__construct()   X-Ref
Constructor.


auth_plugin_email()   X-Ref
Old syntax of class constructor. Deprecated in PHP7.


Class: name  - X-Ref

user_login($username, $password)   X-Ref
Returns true if the username and password work and false if they are
wrong or don't exist.

param: string $username The username
param: string $password The password
return: bool Authentication success or failure.

user_update_password($user, $newpassword)   X-Ref
Updates the user's password.

called when the user password is updated.

param: object  $user        User table object  (with system magic quotes)
param: string  $newpassword Plaintext password (with system magic quotes)
return: boolean result

can_signup()   X-Ref
No description

user_signup($user, $notify=true)   X-Ref
Sign up a new user ready for confirmation.
Password is passed in plaintext.

param: object $user new user object
param: boolean $notify print notice with link and terminate

user_signup_with_confirmation($user, $notify=true, $confirmationurl = null)   X-Ref
Sign up a new user ready for confirmation.

Password is passed in plaintext.
A custom confirmationurl could be used.

param: object $user new user object
param: boolean $notify print notice with link and terminate
param: string $confirmationurl user confirmation URL
return: boolean true if everything well ok and $notify is set to true

can_confirm()   X-Ref
Returns true if plugin allows confirming of new users.

return: bool

user_confirm($username, $confirmsecret)   X-Ref
Confirm the new user as registered.

param: string $username
param: string $confirmsecret

prevent_local_passwords()   X-Ref
No description

is_internal()   X-Ref
Returns true if this authentication plugin is 'internal'.

return: bool

can_change_password()   X-Ref
Returns true if this authentication plugin can change the user's
password.

return: bool

change_password_url()   X-Ref
Returns the URL for changing the user's pw, or empty if the default can
be used.

return: moodle_url

can_reset_password()   X-Ref
Returns true if plugin allows resetting of internal password.

return: bool

can_be_manually_set()   X-Ref
Returns true if plugin can be manually set.

return: bool

is_captcha_enabled()   X-Ref
Returns whether or not the captcha element is enabled.

return: bool