ltb-project / service-desk

Application for support team who need to check and reset user passwords
https://service-desk.readthedocs.io/
GNU General Public License v3.0
49 stars 20 forks source link

Send a mail to user after password reset #71

Closed coudot closed 1 year ago

coudot commented 1 year ago

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.

artlog commented 1 year ago

taking a look

artlog commented 1 year ago

first step is to abstract send_mail code of self-service-password into ltb-ldap project to reuse it in service-desk.

artlog commented 1 year ago

a ltb-ldap-mail branch was created in ltb-ldap project and in self-service-password to provide common mail function.

coudot commented 1 year ago

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.

artlog commented 1 year ago

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.

artlog commented 1 year ago

This was quickly tested and did work.

coudot commented 1 year ago

Ok, let's go with ltb-ldap

artlog commented 1 year ago

i think later on we will split ltb-ldap, but this might be too early yet, first major goal is to avoid code duplication.

artlog commented 1 year ago

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.

coudot commented 1 year ago

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.