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

Source for file LitePoA.php

Documentation is available at LitePoA.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.  * Class that embbeds all functionallity (authentication, attribute collection and authorization) in one method,
  28.  * just like older versions of phpPoA.
  29.  * 
  30.  * @package phpPoA2
  31.  * @deprecated This class is for backwards compatibility. Please avoid using it.
  32.  */
  33. class LitePoA extends AutoPoA {
  34.  
  35.     protected $handler;
  36.  
  37.     /**
  38.      * Set an attribute handler to build identifiers for the users
  39.      * according to their attributes. Method must receive a hash of
  40.      * attributes ("name" => "value").
  41.      * @param handler The name of the function.
  42.      */
  43.     public function setIDBuilder($handler{
  44.         $this->handler = $handler;
  45.     }
  46.  
  47.     /**
  48.      * A shortcut for the whole authentication and authorization process.
  49.      * User will be authenticated, his attributes collected and then he will
  50.      * be checked for authorization with the identifier built with the ID
  51.      * builder function.
  52.      * @return hash
  53.      * @deprecated This method is for backwards compatibility. Please avoid using it.
  54.      */
  55.     public function checkAccess({
  56.         $hash['authnStatus'$this->authenticate();
  57.         $hash['attributes'$this->getAttributes();
  58.         $hash['authzStatus'$this->isAuthorized(""$hash['attributes']);
  59.         return $hash;
  60.     }
  61. }
  62.  
  63.  
  64. ?>

Documentation generated on Mon, 20 Feb 2012 12:07:05 +0100 by phpDocumentor 1.4.3