/[docman2]/htusers/file.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /htusers/file.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Sat Jul 20 13:01:48 2002 UTC (21 years, 10 months ago) by dpavlin
Branch: DbP
CVS Tags: alpha
Changes since 1.1: +0 -0 lines
initial import (not working)

1 <?
2
3 /*
4 Document manager handling for .htusers file
5
6 This file is included early in docman.php and it should return:
7 $gblUserName descriptive username
8 $secHash md5 hash of joint login and password
9 $gblEmail e-mail address of user
10
11 This module can use any back magic to find who the user
12 is, but I suggest $PHP_AUTH_USER and $PHP_AUTH_PW
13 */
14
15 $htusers_file="$fsRealmDir/$realm.htusers";
16 if (! file_exists($htusers_file)) {
17 Error("Can't find users file!","Please create users file <tt>$htusers_file</tt> by hand or using <tt>adduser.pl</tt> script! There is example in <tt>$gblIncDir/realm/localhost.htusers.dist</tt>.");
18 }
19 $htusers=fopen($htusers_file,"r");
20 while($user = fgetcsv($htusers,255,":")) {
21 if ($user[0] == $GLOBALS[gblLogin]) {
22 $gblUserName=$user[1];
23 $secHash=$user[2];
24 if (substr($secHash,0,5) == "auth_" && file_exists("$gblIncDir/$secHash.php")) {
25 include_once("$gblIncDir/$secHash.php");
26 if ($secHash($user)) {
27 $secHash=md5($GLOBALS[gblLogin].$GLOBALS[gblPasswd]);
28 } else {
29 $secHash="error".md5($GLOBALS[gblLogin].$GLOBALS[gblPasswd]);
30 }
31 }
32 $gblEmail=$user[3];
33 continue ;
34 }
35 }
36 fclose($htusers);
37
38 ?>

  ViewVC Help
Powered by ViewVC 1.1.26