index 4e0b82ac9720f30a3ec2ba65ca9f47290bcb9dbb..93686b6e63476d594db051f1edf22eb8e005d9ac 100644 (file)
var $referrals= array();
var $max_ldap_query_time = 0; // 0, empty or negative values will disable this check
+ var $re = NULL;
+
function LDAP($binddn,$bindpw, $hostname, $follow_referral= FALSE, $tls= FALSE)
{
global $config;
return(ereg_replace("[^,]*[,]*[ ]*(.*)", "\\1", $basedn));
}
+
+# /* Checks if there is still unfetched data
+# */
+# function checkResult()
+# {
+# /* Check if we have started a search before */
+# if($this->start != 0 && $this->re){
+#
+# /* Check if there are still unfetched elements */
+# if(is_resource(@ldap_next_entry($this->cid, $this->re))){
+# new log("debug","LDAP:: CAT/SEARCH/FETCH","A new search was initiated while an older search wasn't fetched completely.");
+# msg_dialog::display(_("Debug"),"A new search was initiated while an older search wasn't fetched completely.",ERROR_DIALOG);
+# trigger_error("A new search was initiated while an older search wasn't fetched completely.");
+# }
+# }
+# }
+#
function search($filter, $attrs= array())
{
if($this->hascon){
if ($this->reconnect) $this->connect();
+# /* Check if there are still unfetched objects from last search
+# */
+# $this->checkResult();
+
$start = microtime();
-
$this->clearResult();
$this->sr = @ldap_search($this->cid, LDAP::fix($this->basedn), $filter, $attrs);
$this->error = @ldap_error($this->cid);
{
if($this->hascon){
if ($this->reconnect) $this->connect();
+
+# /* Check if there are still unfetched objects from last search
+# */
+# $this->checkResult();
+
$this->clearResult();
if ($basedn == "")
$basedn = $this->basedn;
{
if($this->hascon){
if ($this->reconnect) $this->connect();
+
+# /* Check if there are still unfetched objects from last search
+# */
+# $this->checkResult();
+
$this->clearResult();
$filter = "(objectclass=*)";
$this->sr = @ldap_read($this->cid, LDAP::fix($dn), $filter,$attrs);