Skip to content

Commit

Permalink
MNT Remove TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Oct 11, 2023
1 parent df528fe commit 7491c55
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/Iterators/LDAPIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ private function fetchPagedResult(): bool
$resultResource = ldap_search($resource, $baseDn ?? '', $this->getFilter() ?? '');
}
if (! is_resource($resultResource)) {
/*
* @TODO better exception msg
*/
throw new \Exception('ldap_search returned something wrong...' . ldap_error($resource));
throw new \Exception('ldap_search returned a non-resource type value' . ldap_error($resource));
}

$entries = ldap_get_entries($resource, $resultResource);
Expand Down
3 changes: 0 additions & 3 deletions src/Model/LDAPGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ public function getUserByUsername($username, $baseDn = null, $scope = Ldap::SEAR
$filter = sprintf('(&(objectClass=user)(samaccountname=%s))', AbstractFilter::escapeValue($username));
break;
case Ldap::ACCTNAME_FORM_BACKSLASH: // backslash style usernames, e.g. FOO\alice
// @todo Not supported yet!
throw new Exception('Backslash style not supported in LDAPGateway::getUserByUsername()!');
break;
case Ldap::ACCTNAME_FORM_PRINCIPAL: // principal style usernames, e.g. [email protected]
Expand All @@ -374,7 +373,6 @@ public function getUserByUsername($username, $baseDn = null, $scope = Ldap::SEAR
);
break;
case Ldap::ACCTNAME_FORM_DN: // distinguished name, e.g. CN=someone,DC=example,DC=co,DC=nz
// @todo Not supported yet!
throw new Exception('DN style not supported in LDAPGateway::getUserByUsername()!');
break;
default: // default to principal style
Expand Down Expand Up @@ -406,7 +404,6 @@ public function getCanonicalUsername($data)
}
return $data['samaccountname'];
case Ldap::ACCTNAME_FORM_BACKSLASH: // backslash style usernames, e.g. FOO\alice
// @todo Not supported yet!
throw new Exception('Backslash style not supported in LDAPGateway::getUsernameByEmail()!');
case Ldap::ACCTNAME_FORM_PRINCIPAL: // principal style usernames, e.g. [email protected]
if (empty($data['userprincipalname'])) {
Expand Down
4 changes: 2 additions & 2 deletions src/Services/LDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ public function updateLDAPFromMember(Member $member)
foreach ($member->config()->ldap_field_mappings as $attribute => $field) {
$relationClass = $member->getRelationClass($field);
if ($relationClass) {
// todo no support for writing back relations yet.
continue;
} else {
$attributes[$attribute] = $member->$field;
}
Expand Down Expand Up @@ -1102,7 +1102,7 @@ public function addLDAPUserToGroup($userDn, $groupDn)
* Change a members password on the AD. Works with ActiveDirectory compatible services that saves the
* password in the `unicodePwd` attribute.
*
* @todo Use the Laminas\Ldap\Attribute::setPassword functionality to create a password in
* Use the Laminas\Ldap\Attribute::setPassword functionality to create a password in
* an abstract way, so it works on other LDAP directories, not just Active Directory.
*
* Ensure that the LDAP bind:ed user can change passwords and that the connection is secure.
Expand Down

0 comments on commit 7491c55

Please sign in to comment.