Skip to content

Commit

Permalink
Merge pull request #63 from creative-commoners/pulls/2.1/remove-todo
Browse files Browse the repository at this point in the history
MNT Remove TODO comments
  • Loading branch information
GuySartorelli authored Oct 29, 2023
2 parents df528fe + 6da7378 commit 1f49868
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 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. alice@foo.com
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. alice@foo.com
if (empty($data['userprincipalname'])) {
Expand Down
7 changes: 1 addition & 6 deletions src/Services/LDAPService.php
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,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.
} else {
if (!$relationClass) {
$attributes[$attribute] = $member->$field;
}
}
Expand Down Expand Up @@ -1102,9 +1100,6 @@ 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
* 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.
*
* @param Member $member
Expand Down

0 comments on commit 1f49868

Please sign in to comment.