/** * TODO: when PHP >= 5.3.0 will be used, rewrite this function * with __callStatic. * * Get all the LDAP entries the parameter attribute. * * @param $attr string * @param $query string * * @return array */ public static function getLdapEntriesBy($attr, $query) { $attr = strtolower($attr); if (is_null(sfConfig::get('app_profile_var_translation_' . $attr))) { throw new sfException('No profile_var_translation attribute : ' . $attr); } // We need to use uapvAuthPlugin here... $ldap = new uapvLdap(); return self::formatUsers($ldap->search(sfConfig::get('app_profile_var_translation_' . $attr) . "={$query}*"), 10); }
/** * Says if the given mail is present in the LDAP. */ private function isMailFromLdap($mail) { $ldap = new uapvLdap(); $tmp = $ldap->search("mail={$mail}"); return empty($tmp) ? false : true; }