Source for file Authentication.php

Documentation is available at Authentication.php

  1. <?php
  2. /** 
  3.  * @author Dirk Merkel <dirk@waferthin.com>
  4.  * @package WebServices
  5.  * @subpackage Authentication
  6.  * @copyright Waferthin Web Works LLC
  7.  * @license http://www.gnu.org/copyleft/gpl.html Freely available under GPL
  8.  */
  9. /** 
  10.  * <i>Authentication</i> handles user account info and login actions
  11.  * 
  12.  * This is an abstract class that serves as a blueprint
  13.  * for classes implementing authentication using
  14.  * different account validation schemes.
  15.  *
  16.  * @see Authentication_HardcodedAccounts
  17.  * @author Dirk Merkel <dirk@waferthin.com>
  18.  * @package WebServices
  19.  * @subpackage Authentication
  20.  * @version 0.5
  21.  * @since r5
  22.  */
  23. abstract class Authentication implements Accountable
  24. {
  25.     /**
  26.      * Reference to Account object of currently
  27.      * logged in user.
  28.      *
  29.      * @access private
  30.      * @var Account 
  31.      */
  32.     private $account null;
  33.     
  34.     /**
  35.      * Returns account object if valid.
  36.      *
  37.      * @see Accountable::getAccount()
  38.      * @access public
  39.      * @param string $user user account login
  40.      * @return Account user account
  41.      */
  42.     public function getAccount($user '')
  43.     {
  44.         if ($this->account !== null{
  45.             return $this->account;
  46.         else {
  47.             return AUTHENTICATION_ERR_MSG;
  48.         }
  49.     }
  50.     
  51.     /**
  52.      * isLoggedIn method
  53.      *
  54.      * Says whether the current user has provided
  55.      * valid login credentials.
  56.      *
  57.      * @see Accountable::isLoggedIn()
  58.      * @access public
  59.      * @return boolean 
  60.      */
  61.     public function isLoggedIn()
  62.     {
  63.         return ($this->account !== null);
  64.     }
  65.     
  66.     /**
  67.      * login method
  68.      *
  69.      * Abstract method that must be implemented when
  70.      * sub-classing this class.
  71.      *
  72.      * @access public
  73.      * @return boolean 
  74.      */
  75.     abstract public function login($user$password);
  76. }
  77.  
  78. ?>

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