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

Public Member Functions

 auth_plugin_mnet ()
 user_login ($username, $password)
 user_authorise ($token, $useragent)
 generate_token ()
 start_jump_session ($mnethostid, $wantsurl, $wantsurlbackhere=false)
 confirm_mnet_session ($token, $remotepeer)
 update_mnet_session ($user, $token, $remotepeer)
 update_enrolments ($username, $courses)
 prevent_local_passwords ()
 is_internal ()
 can_change_password ()
 change_password_url ()
 config_form ($config, $err, $user_fields)
 process_config ($config)
 keepalive_client ()
 refresh_log ($array)
 keepalive_server ($array)
 cron ()
 prelogout_hook ()
 kill_parent ($username, $useragent)
 kill_children ($username, $useragent)
 kill_child ($username, $useragent)
 end_local_sessions (&$sessionArray)
 fetch_user_image ($username)
 fetch_theme_info ()
 has_service ($mnethostid, $servicename)
 can_login_remotely ($username, $mnethostid)
 logoutpage_hook ()
 trim_logline ($logline)
 loginpage_idp_list ($wantsurl)

Detailed Description

Moodle Network authentication plugin.

Definition at line 24 of file auth.php.


Member Function Documentation

Constructor.

Definition at line 29 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 583 of file auth.php.

can_login_remotely ( username,
mnethostid 
)

Checks the MNET access control table to see if the username/mnethost is permitted to login to this moodle.

Parameters:
string$usernameThe username
int$mnethostidThe id of the remote mnethost
Returns:
bool Whether the user can login from the remote host

Definition at line 1217 of file auth.php.

Here is the caller graph for this function:

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

Returns:
moodle_url

Reimplemented from auth_plugin_base.

Definition at line 594 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:
object$config
object$err
array$user_fields

Reimplemented from auth_plugin_base.

Definition at line 608 of file auth.php.

confirm_mnet_session ( token,
remotepeer 
)

This function confirms the remote (ID provider) host's mnet session by communicating the token and UA over the XMLRPC transport layer, and returns the local user record on success.

Parameters:
string$tokenThe random session token.
mnet_peer$remotepeerThe ID provider mnet_peer object.
Returns:
array The local user record.

Definition at line 206 of file auth.php.

Here is the call graph for this function:

cron ( )

Cron function will be called automatically by cron.php every 5 minutes

Returns:
void

Definition at line 933 of file auth.php.

end_local_sessions ( &$  sessionArray)

To delete a host, we must delete all current sessions that users from that host are currently engaged in.

Parameters:
string$sessionidarrayAn array of session hashes
Returns:
bool True on success

Definition at line 1107 of file auth.php.

Here is the call graph for this function:

Returns the theme information and logo url as strings.

Returns:
string The theme info

Definition at line 1165 of file auth.php.

fetch_user_image ( username)

Returns the user's profile image info

If the user exists and has a profile picture, the returned array will contain keys: f1 - the content of the default 100x100px image f1_mimetype - the mimetype of the f1 file f2 - the content of the 35x35px variant of the image f2_mimetype - the mimetype of the f2 file

The mimetype information was added in Moodle 2.0. In Moodle 1.x, images are always jpegs.

See also:
process_new_icon() mnet_remote_client callable via MNet XML-RPC
Parameters:
int$useridThe id of the user
Returns:
false|array false if user not found, empty array if no picture exists, array with data otherwise

Definition at line 1134 of file auth.php.

Here is the call graph for this function:

Generate a random string for use as an RPC session token.

Definition at line 119 of file auth.php.

Here is the caller graph for this function:

has_service ( mnethostid,
servicename 
)

Determines if an MNET host is providing the nominated service.

Parameters:
int$mnethostidThe id of the remote host
string$servicenameThe name of the service
Returns:
bool Whether the service is available on the remote host

Definition at line 1183 of file auth.php.

Here is the caller graph for this function:

Returns true if this authentication plugin is 'internal'.

Returns:
bool

Reimplemented from auth_plugin_base.

Definition at line 573 of file auth.php.

Poll the IdP server to let it know that a user it has authenticated is still online

Returns:
void

Definition at line 696 of file auth.php.

Here is the call graph for this function:

keepalive_server ( array)

Receives an array of usernames from a remote machine and prods their sessions to keep them alive

Parameters:
array$arrayAn array of usernames
Returns:
string "All ok" or an error message

Definition at line 893 of file auth.php.

Here is the call graph for this function:

kill_child ( username,
useragent 
)

When the IdP requests that child sessions are terminated, this function will be called on each of the child hosts. The machine that calls the function (over xmlrpc) provides us with the mnethostid we need.

Parameters:
string$usernameUsername for session to kill
string$useragentSHA1 hash of user agent to look for
Returns:
bool True on success

Definition at line 1088 of file auth.php.

Here is the call graph for this function:

kill_children ( username,
useragent 
)

The IdP uses this function to kill child sessions on other hosts

Parameters:
string$usernameUsername for session to kill
string$useragentSHA1 hash of user agent to look for
Returns:
string A plaintext report of what has happened

Definition at line 1027 of file auth.php.

Here is the call graph for this function:

kill_parent ( username,
useragent 
)

The SP uses this function to kill the session on the parent IdP

Parameters:
string$usernameUsername for session to kill
string$useragentSHA1 hash of user agent to look for
Returns:
string A plaintext report of what has happened

Definition at line 980 of file auth.php.

Here is the call graph for this function:

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 from auth_plugin_base.

Definition at line 1270 of file auth.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 from auth_plugin_base.

Definition at line 1228 of file auth.php.

Cleanup any remote mnet_sessions, kill the local mnet_session data

This is called by require_logout in moodlelib

Returns:
void

Reimplemented from auth_plugin_base.

Definition at line 955 of file auth.php.

Here is the call graph for this function:

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 564 of file auth.php.

process_config ( config)

Processes and stores configuration data for this authentication plugin.

Reimplemented from auth_plugin_base.

Definition at line 672 of file auth.php.

Here is the call graph for this function:

refresh_log ( array)

Receives an array of log entries from an SP and adds them to the mnet_log table

Parameters:
array$arrayAn array of usernames
Returns:
string "All ok" or an error message

Definition at line 841 of file auth.php.

Here is the call graph for this function:

start_jump_session ( mnethostid,
wantsurl,
wantsurlbackhere = false 
)

Starts an RPC jump session and returns the jump redirect URL.

Parameters:
int$mnethostidid of the mnet host to jump to
string$wantsurlurl to redirect to after the jump (usually on remote system)
boolean$wantsurlbackheredefaults to false, means that the remote system should bounce us back here rather than somewhere inside *its* wwwroot

Definition at line 131 of file auth.php.

Here is the call graph for this function:

trim_logline ( logline)

Trims a log line from mnet peer to limit each part to a length which can be stored in our DB

Parameters:
object$loglineThe log information to be trimmed
Returns:
object The passed logline object trimmed to not exceed storable limits

Definition at line 1243 of file auth.php.

update_enrolments ( username,
courses 
)

Invoke this function _on_ the IDP to update it with enrolment info local to the SP right after calling user_authorise()

Normally called by the SP after calling user_authorise()

Parameters:
string$usernameThe username
array$coursesAssoc array of courses following the structure of mnetservice_enrol_courses
Returns:
bool

Definition at line 463 of file auth.php.

Here is the call graph for this function:

update_mnet_session ( user,
token,
remotepeer 
)

creates (or updates) the mnet session once {

See also:
confirm_mnet_session} and {
complete_user_login} have both been called
Parameters:
stdclass$userthe local user (must exist already
string$tokenthe jump/land token
mnet_peer$remotepeerthe mnet_peer object of this users's idp

Definition at line 425 of file auth.php.

user_authorise ( token,
useragent 
)

Return user data for the provided token, compare with user_agent string.

Parameters:
string$tokenThe unique ID provided by remotehost.
string$UAUser Agent string.
Returns:
array $userdata Array of user info for remote host

Definition at line 55 of file auth.php.

Here is the call graph for this function:

user_login ( username,
password 
)

This function is normally used to determine if the username and password are correct for local logins. Always returns false, as local users do not need to login over mnet xmlrpc.

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

Reimplemented from auth_plugin_base.

Definition at line 44 of file auth.php.


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