Fileref:sl distrib/sl send object.php
From SLIS Second Life Wiki
This Interface Script allows a user to access the Sloodle Object Distributor through a web-browser (see Moodle Distribution Interface for usage instructions).
Contents |
[edit] Dependencies
Sloodle files:
[edit] Functions
This script defines the following function for internal use only:
- keyForName($fname, $lname) = looks up a custom web-service for avatar name-to-key database
[edit] Parameters
When initially accessed through a web-browser, no parameters are needed. However, after the user submits the form, the following parameters are required to send an object:
- cmd = should be set to 'sendobject'
- object = name of the object to send
The name and/or the UUID of the avatar to whom to send the object should be specified. Note: if the name only is specified, then the avatar *must* be in the database:
- fname = first name of the avatar (required if 'lname' is specified)
- lname = last name of the avatar (required if 'fname' is specified)
- uuid = UUID of the avatar
[edit] Algorithm
- Require user login
- Construct a SloodleUser object
- Put the user's Moodle ID in the user object
- Find the avatar linked to the Moodle user, if any
- Determine if the user has at least teacher status somewhere on the site
- Display the page header
- Fetch the XMLRPC distribution channel key from the database (terminate on failure)
- Fetch the list of available distribution objects from the database (terminate on failure, or if there are none)
- Fetch the script parameters, if there are any
- Is the command (parameter 'cmd') unspecified? If yes then:
- Construct selection box of available avatar names
- Construct selection box of available objects
- Does the user have an avatar linked to their Moodle account? If yes then:
- Display the "Send to me" section
- Does the user have at least teacher status anywhere on the site? If yes then:
- Display the "Send to another avatar" section
- Else does 'cmd' specify 'sendobject'? If yes then:
- Was the UUID specified? If NOT then:
- Look up the database for the avatar name
- If not found in database and 'send to arbitrary avatars' is enabled, lookup name to key system
- If UUID could not be found, then terminate
- Send XMLRPC message
- Output success or failure
- Was the UUID specified? If NOT then:
- Display page footer
- Terminate script
| This page is part of the Sloodle documentation | |||
|---|---|---|---|
| SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home | |||
