cvs: php-hosts-web /include cvs-auth.inc
| From: | jim winstead | Date: | Tue, 23 Apr 2002 04:07:34 +0000 |
| Subject: | cvs: php-hosts-web /include cvs-auth.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-9801@lists.php.net to get a copy of this message | ||
jimw Tue Apr 23 00:07:34 2002 EDT
Added files:
/php-hosts-web/include cvs-auth.inc
Log:
code for authorizing against cvs passwords
Index: php-hosts-web/include/cvs-auth.inc
+++ php-hosts-web/include/cvs-auth.inc
<?php
/* $Id: cvs-auth.inc,v 1.1 2002/04/23 04:07:33 jimw Exp $ */
$ignore_password = false;
$passwd_file = "/repository/CVSROOT/passwd";
function find_password($user) {
global $passwd_file, $ignore_password;
if ($ignore_password) return " "; // can't be ""
$fp=fopen($passwd_file,"r");
while(!feof($fp)) {
$line=fgets($fp,120);
list($luser,$passwd,$junk) = explode(":",$line);
if($user==$luser) {
fclose($fp);
return($passwd);
}
}
fclose($fp);
return("");
}
function verify_password($user, $pass) {
global $ignore_password;
$psw = find_password($user);
if (strlen($psw) > 0) {
if ($ignore_password || crypt($pass,$psw) == $psw) {
return true;
}
}
return false;
}
?>