Moodle  2.2.1
http://www.collinsharper.com
auth_plugin_db Class Reference
Inheritance diagram for auth_plugin_db:
Collaboration diagram for auth_plugin_db:

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)

Detailed Description

External database authentication plugin.

Definition at line 21 of file auth.php.


Member Function Documentation

Constructor.

Definition at line 26 of file auth.php.

Here is the call graph for this function:

Returns true if this authentication plugin can change the user's password.

Returns:
bool

Reimplemented from auth_plugin_base.

Definition at line 618 of file auth.php.

Returns true if plugin allows resetting of internal password.

Returns:
bool

Reimplemented from auth_plugin_base.

Definition at line 643 of file auth.php.

Returns the URL for changing the user's pw, or empty if the default can be used.

Returns:
moodle_url

Reimplemented from auth_plugin_base.

Definition at line 628 of file auth.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.

Parameters:
stdClass$config
array$errerrors
array$user_fields
Returns:
void

Reimplemented from auth_plugin_base.

Definition at line 658 of file auth.php.

Returns user attribute mappings between moodle and ldap

Returns:
array

Definition at line 130 of file auth.php.

db_init ( )

Definition at line 109 of file auth.php.

Here is the caller graph for this function:

ext_addslashes ( text)

Definition at line 735 of file auth.php.

Here is the caller graph for this function:

get_userinfo ( username)

Reads any other information for a user from external database, then returns it in an array

Parameters:
string$username
Returns:
array without magic quotes

Reimplemented from auth_plugin_base.

Definition at line 149 of file auth.php.

Here is the call graph for this function:

get_userinfo_asobj ( username)

reads user information from DB and return it in an object

Parameters:
string$usernameusername (with system magic quotes)
Returns:
array

Definition at line 446 of file auth.php.

Here is the call graph for this function:

Init result value

Definition at line 416 of file auth.php.

Here is the call graph for this function:

Returns true if this authentication plugin is "internal".

Internal plugins use password hashes from Moodle user table for authentication.

Returns:
bool

Reimplemented from auth_plugin_base.

Definition at line 594 of file auth.php.

Here is the caller graph for this function:

Indicates if moodle should automatically update internal user records with data from external sources using the information from auth_plugin_base::get_userinfo().

Returns:
bool true means automatically copy data from ext to user table

Reimplemented from auth_plugin_base.

Definition at line 608 of file auth.php.

Indicates if password hashes should be stored in local moodle database.

Returns:
bool true means md5 password hash stored in user table, false means flag 'not_cached' stored there instead

Reimplemented from auth_plugin_base.

Definition at line 583 of file auth.php.

process_config ( config)

Processes and stores configuration data for this authentication plugin.

Parameters:
srdClass$config
Returns:
bool always true or exception

Reimplemented from auth_plugin_base.

Definition at line 667 of file auth.php.

Here is the call graph for this function:

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.

Parameters:
bool$do_updatesOptional: set to true to force an update of existing accounts
bool$verbose
Returns:
int 0 means success, 1 means failure

update existing accounts

create missing accounts

Definition at line 218 of file auth.php.

Here is the call graph for this function:

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.

Parameters:
string$usernameusername
bool$updatekeys
Returns:
stdClass

Definition at line 467 of file auth.php.

Here is the call graph for this function:

user_exists ( username)

Checks if user exists in external db

Parameters:
string$username(with system magic quotes)
Returns:
bool

Init result value

Reimplemented from auth_plugin_base.

Definition at line 392 of file auth.php.

Here is the call graph for this function:

user_login ( username,
password 
)

Returns true if the username and password work and false if they are wrong or don't exist.

Parameters:
string$usernameThe username
string$passwordThe password
Returns:
bool Authentication success or failure.

Reimplemented from auth_plugin_base.

Definition at line 43 of file auth.php.

Here is the call graph for this function:

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.

Parameters:
mixed$olduserUserobject before modifications
mixed$newuserUserobject new modified userobject
Returns:
boolean result

Reimplemented from auth_plugin_base.

Definition at line 523 of file auth.php.

Here is the call graph for this function:

user_update_password ( user,
newpassword 
)

Change a user's password

Parameters:
object$userUser table object
string$newpasswordPlaintext password
Returns:
bool True on success

Reimplemented from auth_plugin_base.

Definition at line 193 of file auth.php.

Here is the call graph for this function:

validate_form ( form,
&$  err 
)

A chance to validate form data, and last chance to do stuff before it is inserted in config_plugin

Parameters:
stfdClassconfig form
array$errorerrors
Returns:
void

Definition at line 576 of file auth.php.

Here is the call graph for this function:


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations