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


Public Member Functions | |
| auth_plugin_db () | |
| user_login ($username, $password) | |
| db_init () | |
| db_attributes () | |
| get_userinfo ($username) | |
| user_update_password ($user, $newpassword) | |
| sync_users ($do_updates=false, $verbose=false) | |
| user_exists ($username) | |
| get_userlist () | |
| get_userinfo_asobj ($username) | |
| update_user_record ($username, $updatekeys=false) | |
| user_update ($olduser, $newuser) | |
| validate_form ($form, &$err) | |
| prevent_local_passwords () | |
| is_internal () | |
| is_synchronised_with_external () | |
| can_change_password () | |
| change_password_url () | |
| can_reset_password () | |
| config_form ($config, $err, $user_fields) | |
| process_config ($config) | |
| ext_addslashes ($text) | |
| auth_plugin_db | ( | ) |
Returns true if this authentication plugin can change the user's password.
Reimplemented from auth_plugin_base.
Returns true if plugin allows resetting of internal password.
Reimplemented from auth_plugin_base.
Returns the URL for changing the user's pw, or empty if the default can be used.
Reimplemented from auth_plugin_base.
| 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.
| stdClass | $config | |
| array | $err | errors |
| array | $user_fields |
Reimplemented from auth_plugin_base.
| db_attributes | ( | ) |
| ext_addslashes | ( | $ | text | ) |
| get_userinfo | ( | $ | username | ) |
Reads any other information for a user from external database, then returns it in an array
| string | $username |
Reimplemented from auth_plugin_base.
Definition at line 149 of file auth.php.

| get_userinfo_asobj | ( | $ | username | ) |
| get_userlist | ( | ) |
| is_internal | ( | ) |
Returns true if this authentication plugin is "internal".
Internal plugins use password hashes from Moodle user table for authentication.
Reimplemented from auth_plugin_base.
Definition at line 594 of file auth.php.

Indicates if moodle should automatically update internal user records with data from external sources using the information from auth_plugin_base::get_userinfo().
Reimplemented from auth_plugin_base.
Indicates if password hashes should be stored in local moodle database.
Reimplemented from auth_plugin_base.
| process_config | ( | $ | config | ) |
Processes and stores configuration data for this authentication plugin.
| srdClass | $config |
Reimplemented from auth_plugin_base.
Definition at line 667 of file auth.php.

| sync_users | ( | $ | do_updates = false, |
| $ | verbose = false |
||
| ) |
synchronizes user from external db to moodle user table
Sync should be done by using idnumber attribute, not username. You need to pass firstsync parameter to function to fill in idnumbers if they don't exists in moodle user table.
Syncing users removes (disables) users that don't exists anymore in external db. Creates new users and updates coursecreator status of users.
This implementation is simpler but less scalable than the one found in the LDAP module.
| bool | $do_updates | Optional: set to true to force an update of existing accounts |
| bool | $verbose |
update existing accounts
create missing accounts
Definition at line 218 of file auth.php.

| update_user_record | ( | $ | username, |
| $ | updatekeys = false |
||
| ) |
will update a local user record from an external source. is a lighter version of the one in moodlelib -- won't do expensive ops such as enrolment
If you don't pass $updatekeys, there is a performance hit and values removed from DB won't be removed from moodle.
| string | $username | username |
| bool | $updatekeys |
Definition at line 467 of file auth.php.

| user_exists | ( | $ | username | ) |
Checks if user exists in external db
| string | $username | (with system magic quotes) |
Init result value
Reimplemented from auth_plugin_base.
Definition at line 392 of file auth.php.

| user_login | ( | $ | username, |
| $ | password | ||
| ) |
Returns true if the username and password work and false if they are wrong or don't exist.
| string | $username | The username |
| string | $password | The password |
Reimplemented from auth_plugin_base.
Definition at line 43 of file auth.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 |
| mixed | $newuser | Userobject new modified userobject |
Reimplemented from auth_plugin_base.
Definition at line 523 of file auth.php.

| user_update_password | ( | $ | user, |
| $ | newpassword | ||
| ) |
Change a user's password
| object | $user | User table object |
| string | $newpassword | Plaintext password |
Reimplemented from auth_plugin_base.
Definition at line 193 of file auth.php.

| validate_form | ( | $ | form, |
| &$ | err | ||
| ) |