Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Authentication Plugin: Manual Authentication Just does a simple check against the moodle database.

Copyright: 1999 onwards Martin Dougiamas (http://dougiamas.com)
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 215 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

auth_plugin_manual:: (2 methods):
  __construct()
  auth_plugin_manual()

name:: (10 methods):
  user_login()
  user_update_password()
  prevent_local_passwords()
  is_internal()
  can_change_password()
  change_password_url()
  can_reset_password()
  can_be_manually_set()
  password_expire()
  user_confirm()


Class: auth_plugin_manual  - X-Ref

Manual authentication plugin.

__construct()   X-Ref
Constructor.


auth_plugin_manual()   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. (Non-mnet accounts only!)

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

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

Called when the user password is updated.

return: boolean result
param: object  $user        User table object
param: string  $newpassword Plaintext password

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

password_expire($username)   X-Ref
Return number of days to user password expires.

If user password does not expire, it should return 0 or a positive value.
If user password is already expired, it should return negative value.

return: integer
param: mixed $username username (with system magic quotes)

user_confirm($username, $confirmsecret = null)   X-Ref
Confirm the new user as registered. This should normally not be used,
but it may be necessary if the user auth_method is changed to manual
before the user is confirmed.

param: string $username
param: string $confirmsecret