@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | throw new \Exception('Internal error: Invalid object type', 500); |
118 | 118 | } |
119 | 119 | |
120 | - return (int)$result; |
|
120 | + return (int) $result; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | public function countGroups() { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | $filter = $this->access->combineFilterWithAnd([ |
208 | 208 | $this->configuration->ldapUserFilter, |
209 | - $attr . '=*' |
|
209 | + $attr.'=*' |
|
210 | 210 | ]); |
211 | 211 | |
212 | 212 | $limit = ($existsCheck === false) ? null : 1; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | if ($attr !== '' && $attr !== 'displayName') { |
234 | 234 | // most likely not the default value with upper case N, |
235 | 235 | // verify it still produces a result |
236 | - $count = (int)$this->countUsersWithAttribute($attr, true); |
|
236 | + $count = (int) $this->countUsersWithAttribute($attr, true); |
|
237 | 237 | if ($count > 0) { |
238 | 238 | //no change, but we sent it back to make sure the user interface |
239 | 239 | //is still correct, even if the ajax call was cancelled meanwhile |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | // first attribute that has at least one result wins |
246 | 246 | $displayNameAttrs = ['displayname', 'cn']; |
247 | 247 | foreach ($displayNameAttrs as $attr) { |
248 | - $count = (int)$this->countUsersWithAttribute($attr, true); |
|
248 | + $count = (int) $this->countUsersWithAttribute($attr, true); |
|
249 | 249 | |
250 | 250 | if ($count > 0) { |
251 | 251 | $this->applyFind('ldap_display_name', $attr); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $attr = $this->configuration->ldapEmailAttribute; |
275 | 275 | if ($attr !== '') { |
276 | - $count = (int)$this->countUsersWithAttribute($attr, true); |
|
276 | + $count = (int) $this->countUsersWithAttribute($attr, true); |
|
277 | 277 | if ($count > 0) { |
278 | 278 | return false; |
279 | 279 | } |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | $p = $setting['port']; |
680 | 680 | $t = $setting['tls']; |
681 | 681 | $this->logger->debug( |
682 | - 'Wiz: trying port '. $p . ', TLS '. $t, |
|
682 | + 'Wiz: trying port '.$p.', TLS '.$t, |
|
683 | 683 | ['app' => 'user_ldap'] |
684 | 684 | ); |
685 | 685 | //connectAndBind may throw Exception, it needs to be catched by the |
@@ -701,11 +701,11 @@ discard block |
||
701 | 701 | if ($settingsFound === true) { |
702 | 702 | $config = [ |
703 | 703 | 'ldapPort' => $p, |
704 | - 'ldapTLS' => (int)$t |
|
704 | + 'ldapTLS' => (int) $t |
|
705 | 705 | ]; |
706 | 706 | $this->configuration->setConfiguration($config); |
707 | 707 | $this->logger->debug( |
708 | - 'Wiz: detected Port ' . $p, |
|
708 | + 'Wiz: detected Port '.$p, |
|
709 | 709 | ['app' => 'user_ldap'] |
710 | 710 | ); |
711 | 711 | $this->result->addChange('ldap_port', $p); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | |
751 | 751 | $dparts = explode('.', $domain); |
752 | 752 | while (count($dparts) > 0) { |
753 | - $base2 = 'dc=' . implode(',dc=', $dparts); |
|
753 | + $base2 = 'dc='.implode(',dc=', $dparts); |
|
754 | 754 | if ($base !== $base2 && $this->testBaseDN($base2)) { |
755 | 755 | $this->applyFind('ldap_base', $base2); |
756 | 756 | return $this->result; |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | if (is_array($objcs) && count($objcs) > 0) { |
902 | 902 | $filter .= '(|'; |
903 | 903 | foreach ($objcs as $objc) { |
904 | - $filter .= '(objectclass=' . $objc . ')'; |
|
904 | + $filter .= '(objectclass='.$objc.')'; |
|
905 | 905 | } |
906 | 906 | $filter .= ')'; |
907 | 907 | $parts++; |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | } |
918 | 918 | $base = $this->configuration->ldapBase[0]; |
919 | 919 | foreach ($cns as $cn) { |
920 | - $rr = $this->ldap->search($cr, $base, 'cn=' . $cn, ['dn', 'primaryGroupToken']); |
|
920 | + $rr = $this->ldap->search($cr, $base, 'cn='.$cn, ['dn', 'primaryGroupToken']); |
|
921 | 921 | if (!$this->ldap->isResource($rr)) { |
922 | 922 | continue; |
923 | 923 | } |
@@ -927,11 +927,11 @@ discard block |
||
927 | 927 | if ($dn === false || $dn === '') { |
928 | 928 | continue; |
929 | 929 | } |
930 | - $filterPart = '(memberof=' . $dn . ')'; |
|
930 | + $filterPart = '(memberof='.$dn.')'; |
|
931 | 931 | if (isset($attrs['primaryGroupToken'])) { |
932 | 932 | $pgt = $attrs['primaryGroupToken'][0]; |
933 | - $primaryFilterPart = '(primaryGroupID=' . $pgt .')'; |
|
934 | - $filterPart = '(|' . $filterPart . $primaryFilterPart . ')'; |
|
933 | + $primaryFilterPart = '(primaryGroupID='.$pgt.')'; |
|
934 | + $filterPart = '(|'.$filterPart.$primaryFilterPart.')'; |
|
935 | 935 | } |
936 | 936 | $filter .= $filterPart; |
937 | 937 | } |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | } |
942 | 942 | //wrap parts in AND condition |
943 | 943 | if ($parts > 1) { |
944 | - $filter = '(&' . $filter . ')'; |
|
944 | + $filter = '(&'.$filter.')'; |
|
945 | 945 | } |
946 | 946 | if ($filter === '') { |
947 | 947 | $filter = '(objectclass=*)'; |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | if (is_array($objcs) && count($objcs) > 0) { |
955 | 955 | $filter .= '(|'; |
956 | 956 | foreach ($objcs as $objc) { |
957 | - $filter .= '(objectclass=' . $objc . ')'; |
|
957 | + $filter .= '(objectclass='.$objc.')'; |
|
958 | 958 | } |
959 | 959 | $filter .= ')'; |
960 | 960 | $parts++; |
@@ -964,14 +964,14 @@ discard block |
||
964 | 964 | if (is_array($cns) && count($cns) > 0) { |
965 | 965 | $filter .= '(|'; |
966 | 966 | foreach ($cns as $cn) { |
967 | - $filter .= '(cn=' . $cn . ')'; |
|
967 | + $filter .= '(cn='.$cn.')'; |
|
968 | 968 | } |
969 | 969 | $filter .= ')'; |
970 | 970 | } |
971 | 971 | $parts++; |
972 | 972 | //wrap parts in AND condition |
973 | 973 | if ($parts > 1) { |
974 | - $filter = '(&' . $filter . ')'; |
|
974 | + $filter = '(&'.$filter.')'; |
|
975 | 975 | } |
976 | 976 | break; |
977 | 977 | |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | $attr = 'cn'; |
995 | 995 | } |
996 | 996 | if ($attr !== '') { |
997 | - $filterUsername = '(' . $attr . $loginpart . ')'; |
|
997 | + $filterUsername = '('.$attr.$loginpart.')'; |
|
998 | 998 | $parts++; |
999 | 999 | } |
1000 | 1000 | } |
@@ -1010,7 +1010,7 @@ discard block |
||
1010 | 1010 | if (is_array($attrsToFilter) && count($attrsToFilter) > 0) { |
1011 | 1011 | $filterAttributes = '(|'; |
1012 | 1012 | foreach ($attrsToFilter as $attribute) { |
1013 | - $filterAttributes .= '(' . $attribute . $loginpart . ')'; |
|
1013 | + $filterAttributes .= '('.$attribute.$loginpart.')'; |
|
1014 | 1014 | } |
1015 | 1015 | $filterAttributes .= ')'; |
1016 | 1016 | $parts++; |
@@ -1095,7 +1095,7 @@ discard block |
||
1095 | 1095 | if ($login === true) { |
1096 | 1096 | $this->ldap->unbind($cr); |
1097 | 1097 | $this->logger->debug( |
1098 | - 'Wiz: Bind successful to Port '. $port . ' TLS ' . (int)$tls, |
|
1098 | + 'Wiz: Bind successful to Port '.$port.' TLS '.(int) $tls, |
|
1099 | 1099 | ['app' => 'user_ldap'] |
1100 | 1100 | ); |
1101 | 1101 | return true; |
@@ -1354,7 +1354,7 @@ discard block |
||
1354 | 1354 | //636 ← LDAPS / SSL |
1355 | 1355 | //7xxx ← UCS. need to be checked first, because both ports may be open |
1356 | 1356 | $host = $this->configuration->ldapHost; |
1357 | - $port = (int)$this->configuration->ldapPort; |
|
1357 | + $port = (int) $this->configuration->ldapPort; |
|
1358 | 1358 | $portSettings = []; |
1359 | 1359 | |
1360 | 1360 | //In case the port is already provided, we will check this first |