cvs: pear /HTTP_Auth HTTP_Auth.php package.xml

From: Date: Thu, 23 Aug 2001 18:39:17 +0000
Subject: cvs: pear /HTTP_Auth HTTP_Auth.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-629@lists.php.net to get a copy of this message
mj Thu Aug 23 14:39:17 2001 EDT Added files: /pear/HTTP_Auth HTTP_Auth.php package.xml Log: * Added PEAR::HTTP_Auth (HTTP Authentication based on PEAR::Auth) # Next step will be writing a proper documentation for PEAR::Auth # and PEAR::HTTP_Auth Index: pear/HTTP_Auth/HTTP_Auth.php +++ pear/HTTP_Auth/HTTP_Auth.php <?php // // +----------------------------------------------------------------------+ // | PHP version 4.0 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2001 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Authors: Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // // $Id: HTTP_Auth.php,v 1.1 2001/08/23 18:39:16 mj Exp $ // require_once "Auth/Auth.php"; /** * PEAR::HTTP_Auth * * The PEAR::Auth class provides methods for creating an * HTTP authentication system using PHP. * * @author Martin Jansen <mj@php.net> * @package HTTP_Auth * @extends Auth * @version $Revision: 1.1 $ * @todo Clean up PHPDoc comments */ class HTTP_Auth extends Auth { /** * Name of the realm * * @var string * @see draw_login() */ var $realm = "protected area"; /** * Text to send if user hits cancel button * * @var string * @see draw_login() */ var $CancelText = "invalid login data"; function assign_data() { global $PHP_AUTH_USER,$PHP_AUTH_PW; if ($PHP_AUTH_USER != "") { $this->username = $PHP_AUTH_USER; } if ($PHP_AUTH_PW != "") { $this->password = $PHP_AUTH_PW; } } /** * Launch the login box * * @param string $username Username * @param string $password Password */ function draw_login($username = "", $password = "") { Header("WWW-Authenticate: Basic realm=\"".$this->realm."\""); Header("HTTP/1.0 401 Unauthorized"); echo $this->CancelText; exit; } /** * Set name of the current realm * * @access public * @param string $name Name of the realm */ function setRealm($name) { $this->realm = $name; } /** * Set the text to send if user hits the cancel button * * @access public * @param string $text Text to send */ function setCancelText($text) { $this->CancelText = $text; } } ?> Index: pear/HTTP_Auth/package.xml +++ pear/HTTP_Auth/package.xml <?xml version="1.0" encoding="ISO-8859-1" ?> <!-- do not use the "Type" attribute here, that one is only for generated package.xml files --> <Package> <Name>Auth</Name> <Summary>The PEAR::HTTP_Auth class provides methods for creating an HTTP authentication system using PHP.</Summary> <Maintainer> <Initials>MJ</Initials> <Name>Martin Jansen</Name> <Email>mj@php.net</Email> </Maintainer> <Release> <Version>1.0</Version> <Date>2001-08-23</Date> <Notes> This is the initial independent release of the HTTP_Auth package. </Notes> </Release> <FileList> <Dir Name="/" BaseInstallDir="HTTP_Auth"> <File Role="php">HTTP_Auth.php</File> </Dir> </FileList> </Package>

« previous php.pear.cvs (#629) next »