Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3.  * Bootstrap file
  4.  *
  5.  * This is the form handler for the login application.
  6.  * It expects a user name and password via _POST. If
  7.  *
  8.  * @author Dirk Merkel <dirk@waferthin.com>
  9.  * @package WebServices
  10.  * @copyright Waferthin Web Works LLC
  11.  * @license http://www.gnu.org/copyleft/gpl.html Freely available under GPL
  12.  * @version 0.7
  13.  * @since r2
  14.  * @mytag mytag description http://waferthin.com
  15.  */
  16. /**
  17.  * required class files and interfaces
  18.  */
  19. require_once('classes/Accountable.php');
  20. require_once('classes/Authentication.php');
  21. require_once('classes/Users.php');
  22. require_once('classes/Authentication/HardcodedAccounts.php');
  23.  
  24. $authenticator new Authentication_HardcodedAccounts();
  25.  
  26. // uncomment for testing
  27. $_POST['user''dirk';
  28. $_POST['password''myPass';
  29.  
  30. if (isset($_POST['user']&& isset($_POST['password'])) {
  31.  
  32.     $loginSucceeded $authenticator->login($_POST['user']$_POST['password']);
  33.  
  34.     if ($loginSucceeded === true{
  35.         echo "Congrats - you're in!\n";
  36.     else {
  37.         echo "Uh-uh - try again!\n";
  38.     }
  39. }
  40.  
  41. ?>

Documentation generated on Mon, 26 Jul 2010 22:07:04 +0100 by phpDocumentor 1.4.3