the error is in your $ldapBase.
the base is just: "dc=sun,dc=com"
all the other stuff like ?sub? (objectclass=*) has nothign to do with the deafault search base (=$ldapbase).
my script is searching for a specific user ($ldapFilter in controller.php) below the $ldapBase in your ldap directory.
if you want to want to add an (objectclass=*) to your search filter you have to add that to line 29 in controller.php
Code:
$ldapFilter = "(uid=" . $vbulletin->GPC['vb_login_username'] .")";
you do not have to add ?sub? to your query, because phps ldapsearch scope defaults to SUB.
-fhs