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__);
376 if (!@ldap_mod_replace($this->con, $dn, ['userpassword' => $hash])) {
378 'LDAP mod replace failed: ' . hsc($dn) . ': ' . hsc(ldap_error($this->con)),
419 $sr = ldap_search($this->con, $this->getConf('usertree'), $all_filter);
420 $entries = ldap_get_entries($this->con, $sr);
545 if ($this->con) return true; // connection already established
559 $this->con = @ldap_connect($server);
561 $this->con = @ldap_connect($server, $port);
563 if (!$this->con) {
579 $this->con,
585 $this->debug('LDAP version set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
589 if (!@ldap_start_tls($this->con)) {
591 $this->debug('LDAP TLS set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
598 $this->con,
604 $this->debug('LDAP referal set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
612 if (!@ldap_set_option($this->con, LDAP_OPT_DEREF, $this->getConf('deref'))) {
614 $this->debug('LDAP deref set: ' . hsc(ldap_error($this->con)), 0, __LINE__, __FILE__);
619 ldap_set_option($this->con, LDAP_OPT_NETWORK_TIMEOUT, 1);
623 $bound = @ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')));
626 $bound = @ldap_bind($this->con);
635 $this->debug(ldap_error($this->con), 0, __LINE__, __FILE__);