Source for file check_user_auth_linker.php

Documentation is available at check_user_auth_linker.php

  1. <?php
  2.     // This script is part of the Sloodle project
  3.  
  4.     /**
  5.     * User object authorisation checker.
  6.     * Allows objects to check that their user-centric authorisation works.
  7.     * It will also make sure the avatar is registered.
  8.     *
  9.     * @package sloodle
  10.     * @copyright Copyright (c) 2008 Sloodle (various contributors)
  11.     * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
  12.     *
  13.     * @contributor Peter R. Bloomfield
  14.     *
  15.     */
  16.     
  17.     /*
  18.     * The following parameters are required:
  19.     *
  20.     *  sloodleuuid = UUID of the avatar
  21.     *  sloodlepwd = password to authenticate with
  22.     *
  23.     * If the authorisation is OK, the status code returned will be 1.
  24.     */
  25.     
  26.     
  27.     /** Lets Sloodle know we are in a linker script. */
  28.     define('SLOODLE_LINKER_SCRIPT'true);
  29.     
  30.     /** Grab the Sloodle/Moodle configuration. */
  31.     require_once('../sl_config.php');
  32.     /** Include the Sloodle PHP API. */
  33.     require_once(SLOODLE_LIBROOT.'/sloodle_session.php');
  34.     
  35.     
  36.     // Process the request and check the authorisation and avatar
  37.     $sloodle new SloodleSession();
  38.     $sloodle->authenticate_user_request();
  39.     $sloodle->validate_avatar();
  40.     
  41.     // Everything seems OK
  42.     $sloodle->response->set_status_code(1);
  43.     $sloodle->response->set_status_descriptor('OK');
  44.     $sloodle->response->render_to_output();
  45.     
  46.     exit();
  47. ?>

Documentation generated on Mon, 07 Jul 2008 12:32:16 +0100 by phpDocumentor 1.4.0