Skip to content

Commit f9b9e4c

Browse files
authored
Fix Psalm issues (#1)
1 parent 44c63c0 commit f9b9e4c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

lib/Auth/Process/AttributeAddUsersGroups.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace SimpleSAML\Module\ldap\Auth\Process;
44

5+
use SimpleSAML\Utils\Arrays;
56
use Webmozart\Assert\Assert;
67

78
/**
@@ -252,7 +253,7 @@ protected function search(array $memberof)
252253
$get_attributes = [$map['memberof'], $map['type']];
253254
if (isset($map['name']) && $map['name']) {
254255
$get_attributes[] = $map['name'];
255-
$use_group_name = false;
256+
$use_group_name = true;
256257
}
257258

258259
// Check each DN of the passed memberOf
@@ -319,7 +320,7 @@ protected function searchActiveDirectory($dn)
319320
' Member Attribute: '.$map['member'].
320321
' Type Attribute: '.$map['type'].
321322
' Type Value: '.$this->type_map['group'].
322-
' Base: '.implode('; ', $this->base_dn)
323+
' Base: '.implode('; ', Arrays::Arrayize($this->base_dn))
323324
);
324325

325326
// AD connections should have this set

lib/Auth/Process/BaseFilter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ abstract class BaseFilter extends \SimpleSAML\Auth\ProcessingFilter
4949
* Instance, object of the ldap connection. Stored here to
5050
* be access later during processing.
5151
*
52-
* @var \SimpleSAML\Auth\LDAP
52+
* @var \SimpleSAML\Auth\LDAP|null
5353
*/
54-
private $ldap;
54+
private $ldap = null;
5555

5656

5757
/**
@@ -249,6 +249,7 @@ public function __construct(&$config, $reserved)
249249
);
250250
}
251251

252+
252253
/**
253254
* Getter for the LDAP connection object. Created this getter
254255
* rather than setting in the constructor to avoid unnecessarily
@@ -294,6 +295,7 @@ protected function getLdap()
294295
return $this->ldap;
295296
}
296297

298+
297299
/**
298300
* Local utility function to get details about a variable,
299301
* basically converting it to a string to be used in a log

lib/ConfigHelper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,10 @@ public function login($username, $password, array $sasl_args = null)
206206
}
207207
}
208208

209+
/**
210+
* PHPdoc changed in SSP 1.18; Remove it after release
211+
* @var string|null $dn
212+
*/
209213
$dn = $ldap->searchfordn(
210214
$this->searchBase,
211215
$this->searchAttributes,
@@ -214,6 +218,7 @@ public function login($username, $password, array $sasl_args = null)
214218
$this->searchFilter,
215219
$this->searchScope
216220
);
221+
217222
if ($dn === null) {
218223
/* User not found with search. */
219224
\SimpleSAML\Logger::info($this->location.': Unable to find users DN. username=\''.$username.'\'');

0 commit comments

Comments
 (0)