From afa23468e9f79c2081fa1f6d65a3ba801fdafb15 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 9 Nov 2012 14:38:32 +0800 Subject: [PATCH] MDL-36119 - enrol_ldap: fix php error --- enrol/ldap/lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enrol/ldap/lib.php b/enrol/ldap/lib.php index 6bef55a018c..31224de2c4b 100644 --- a/enrol/ldap/lib.php +++ b/enrol/ldap/lib.php @@ -341,6 +341,7 @@ class enrol_ldap_plugin extends enrol_plugin { continue; // Next; } + $flat_records = array(); do { if ($ldap_pagedresults) { ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie); @@ -371,7 +372,6 @@ class enrol_ldap_plugin extends enrol_plugin { $records = ldap_get_entries($ldapconnection, $ldap_result); // LDAP libraries return an odd array, really. fix it: - $flat_records = array(); for ($c = 0; $c < $records['count']; $c++) { array_push($flat_records, $records[$c]); } @@ -725,6 +725,7 @@ class enrol_ldap_plugin extends enrol_plugin { continue; } + $flat_records = array(); do { if ($ldap_pagedresults) { ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie); @@ -758,7 +759,6 @@ class enrol_ldap_plugin extends enrol_plugin { $records = ldap_get_entries($ldapconnection, $ldap_result); // LDAP libraries return an odd array, really. Fix it. - $flat_records = array(); for ($c = 0; $c < $records['count']; $c++) { array_push($flat_records, $records[$c]); }