Lines Matching full:if

37         if (!function_exists('ldap_connect')) {
50 * Checks if the given user exists and the given
62 if (empty($pass)) return false;
63 if (!$this->openLDAP()) return false;
66 if ($this->getConf('binddn') && $this->getConf('bindpw')) {
68if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))…
96 // Try to bind to with the dn if we have one.
97 if (!empty($dn)) {
99 if (!@ldap_bind($this->con, $dn, $pass)) {
107 // See if we can find the user
109 if (empty($info['dn'])) {
116 if (!@ldap_bind($this->con, $dn, $pass)) {
161 * @param bool $inbind authldap specific, true if in bind phase
167 if (!$this->openLDAP()) return [];
169 // force superuser bind if wanted and not bound as superuser yet
170 if ($this->getConf('binddn') && $this->getConf('bindpw') && $this->bound < 2) {
172if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))…
182 if ($loginuser && $loginpass) {
197 if ($this->getConf('userfilter')) {
208 if ($sr === false) {
215 // if result is not an array
216 if (!is_array($result)) {
223 if ($result['count'] != 1) {
248 // overwrite if other attribs are specified.
249 if (is_array($this->getConf('mapping'))) {
251 if (is_array($key)) {
256if (is_array($user_result[$key] ?? null)) foreach ($user_result[$key] as $grpkey => $grp) {
257 if ($grpkey !== 'count' && preg_match($regexp, $grp, $match)) {
258 if ($localkey == 'grps') {
272 //get groups for given user if grouptree is given
273 if ($this->getConf('grouptree') || $this->getConf('groupfilter')) {
286 if (!$sr) {
293 if (is_array($result)) foreach ($result as $grp) {
294 if (!empty($grp[$this->getConf('groupkey')])) {
296 if (is_array($group)) {
301 if ($group === '') continue;
310 if (!$info['grps'] || !in_array($conf['defaultgroup'], $info['grps'])) {
327 if (!$this->openLDAP()) {
334 if (empty($info['dn'])) {
342 if ($loginuser !== null) { // the user is currently logged in
347 if (!@ldap_bind($this->con, $dn, $pass)) {
359if (!@ldap_bind($this->con, $this->getConf('binddn'), conf_decodeString($this->getConf('bindpw')))…
368 if ($this->getConf('modPassPlain')) {
376 if (!@ldap_mod_replace($this->con, $dn, ['userpassword' => $hash])) {
410 if (!$this->openLDAP()) return [];
412 if (is_null($this->users)) {
414 if ($this->getConf('userfilter')) {
428 if (!$result) return [];
437 if ($i++ < $start) {
440 if ($info === false) {
443 if ($this->filter($user, $info)) {
445 if (($limit > 0) && (++$count >= $limit)) break;
467 //take first element if array
468 if (is_array($placeholders[$match])) {
480 * return true if $user + $info match $filter criteria, false otherwise
491 if ($item == 'user') {
492 if (!preg_match($pattern, $user)) return false;
494 if (!count(preg_grep($pattern, $info['grps']))) return false;
545 if ($this->con) return true; // connection already established
547 if ($this->getConf('debug')) {
558 if (str_starts_with($server, 'ldap://') || str_starts_with($server, 'ldaps://')) {
563 if (!$this->con) {
576 if ($this->getConf('version')) {
577 if (
588 if ($this->getConf('starttls')) {
589 if (!@ldap_start_tls($this->con)) {
595 if ($this->getConf('referrals') > -1) {
596 if (
611 if ($this->getConf('deref')) {
612 if (!@ldap_set_option($this->con, LDAP_OPT_DEREF, $this->getConf('deref'))) {
618 if (defined('LDAP_OPT_NETWORK_TIMEOUT')) {
622 if ($this->getConf('binddn') && $this->getConf('bindpw')) {
628 if ($bound) {
633 if (!$bound) {
665 if (is_null($attributes)) $attributes = [];
667 if ($scope == 'base') {
708 if (!$this->getConf('debug')) return;