Lines Matching defs:con
17 /* @var resource $con holds the LDAP connection */
18 protected $con;
68 if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))) {
69 $this->debug('LDAP bind as superuser: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
89 } elseif (!@ldap_bind($this->con)) {
92 $this->debug('LDAP anonymous bind: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
99 if (!@ldap_bind($this->con, $dn, $pass)) {
101 $this->debug('LDAP user dn bind: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
116 if (!@ldap_bind($this->con, $dn, $pass)) {
118 $this->debug('LDAP user bind: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
172 if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))) {
173 $this->debug('LDAP bind as superuser: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
206 $sr = $this->ldapSearch($this->con, $base, $filter, $this->getConf('userscope'), $this->getConf('attributes'));
207 $this->debug('LDAP user search: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
213 $result = @ldap_get_entries($this->con, $sr);
277 $this->con,
283 $this->debug('LDAP group search: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
290 $result = ldap_get_entries($this->con, $sr);
328 $this->debug('LDAP cannot connect: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
347 if (!@ldap_bind($this->con, $dn, $pass)) {
349 'LDAP user bind failed: ' . hsc($dn) . ': ' . hsc(ldap_error($this->con)),
359 if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))) {
360 $this->debug('LDAP bind as superuser: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
372 if (!@ldap_mod_replace($this->con, $dn, ['userpassword' => $hash])) {
374 'LDAP mod replace failed: ' . hsc($dn) . ': ' . hsc(ldap_error($this->con)),
415 $sr = ldap_search($this->con, $this->getConf('usertree'), $all_filter);
416 $entries = ldap_get_entries($this->con, $sr);
541 if ($this->con) return true; // connection already established
555 $this->con = @ldap_connect($server);
557 $this->con = @ldap_connect($server, $port);
559 if (!$this->con) {
575 $this->con,
581 $this->debug('LDAP version set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
585 if (!@ldap_start_tls($this->con)) {
587 $this->debug('LDAP TLS set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
594 $this->con,
600 $this->debug('LDAP referal set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
608 if (!@ldap_set_option($this->con, LDAP_OPT_DEREF, $this->getConf('deref'))) {
610 $this->debug('LDAP deref set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
615 ldap_set_option($this->con, LDAP_OPT_NETWORK_TIMEOUT, 1);
619 $bound = @ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')));
622 $bound = @ldap_bind($this->con);
631 $this->debug(ldap_error($this->con), 0, __LINE__, __FILE__);