/**
* Connection Test Function
*/
function wpmuLdapTestConnection()
{
    $server = new LDAP_ro(wpmuSetupLdapOptions());
    $server->DebugOff();
    $result = $server->testConnect();
    $server->Disconnect();
    return $result;
}
/**
 * Searches the LDAP directory for the specified user
 */
function wpmuLdapSearch($ldapString = array(), $in_username, &$userDataArray)
{
    $server = new LDAP_ro($ldapString);
    $server->DebugOff();
    $attributes_to_get = array(get_site_option('ldapAttributeMail', LDAP_DEFAULT_ATTRIBUTE_MAIL), get_site_option('ldapAttributeGivenname', LDAP_DEFAULT_ATTRIBUTE_GIVENNAME), get_site_option('ldapAttributeSn', LDAP_DEFAULT_ATTRIBUTE_SN), get_site_option('ldapAttributePhone', LDAP_DEFAULT_ATTRIBUTE_PHONE));
    $userDataArray = null;
    if ($server->DoSearchUsername($in_username, $attributes_to_get, $userDataArray) == LDAP_OK) {
        return true;
    }
    return false;
}