php-windows Digest 8 Mar 2006 22:30:20 -0000 Issue 2907
Topics (messages 26746 through 26747):
Re: Installing GPG
26746 by: Rudi Starcevic
LDAP newb gets errors against 2003 AD
26747 by: Aaron Kenney
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
php-windows@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Mark,
> Has anyone out there installed and is using GPG on your windows box?
Yes .. I use GnuPG on Debian Linux and Windows XP
> How'd it go?
Sweet as ....
> Any "gotchas" that I should know about?
Nope ... Not only does it feel exactly the same on either
windows or linux from the command line but you can also
easily copy the .gpg files between machines if needed.
I use Mozzila suite for www and email.
There's a great email gpg plugin: Enigmail, that
works just the same on both Windows XP and my Gnome desktop.
HTH.
Cheers,
Rudi.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3-nr1 (Windows XP)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEDiX6gOUisCetzRYRAqVMAJ9XUR0bPfrbxZR8+hZa7DsJzRNzvgCeK0wi
yiunjIecA/5XmnjLBJ7e3gQ=
=Mamw
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
So here is the offending code:
--------------------------------------------------
<?PHP
$ldaprdn = '[EMAIL PROTECTED]';
$ldappass = 'PWD';
$ds = 'server.domain.net';
$dn = 'dc=domain,dc=net';
$ldapport = 389;
$ldapconn = ldap_connect($ds, $ldapport)
or die("Could not connect to LDAP server.");
if ($ldapconn)
{
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
if ($ldapbind)
{
echo "LDAP bind successful...";
$filter = "'cn=*Kenney*'";
$fields = array("ou", "mail");
$sr = ldap_search($ds, $dn, $filter, $fields);
$info = ldap_get_entries($ds, $sr);
for ($i=0; $i<$info["count"]; $i++)
{
echo "<br>";
echo "ou: " . $info[$i]["ou"][0];
echo "mail: " . $info[$i]["mail"][0];
}
}
else
{
echo "LDAP bind failed...";
}
}
ldap_close($ldapconn);
?>
----------------------------------------------
Here is the result:
-------------------------------------
LDAP bind successful...
Warning: ldap_search(): supplied argument is not a valid ldap link
resource in e:\intertest\test.php on line 20
Warning: ldap_get_entries(): supplied argument is not a valid ldap
link resource in e:\intertest\test.php on line 22
------------------------------------------
I know I'm just misusing the ldap_search() function or something, so
please, someone set me straight here.
--- End Message ---