phpPoA2
[ class tree: phpPoA2 ] [ index: phpPoA2 ] [ all elements ]

Source for file AuthenticationEngine.php

Documentation is available at AuthenticationEngine.php

  1. <?php
  2. /**
  3.  * @copyright Copyright 2005-2010 RedIRIS, http://www.rediris.es/
  4.  *
  5.  *  This file is part of phpPoA2.
  6.  *
  7.  *  phpPoA2 is free software: you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation, either version 3 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  phpPoA2 is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with phpPoA2. If not, see <http://www.gnu.org/licenses/>.
  19.  *
  20.  * @license http://www.gnu.org/licenses/gpl.html GNU General Public License
  21.  * @version 2.0
  22.  * @author Jaime Perez <jaime.perez@rediris.es>
  23.  * @filesource
  24.  */
  25.  
  26. /**
  27.  * Abstract authentication engine.
  28.  * @abstract
  29.  * @package phpPoA2
  30.  */
  31. abstract class AuthenticationEngine extends GenericEngine {
  32.  
  33.     protected $engine_type = "Authn";
  34.  
  35.     /**
  36.      * Trigger the authentication of the user in the current context. May perform
  37.      * HTTP redirections or any other procedure to gather the authentication status
  38.      * if the user, so don't expect it to return control once called.
  39.      * @return boolean AUTHN_SUCCESS (true) or AUTHN_FAILED (false).
  40.      */
  41.     public abstract function authenticate();
  42.  
  43.     /**
  44.      * Check the current authentication status withing this context. Does not
  45.      * trigger any authentication procedure.
  46.      * @return boolean AUTHN_SUCCESS (true) or AUTHN_FAILED (false).
  47.      */
  48.     public abstract function isAuthenticated();
  49.  
  50.     /**
  51.      * Get an associative array with the set of common attributes for the current
  52.      * user. May trigger some attribute recollection.
  53.      * @return array An associative array with all the attributes gathered by default.
  54.      */
  55.     public abstract function getAttributes();
  56.  
  57.     /**
  58.      * Get an specific attribute for the current user, by specifying its name and
  59.      * namespace. May trigger some attribute query procedure.
  60.      * @param name The name of the attribute.
  61.      * @param namespace The namespace of the attribute.
  62.      * @return string|arraythe value or an array of values for the required attribute, or false
  63.      *  if anything went wrong.
  64.      */
  65.     public abstract function getAttribute($name$namespace "");
  66.  
  67.     /**
  68.      * Perform a logout (locally or global).
  69.      * @param slo Whether to perform the logout globally (Single Log Out) or not. Defaults to local.
  70.      * @return void 
  71.      */
  72.     public abstract function logout($slo false);
  73.  
  74. }
  75.  
  76. ?>

Documentation generated on Wed, 13 Oct 2010 15:06:14 +0200 by phpDocumentor 1.4.3