I was browsing the PHPBuilder.com discussion forums and noticed a reference
to userserver a NT services that has a php include file that will allow you
to develop PHP applications that uses NT security to control access to various
functions...
I down loaded it and configured it...
BTW: I had a hard time finding it, so you can download
it from here ...
Wrote some code and came up with this login system....
< ?php
require_once('rptvariables.php');
require_once('users.php');
// GetUserList();
if($submit) {
$checkpw = CheckPassword($user, $password);
$group1 = "Domain Admins";
$group2 = "SITE_DEVELOPMENT_USRS";
$checkgrp1 = IsUserInGroup2($user, $group1);
$checkgrp2 = IsUserInGroup2($user, $group2);
$erealname = GetFullName($user);
if(!$checkpw == 0) {
if((!$checkgrp1 == 0) || (!$checkgrp2 == 0)) {
session_register("LOGGEDIN");
session_register("realname");
$LOGGEDIN = "$user";
$realname = "$erealname";
header ("Location: $rptpage");
exit;
} else {
print "YOU'RE NOT a memeber of the Required Group to access resources";
print "< br> You MUST BE a member of " . $group;
exit;
}
} else {
print "BAD USERID and/or PASSWORD";
exit;
}
} else {
print< << LOGINFORM
< center>
< P>
< FONT COLOR=red SIZE=+2>
You have connected to a Private Networked Web Application.< br>
From: < font color=blue> $_connectedfrom < /font>
Date: < font color=blue> $today < /font>
< BR>
AUTHORIZED Users are ONLY ALLOWED access.< br>
IF YOU ARE NOT AUTHORIZED TO LOGIN< br>
Please Disconnect ...
< /FONT>
< P>
< FORM ACTION=$PHP_SELF METHOD=post>
< table>
< tr> < td> USERID: < /td> < td> < INPUT TYPE=text NAME=user> <
/td> < /tr>
< tr> < td> PASSWD: < /td> < td> < INPUT TYPE=password
NAME=password> < /td> < /tr>
< tr> < td colspan=2> < INPUT TYPE=submit NAME=submit VALUE=LOGIN> < /td>
< /tr>
< /table>
< /FORM>
< /center>
LOGINFORM;
}
?>
>> Comments/FeedBack
|