Navigation Menu

Skip to content

Commit

Permalink
MDL-37315 fix connection reopening in ldap paging
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Dec 29, 2012
1 parent 322af44 commit e6a3c6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions enrol/ldap/lib.php
Expand Up @@ -653,7 +653,7 @@ protected function ldap_close() {
* @param object role is a record from the mdl_role table. * @param object role is a record from the mdl_role table.
* @return array * @return array
*/ */
protected function find_ext_enrolments ($ldapconnection, $memberuid, $role) { protected function find_ext_enrolments (&$ldapconnection, $memberuid, $role) {
global $CFG; global $CFG;
require_once($CFG->libdir.'/ldaplib.php'); require_once($CFG->libdir.'/ldaplib.php');


Expand Down Expand Up @@ -718,13 +718,13 @@ protected function find_ext_enrolments ($ldapconnection, $memberuid, $role) {
// Get all contexts and look for first matching user // Get all contexts and look for first matching user
$ldap_contexts = explode(';', $ldap_contexts); $ldap_contexts = explode(';', $ldap_contexts);
$ldap_pagedresults = ldap_paged_results_supported($this->get_config('ldap_version')); $ldap_pagedresults = ldap_paged_results_supported($this->get_config('ldap_version'));
$ldap_cookie = '';
foreach ($ldap_contexts as $context) { foreach ($ldap_contexts as $context) {
$context = trim($context); $context = trim($context);
if (empty($context)) { if (empty($context)) {
continue; continue;
} }


$ldap_cookie = '';
$flat_records = array(); $flat_records = array();
do { do {
if ($ldap_pagedresults) { if ($ldap_pagedresults) {
Expand Down

0 comments on commit e6a3c6e

Please sign in to comment.