Re: Administration using PHP/ADSI

From: Date: Tue, 09 Jul 2002 04:48:09 +0000
Subject: Re: Administration using PHP/ADSI
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-14617@lists.php.net to get a copy of this message
Hello, On 07/08/2002 04:48 PM, Bill Rucker wrote:
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.
I don't know if you are aware of it, but there is a book on PHP programming for Windows that has a whole chapter on Active Directory. It also shows how to make queries with PHP LDAP functions besides using COM objects. You may want to take a look at a review of the book here: http://www.phpclasses.org/products.html/id/0735711690.html -- Regards, Manuel Lemos

« previous php.windows (#14617) next »