Class SloodleLSLHandler

Description

A helper class to automate many API features.

Most interaction with the object-oriented parts of the Sloodle API should occur via this class. It brings together the other classes, and automatically handles various features.

Located in /sloodle/lib/lsl.php (line 33)


	
			
Variable Summary
Method Summary
 bool confirm_by_login_security_token ([bool $use_cache = FALSE])
 bool is_user_enrolled_by_request ([bool $require = TRUE], [bool $use_cache = FALSE])
 bool login_by_request ([bool $require = TRUE], [bool $suppress_autoreg = FALSE])
Variables
SloodleLSLRequest $request = NULL (line 53)

A Sloodle request handling object.

Instantiated to the {@link: SloodleLSLRequest} type in the class constructor. No accessors - should be accessed directly.

  • access: public
SloodleLSLHandler $response = NULL (line 62)

A Sloodle response handling object.

Instantiated to the {@link: SloodleLSLResponse} type in the class constructor. No accessors - should be accessed directly.

  • access: public
SloodleUser $user = NULL (line 44)

A Sloodle user object.

Instantiated to the {@link: SloodleUser} type in the class constructor. No accessors - should be accessed directly.

  • access: public
Methods
Constructor SloodleLSLHandler (line 73)

Class constructor.

Instantiates member objects.

  • access: public
void SloodleLSLHandler ()
confirm_by_login_security_token (line 256)

Authenticates the avatar identified in the request by the login security token.

Uses the avatar UUID and/or name, and the security token request to parameters to check against the details in the database.

  • return: True if authentication was successful, or false if not.
  • access: public
bool confirm_by_login_security_token ([bool $use_cache = FALSE])
  • bool $use_cache: If true (not default) then the function will use the user data stored in Sloodle user cache of the {@link: $user} member object (instead of querying the database for new data).
is_user_enrolled_by_request (line 280)

Checks that a user is enrolled in a course, based on request data.

Fetches user and course identification from the standard request parameters.

  • return: True if the user is enrolled, or false otherwise.
  • access: public
bool is_user_enrolled_by_request ([bool $require = TRUE], [bool $use_cache = FALSE])
  • bool $require: If true (default) then the function will terminate with an LSL-friendly error message if user is not enrolled, or not all data was present.
  • bool $use_cache: If true (not default) then the courses cache in the {@link: $user} member will be used, instead of querying the database for fresh data.
login_by_request (line 90)

Performs an internal 'login' based on user identified in request.

Checks for avatar UUID and/or name request parameters, and checks for an associated Moodle account. If found, the user is logged-in (details stored in Moodle's global $USER variable).

  • return: True if login was successful. False if login failed, but parameter $require was false.
  • access: public
bool login_by_request ([bool $require = TRUE], [bool $suppress_autoreg = FALSE])
  • bool $require: If true (default), the function will terminate the script with an error message if login fails. (Error message will be LSL-friendly).
  • bool $suppress_autoreg: If true (not default), the function will always suppress auto-registration of new users. Note: this parameter will be ignored if auto-registration is disabled.

Documentation generated on Mon, 16 Jun 2008 15:56:41 +0100 by phpDocumentor 1.4.0