self-service-password
self-service-password copied to clipboard
Notify by mail code factorization
Current implementation of mail selected for notification is duplicated over each activity ( ie change.php changesshkey.php resetbyquestions.php resetbytoken.php adminchangepassword.php changepassword.php )
Having a unique implementation of it would simplify maintenance and expandability
See if we can resolve this before closing this issue: https://github.com/ltb-project/self-service-password/pull/675#issuecomment-1181809461
Seems everything discussed in this issue is done in #675
I think we can close this safely @coudot ?
We still have this: https://github.com/ltb-project/self-service-password/pull/675#issuecomment-1181809461
But I'm not sure to be able to work on it before 1.6 release
I can give a look
I have proposed a simple improvement in PR https://github.com/ltb-project/self-service-password/pull/893
Ideally, it would be a good idea to have a deeper refactoring here.
For example, it would be nice to split the ltb-ldap functions differently, in order to:
1/ also factorize: https://github.com/ltb-project/self-service-password/blob/7a517ab272ba0afb731cb7e2e5c8930135d3aa81/htdocs/sendtoken.php#L107
# Match with user submitted values
foreach ($mailValues as $mailValue) {
if (strcasecmp($mail_attribute, "proxyAddresses") == 0) {
$mailValue = str_ireplace("smtp:", "", $mailValue);
}
if (strcasecmp($mail, $mailValue) == 0) {
$match = true;
}
}
2/ at line https://github.com/ltb-project/self-service-password/blob/9b6e249936c20facc592206c09b76b267033cd72/htdocs/sendtoken.php#L117 : don't call the \Ltb\AttributeValue::ldap_get_first_available_value part, which is doing another LDAP request, but only do the attribute value manipulation part.
Thanks for the job. I think it's enough for the moment.
We may work on improving API on future versions.