Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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!)

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
param: string  $newpassword Plaintext password
return: boolean result

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.

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

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