Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Remove TODO comments #63

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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