Quantcast
Channel: Authentication
Viewing all articles
Browse latest Browse all 8256

Re: Auth LDAP + CAS sporadic bind error

$
0
0
by jasper boyd.  

In case this happens to anyone else I was able to fix this with the following lines in /auth/ldap/auth.php

in the ldap_connect method aprox. line 2040 (bolded parts are my additions):


function ldap_connect($tries = 0) {

        if(!empty($this->ldapconnection)) {
            $this->ldapconns++;
            return $this->ldapconnection;
        }

        if($ldapconnection = ldap_connect_moodle($this->config->host_url, $this->config->ldap_version,
                                                 $this->config->user_type, $this->config->bind_dn,
                                                 $this->config->bind_pw, $this->config->opt_deref,
                                                 $debuginfo, $this->config->start_tls)) {
            $this->ldapconns = 1;
            $this->ldapconnection = $ldapconnection;
            return $ldapconnection;

        } else {
                if($tries == 3){
                        print_error('auth_ldap_noconnect_all', 'auth_ldap', '', $debuginfo);
                } else {
                        ldap_connect($tries++);
                }
        }

    }




Viewing all articles
Browse latest Browse all 8256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>