/[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.4 - (show annotations)
Wed Apr 9 15:42:36 2003 UTC (21 years ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +11 -5 lines
fix include of auth/*.php modules

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.$realm_sep."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_") {
25
26 $auth_include = str_replace("auth_","auth/","$gblIncDir/$secHash.php");
27 if (file_exists($auth_include)) {
28 include_once($auth_include);
29 if ($secHash($user)) {
30 $secHash=md5($GLOBALS["gblLogin"].$GLOBALS["gblPasswd"]);
31 } else {
32 $secHash="error".md5($GLOBALS["gblLogin"].$GLOBALS["gblPasswd"]);
33 }
34 } else {
35 Error("Can't find authorisation file","Can't file include file <tt>$auth_include</tt> needed for authorisation. Is <tt>docman</tt> installed correctly?");
36 }
37 }
38 $gblEmail=$user[3];
39 continue ;
40 }
41 }
42 fclose($htusers);
43
44 ?>

  ViewVC Help
Powered by ViewVC 1.1.26