Closed coudot closed 1 year ago
taking a look
first step is to abstract send_mail code of self-service-password into ltb-ldap project to reuse it in service-desk.
a ltb-ldap-mail branch was created in ltb-ldap project and in self-service-password to provide common mail function.
It does not seem to have any link between the send_mail function and ldap protocol.
We need to choose if we put all common code into ltb-ldap, or if we create ltb-mail and other ltb-* libs for common methods.
This would make many different libraries. At the moment we can rely on ltb-ldap version, 0.0.2 is wihtout mail and 0.0.3 with. There is a tiny link with ldap through mail attributes used ( \Ltb\AttributeValue::ldap_get_mail_for_notification($ldap, $entry) ). ltb-ldap is currenlty more a common ground for all ltb php project than really focused on ldap only.
This was quickly tested and did work.
Ok, let's go with ltb-ldap
i think later on we will split ltb-ldap, but this might be too early yet, first major goal is to avoid code duplication.
Working on #73 i discover that {login} is not resolved, it requires a posthook with $posthook_login to find correct login attribute. Current mail is sent with {login} empty.
Working on #73 i discover that {login} is not resolved, it requires a posthook with $posthook_login to find correct login attribute. Current mail is sent with {login} empty.
I fixed this in the PR.
We should add the possibility to send a mail to user after its mail was changed. This require to use PHPMailer (we should use the same configuration parameter as Self Service Password).
To be discussed: an option to include the new password in the mail (as the user could be forced to change it at first login). It is a security flaw and should be disabled by default, but could be useful in some organizations.