MDL-36119 - enrol_ldap: fix php error

This commit is contained in:
Dan Poltawski
2012-11-09 14:38:32 +08:00
parent 6c4e886426
commit afa23468e9

View File

@@ -341,6 +341,7 @@ class enrol_ldap_plugin extends enrol_plugin {
continue; // Next; continue; // Next;
} }
$flat_records = array();
do { do {
if ($ldap_pagedresults) { if ($ldap_pagedresults) {
ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie); 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); $records = ldap_get_entries($ldapconnection, $ldap_result);
// LDAP libraries return an odd array, really. fix it: // LDAP libraries return an odd array, really. fix it:
$flat_records = array();
for ($c = 0; $c < $records['count']; $c++) { for ($c = 0; $c < $records['count']; $c++) {
array_push($flat_records, $records[$c]); array_push($flat_records, $records[$c]);
} }
@@ -725,6 +725,7 @@ class enrol_ldap_plugin extends enrol_plugin {
continue; continue;
} }
$flat_records = array();
do { do {
if ($ldap_pagedresults) { if ($ldap_pagedresults) {
ldap_control_paged_result($ldapconnection, $this->config->pagesize, true, $ldap_cookie); 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); $records = ldap_get_entries($ldapconnection, $ldap_result);
// LDAP libraries return an odd array, really. Fix it. // LDAP libraries return an odd array, really. Fix it.
$flat_records = array();
for ($c = 0; $c < $records['count']; $c++) { for ($c = 0; $c < $records['count']; $c++) {
array_push($flat_records, $records[$c]); array_push($flat_records, $records[$c]);
} }