12 |
is, but I suggest $PHP_AUTH_USER and $PHP_AUTH_PW |
is, but I suggest $PHP_AUTH_USER and $PHP_AUTH_PW |
13 |
*/ |
*/ |
14 |
|
|
15 |
$htusers_file="$fsRealmDir/$realm.htusers"; |
$htusers_file=$fsRealmDir."/".$realm.$realm_sep."htusers"; |
16 |
if (! file_exists($htusers_file)) { |
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>."); |
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"); |
$htusers=fopen($htusers_file,"r"); |
20 |
while($user = fgetcsv($htusers,255,":")) { |
while($user = fgetcsv($htusers,255,":")) { |
21 |
if ($user[0] == $GLOBALS[gblLogin]) { |
if ($user[0] == $GLOBALS["gblLogin"]) { |
22 |
$gblUserName=$user[1]; |
$gblUserName=$user[1]; |
23 |
$secHash=$user[2]; |
$secHash=$user[2]; |
24 |
if (substr($secHash,0,5) == "auth_" && file_exists("$gblIncDir/$secHash.php")) { |
if (substr($secHash,0,5) == "auth_") { |
25 |
include_once("$gblIncDir/$secHash.php"); |
|
26 |
if ($secHash($user)) { |
$auth_include = str_replace("auth_","auth/","$gblIncDir/$secHash.php"); |
27 |
$secHash=md5($GLOBALS[gblLogin].$GLOBALS[gblPasswd]); |
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 { |
} else { |
35 |
$secHash="error".md5($GLOBALS[gblLogin].$GLOBALS[gblPasswd]); |
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]; |
$gblEmail=$user[3]; |