Administration using PHP/ADSI

From: Date: Mon, 08 Jul 2002 19:48:31 +0000
Subject: Administration using PHP/ADSI
Groups: php.windows 
Request: Send a blank email to php-windows+get-14604@lists.php.net to get a copy of this message
I have written an intranet application that needs to be used by different types of users. However, I want to prevent some users from changing the data in the database. The server providing this application is running PHP 4.2 on IIS5. I would like to capture the error message cleanly and present a "You are not authorized to view this page" message based on Windows NT user ID or group membership. I use ADSI for other tasks and it is an obvious choice here as well. I just can't seem to get it to work properly. Here is a sample of what I am trying just to prove it can work: <?php $objDomain = new COM("WinNT://DomainName") or die("Cannot get DomainName object"); $objDomain->filter = array("group"); foreach($objDomain as $group){ print $group->name."<br>\n"; } print "\nDomainName Group enum complete<br>\n"; ?> The output of this script is just the final print statement. It appears to get the object fine. Any help would be appreciated. Bill -- "It is not what name others call you that matters, but what name you respond to that truly determines who you are." - Old Swahili saying

« previous php.windows (#14604) next »