|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| user_login ($username, $password) | |
| can_change_password () | |
| change_password_url () | |
| can_edit_profile () | |
| edit_profile_url () | |
| is_internal () | |
| prevent_local_passwords () | |
| is_synchronised_with_external () | |
| user_update_password ($user, $newpassword) | |
| user_update ($olduser, $newuser) | |
| user_delete ($olduser) | |
| can_reset_password () | |
| can_signup () | |
| user_signup ($user, $notify=true) | |
| can_confirm () | |
| user_confirm ($username, $confirmsecret) | |
| user_exists ($username) | |
| password_expire ($username) | |
| sync_roles ($user) | |
| get_userinfo ($username) | |
| config_form ($config, $err, $user_fields) | |
| validate_form (&$form, &$err) | |
| process_config ($config) | |
| loginpage_hook () | |
| user_authenticated_hook (&$user, $username, $password) | |
| prelogout_hook () | |
| logoutpage_hook () | |
| ignore_timeout_hook ($user, $sid, $timecreated, $timemodified) | |
| get_title () | |
| get_description () | |
| is_captcha_enabled () | |
| loginpage_idp_list ($wantsurl) | |
Data Fields | |
| $config | |
| $authtype | |
| $userfields | |
Definition at line 70 of file authlib.php.
Returns true if this authentication plugin can change the users' password.
Reimplemented in auth_plugin_ldap, auth_plugin_db, auth_plugin_mnet, auth_plugin_shibboleth, auth_plugin_fc, auth_plugin_email, auth_plugin_radius, auth_plugin_manual, auth_plugin_webservice, auth_plugin_imap, auth_plugin_pop3, auth_plugin_pam, auth_plugin_nntp, auth_plugin_none, auth_plugin_cas, and auth_plugin_nologin.
Definition at line 130 of file authlib.php.
| can_confirm | ( | ) |
Returns true if plugin allows confirming of new users.
Reimplemented in auth_plugin_ldap, and auth_plugin_email.
Definition at line 287 of file authlib.php.
| can_edit_profile | ( | ) |
Returns true if this authentication plugin can edit the users' profile.
Definition at line 155 of file authlib.php.
Returns true if plugin allows resetting of internal password.
Reimplemented in auth_plugin_db, auth_plugin_ldap, auth_plugin_email, auth_plugin_manual, auth_plugin_webservice, auth_plugin_none, and auth_plugin_nologin.
Definition at line 255 of file authlib.php.
| can_signup | ( | ) |
Returns true if plugin allows resetting of internal password.
Reimplemented in auth_plugin_ldap, and auth_plugin_email.
Definition at line 265 of file authlib.php.
Returns the URL for changing the users' passwords, or empty if the default URL can be used.
This method is used if can_change_password() returns true. This method is called only when user is logged in, it may use global $USER.
Reimplemented in auth_plugin_ldap, auth_plugin_db, auth_plugin_mnet, auth_plugin_cas, auth_plugin_email, auth_plugin_manual, auth_plugin_webservice, auth_plugin_imap, auth_plugin_pop3, and auth_plugin_none.
Definition at line 144 of file authlib.php.
| config_form | ( | $ | config, |
| $ | err, | ||
| $ | user_fields | ||
| ) |
Prints a form for configuring this authentication plugin.
This function is called from admin/auth.php, and outputs a full page with a form for configuring this plugin.
| object | $config | |
| object | $err | |
| array | $user_fields |
Reimplemented in auth_plugin_ldap, auth_plugin_db, auth_plugin_mnet, auth_plugin_shibboleth, auth_plugin_fc, auth_plugin_email, auth_plugin_cas, auth_plugin_radius, auth_plugin_manual, auth_plugin_webservice, auth_plugin_imap, auth_plugin_pop3, auth_plugin_none, auth_plugin_pam, and auth_plugin_nntp.
Definition at line 359 of file authlib.php.
| edit_profile_url | ( | ) |
Returns the URL for editing the users' profile, or empty if the default URL can be used.
This method is used if can_edit_profile() returns true. This method is called only when user is logged in, it may use global $USER.
Definition at line 169 of file authlib.php.
| get_description | ( | ) |
Get the auth description (from core or own auth lang files)
Definition at line 463 of file authlib.php.
| get_title | ( | ) |
Return the properly translated human-friendly title of this auth plugin
Definition at line 454 of file authlib.php.
| get_userinfo | ( | $ | username | ) |
Read user information from external database and returns it as array(). Function should return all information available. If you are saving this information to moodle user-table you should honour synchronisation flags
| string | $username | username |
Reimplemented in auth_plugin_cas, auth_plugin_ldap, auth_plugin_db, auth_plugin_shibboleth, and auth_plugin_fc.
Definition at line 344 of file authlib.php.
| ignore_timeout_hook | ( | $ | user, |
| $ | sid, | ||
| $ | timecreated, | ||
| $ | timemodified | ||
| ) |
Hook called before timing out of database session. This is useful for SSO and MNET.
| object | $user | |
| string | $sid | session id |
| int | $timecreated | start of session |
| int | $timemodified | user last seen |
Definition at line 445 of file authlib.php.
Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
Implement in child classes
Reimplemented in auth_plugin_email.
Definition at line 474 of file authlib.php.
| is_internal | ( | ) |
Returns true if this authentication plugin is "internal".
Internal plugins use password hashes from Moodle user table for authentication.
Reimplemented in auth_plugin_ldap, auth_plugin_db, auth_plugin_mnet, auth_plugin_shibboleth, auth_plugin_fc, auth_plugin_email, auth_plugin_radius, auth_plugin_manual, auth_plugin_webservice, auth_plugin_imap, auth_plugin_pop3, auth_plugin_pam, auth_plugin_nntp, auth_plugin_none, auth_plugin_cas, and auth_plugin_nologin.
Definition at line 181 of file authlib.php.

Indicates if moodle should automatically update internal user records with data from external sources using the information from get_userinfo() method.
Reimplemented in auth_plugin_db.
Definition at line 201 of file authlib.php.

| loginpage_hook | ( | ) |
Hook for overriding behaviour of login page. This method is called from login/index.php page for all enabled auth plugins.
object object
Reimplemented in auth_plugin_ldap, auth_plugin_shibboleth, and auth_plugin_cas.
Definition at line 390 of file authlib.php.
| loginpage_idp_list | ( | $ | wantsurl | ) |
Returns a list of potential IdPs that this authentication plugin supports. This is used to provide links on the login page.
| string | $wantsurl | the relative url fragment the user wants to get to. You can use this to compose a returnurl, for example |
Reimplemented in auth_plugin_mnet.
Definition at line 493 of file authlib.php.
| logoutpage_hook | ( | ) |
Hook for overriding behaviour of logout page. This method is called from login/logout.php page for all enabled auth plugins.
object string
Reimplemented in auth_plugin_mnet, and auth_plugin_shibboleth.
Definition at line 428 of file authlib.php.
| password_expire | ( | $ | username | ) |
return number of days to user password expires
If userpassword does not expire it should return 0. If password is already expired it should return negative value.
| mixed | $username | username (with system magic quotes) |
Reimplemented in auth_plugin_ldap.
Definition at line 323 of file authlib.php.
| prelogout_hook | ( | ) |
Pre logout hook. This method is called from require_logout() for all enabled auth plugins,
object
Reimplemented in auth_plugin_mnet, and auth_plugin_cas.
Definition at line 415 of file authlib.php.
Indicates if password hashes should be stored in local moodle database.
Reimplemented in auth_plugin_ldap, auth_plugin_db, auth_plugin_mnet, auth_plugin_shibboleth, auth_plugin_fc, auth_plugin_email, auth_plugin_radius, auth_plugin_manual, auth_plugin_imap, auth_plugin_pop3, auth_plugin_pam, auth_plugin_nntp, auth_plugin_none, auth_plugin_nologin, and auth_plugin_cas.
Definition at line 190 of file authlib.php.

| process_config | ( | $ | config | ) |
Processes and stores configuration data for this authentication plugin.
| object | object with submitted configuration settings (without system magic quotes) |
Reimplemented in auth_plugin_ldap, auth_plugin_mnet, auth_plugin_db, auth_plugin_cas, auth_plugin_shibboleth, auth_plugin_fc, auth_plugin_email, auth_plugin_radius, auth_plugin_manual, auth_plugin_webservice, auth_plugin_imap, auth_plugin_pop3, auth_plugin_none, auth_plugin_pam, and auth_plugin_nntp.
Definition at line 378 of file authlib.php.
| sync_roles | ( | $ | user | ) |
Sync roles for this user - usually creator
| $user | object user object (without system magic quotes) |
Reimplemented in auth_plugin_ldap, and auth_plugin_fc.
Definition at line 331 of file authlib.php.
| user_authenticated_hook | ( | &$ | user, |
| $ | username, | ||
| $ | password | ||
| ) |
Post authentication hook. This method is called from authenticate_user_login() for all enabled auth plugins.
| object | $user | user object, later used for $USER |
| string | $username | (with system magic quotes) |
| string | $password | plain text password (with system magic quotes) |
Definition at line 405 of file authlib.php.
| user_confirm | ( | $ | username, |
| $ | confirmsecret | ||
| ) |
Confirm the new user as registered.
| string | $username | |
| string | $confirmsecret |
Reimplemented in auth_plugin_ldap, auth_plugin_manual, auth_plugin_webservice, and auth_plugin_email.
Definition at line 298 of file authlib.php.

| user_delete | ( | $ | olduser | ) |
User delete requested - internal user record is mared as deleted already, username not present anymore.
Do any action in external database.
| object | $user | Userobject before delete (without system magic quotes) |
Definition at line 245 of file authlib.php.
| user_exists | ( | $ | username | ) |
Checks if user exists in external db
| string | $username | (with system magic quotes) |
Reimplemented in auth_plugin_db, and auth_plugin_ldap.
Definition at line 309 of file authlib.php.
| user_login | ( | $ | username, |
| $ | password | ||
| ) |
This is the primary method that is used by the authenticate_user_login() function in moodlelib.php.
This method should return a boolean indicating whether or not the username and password authenticate successfully.
Returns true if the username and password work and false if they are wrong or don't exist.
| string | $username | The username (with system magic quotes) |
| string | $password | The password (with system magic quotes) |
Reimplemented in auth_plugin_ldap, auth_plugin_pam, auth_plugin_manual, auth_plugin_webservice, auth_plugin_shibboleth, auth_plugin_cas, auth_plugin_radius, auth_plugin_mnet, auth_plugin_db, auth_plugin_fc, auth_plugin_email, auth_plugin_imap, auth_plugin_nntp, auth_plugin_none, auth_plugin_pop3, and auth_plugin_nologin.
Definition at line 120 of file authlib.php.

| user_signup | ( | $ | user, |
| $ | notify = true |
||
| ) |
Sign up a new user ready for confirmation. Password is passed in plaintext.
| object | $user | new user object |
| boolean | $notify | print notice with link and terminate |
Reimplemented in auth_plugin_ldap, and auth_plugin_email.
Definition at line 277 of file authlib.php.

| user_update | ( | $ | olduser, |
| $ | newuser | ||
| ) |
Called when the user record is updated. Modifies user in external database. It takes olduser (before changes) and newuser (after changes) compares information saved modified information to external db.
| mixed | $olduser | Userobject before modifications (without system magic quotes) |
| mixed | $newuser | Userobject new modified userobject (without system magic quotes) |
Reimplemented in auth_plugin_ldap, and auth_plugin_db.
Definition at line 232 of file authlib.php.
| user_update_password | ( | $ | user, |
| $ | newpassword | ||
| ) |
Updates the user's password.
In previous versions of Moodle, the function auth_user_update_password accepted a username as the first parameter. The revised function expects a user object.
| object | $user | User table object |
| string | $newpassword | Plaintext password |
Reimplemented in auth_plugin_ldap, auth_plugin_db, auth_plugin_webservice, auth_plugin_manual, auth_plugin_email, auth_plugin_none, and auth_plugin_nologin.
Definition at line 217 of file authlib.php.
| validate_form | ( | &$ | form, |
| &$ | err | ||
| ) |
A chance to validate form data, and last chance to do stuff before it is inserted in config_plugin
| object | object with submitted configuration settings (without system magic quotes) | |
| array | $err | array of error messages |
Reimplemented in auth_plugin_cas.
Definition at line 369 of file authlib.php.
| $authtype |
Definition at line 82 of file authlib.php.
| $config |
Definition at line 76 of file authlib.php.
| $userfields |
array( 'firstname', 'lastname', 'email', 'city', 'country', 'lang', 'description', 'url', 'idnumber', 'institution', 'department', 'phone1', 'phone2', 'address' )
Definition at line 87 of file authlib.php.