Fileref:sl distrib/sl send object.php

From SLIS Second Life Wiki

Jump to: navigation, search

Image:folder.gif (parent)

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

  1. Require user login
  2. Construct a SloodleUser object
  3. Put the user's Moodle ID in the user object
  4. Find the avatar linked to the Moodle user, if any
  5. Determine if the user has at least teacher status somewhere on the site
  6. Display the page header
  7. Fetch the XMLRPC distribution channel key from the database (terminate on failure)
  8. Fetch the list of available distribution objects from the database (terminate on failure, or if there are none)
  9. Fetch the script parameters, if there are any
  10. Is the command (parameter 'cmd') unspecified? If yes then:
    1. Construct selection box of available avatar names
    2. Construct selection box of available objects
    3. Does the user have an avatar linked to their Moodle account? If yes then:
      1. Display the "Send to me" section
    4. Does the user have at least teacher status anywhere on the site? If yes then:
      1. Display the "Send to another avatar" section
  11. Else does 'cmd' specify 'sendobject'? If yes then:
    1. Was the UUID specified? If NOT then:
      1. Look up the database for the avatar name
      2. If not found in database and 'send to arbitrary avatars' is enabled, lookup name to key system
      3. If UUID could not be found, then terminate
    2. Send XMLRPC message
    3. Output success or failure
  12. Display page footer
  13. Terminate script


This page is part of the Sloodle documentation
SloodleDocs Home | User Documentation | Administrator Documentation | Developer Documentation | Sloodle Wiki Home
Personal tools