openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

HttpAuth.class.php (710B)


      1 <?php
      2 
      3 /**
      4  * HTTP-Authentifzierung.
      5  * 
      6  * Das vom Benutzer eingegebene Kennwort wird gegen eine HTTP-Adresse
      7  * geprüft, bei der HTTP-Auth aktiviert ist.
      8  *  
      9  * @author Jan Dankert
     10  */
     11 class HttpAuth implements Auth
     12 {
     13 
     14 	/**
     15 	 * Dieses Loginmodul kann keinen Namen feststellen.
     16 	 */
     17 	public function username()
     18 	{
     19 		return null;
     20 	}
     21 	
     22 	
     23 	/**
     24 	 * Ueberpruefen des Kennwortes.
     25 	 *
     26 	 * Das Kennwort wird gegen einen HTTP-Server geprüft.
     27 	 */
     28 	public function login( $user, $password, $token )
     29 	{
     30 		global $conf;
     31 		
     32 		$http = new Http( $conf['security']['http']['url'] );
     33 		$http->method = 'HEAD';
     34 		$http->setBasicAuthentication( $this->name, $password );
     35 		
     36 		$ok = $http->request();
     37 		
     38 		return $ok;
     39 	}
     40 }
     41 
     42 ?>