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

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

Detailed Description

Definition at line 70 of file authlib.php.


Member Function Documentation

Returns true if plugin allows confirming of new users.

Returns:
bool

Reimplemented in auth_plugin_ldap, and auth_plugin_email.

Definition at line 287 of file authlib.php.

Returns true if this authentication plugin can edit the users' profile.

Returns:
bool

Definition at line 155 of file authlib.php.

Returns true if plugin allows resetting of internal password.

Returns:
bool

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.

Returns true if plugin allows resetting of internal password.

Returns:
bool

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.

Returns:
moodle_url url of the profile page or null if standard used

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.

Parameters:
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.

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.

Returns:
moodle_url url of the profile page or null if standard used

Definition at line 169 of file authlib.php.

Get the auth description (from core or own auth lang files)

Returns:
string The description

Definition at line 463 of file authlib.php.

get_title ( )

Return the properly translated human-friendly title of this auth plugin

Todo:
Document this function

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

Parameters:
string$usernameusername
Returns:
mixed array with no magic quotes or false on error

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.

Parameters:
object$user
string$sidsession id
int$timecreatedstart of session
int$timemodifieduser last seen
Returns:
bool true means do not timeout session yet

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

Returns:
bool

Reimplemented in auth_plugin_email.

Definition at line 474 of file authlib.php.

Returns true if this authentication plugin is "internal".

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

Returns:
bool

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.

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 get_userinfo() method.

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

Reimplemented in auth_plugin_db.

Definition at line 201 of file authlib.php.

Here is the call graph for this function:

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.

Parameters:
string$wantsurlthe relative url fragment the user wants to get to. You can use this to compose a returnurl, for example
Returns:
array like: array( array( 'url' => 'http://someurl', 'icon' => new pix_icon(...), 'name' => get_string('somename', 'auth_yourplugin'), ), )

Reimplemented in auth_plugin_mnet.

Definition at line 493 of file authlib.php.

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.

Parameters:
mixed$usernameusername (with system magic quotes)
Returns:
integer

Reimplemented in auth_plugin_ldap.

Definition at line 323 of file authlib.php.

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.

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

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.

Here is the call graph for this function:

process_config ( config)

Processes and stores configuration data for this authentication plugin.

Parameters:
objectobject 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

Parameters:
$userobject 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.

Parameters:
object$useruser object, later used for $USER
string$username(with system magic quotes)
string$passwordplain text password (with system magic quotes)

Definition at line 405 of file authlib.php.

user_confirm ( username,
confirmsecret 
)

Confirm the new user as registered.

Parameters:
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.

Here is the call graph for this function:

user_delete ( olduser)

User delete requested - internal user record is mared as deleted already, username not present anymore.

Do any action in external database.

Parameters:
object$userUserobject before delete (without system magic quotes)
Returns:
void

Definition at line 245 of file authlib.php.

user_exists ( username)

Checks if user exists in external db

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

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.

Parameters:
string$usernameThe username (with system magic quotes)
string$passwordThe password (with system magic quotes)
Returns:
bool Authentication success or failure.

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.

Here is the call graph for this function:

user_signup ( user,
notify = true 
)

Sign up a new user ready for confirmation. Password is passed in plaintext.

Parameters:
object$usernew user object
boolean$notifyprint notice with link and terminate

Reimplemented in auth_plugin_ldap, and auth_plugin_email.

Definition at line 277 of file authlib.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 (without system magic quotes)
mixed$newuserUserobject new modified userobject (without system magic quotes)
Returns:
boolean true if updated or update ignored; false if error

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.

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

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

Parameters:
objectobject with submitted configuration settings (without system magic quotes)
array$errarray of error messages

Reimplemented in auth_plugin_cas.

Definition at line 369 of file authlib.php.


Field Documentation

$authtype

Definition at line 82 of file authlib.php.

$config

Definition at line 76 of file authlib.php.

$userfields
Initial value:
 array(
        'firstname',
        'lastname',
        'email',
        'city',
        'country',
        'lang',
        'description',
        'url',
        'idnumber',
        'institution',
        'department',
        'phone1',
        'phone2',
        'address'
    )

Definition at line 87 of file authlib.php.


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