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

When you create a user in YesWiki, a password is created but you do n… #1178

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

GayLaurent
Copy link
Contributor

…ot have the means to simply notify the user.

  • send reset password email (with link) when admin create user
  • show reset password link to admin after created
  • if modify user, admin show last reset password link
  • if change email of old user, new reset password email is sent (reset link is update)
  • new param 'contact_disable_email_for_password' to disabled reset password email (case of LDAP, SSO, ...)

Description of pull request / Description de la demande d'ajout

Implement issue #1177

@mrflos
Copy link
Contributor

mrflos commented Jul 2, 2024

si je checkout la branche et me rend sur la page wiki ParametresUtilisateur en étant non connecté, j'obtiens

Une erreur inattendue s'est produite. Veuillez contacter l'administrateur du site et lui communiquer l'erreur suivante :
YesWiki\Core\Service\UserManager::getLastUserLink(): Argument #1 ($user) must be of type YesWiki\Core\Entity\User, null given, called in /Users/mrflos/Developpements/yeswiki/tools/login/actions/UserSettingsAction.php on line 65 in /Users/mrflos/Developpements/yeswiki/includes/services/UserManager.php on line 252

@mrflos
Copy link
Contributor

mrflos commented Jul 2, 2024

J'ai corrigé la dernière erreur, mais en voulant créer un user de test par l'admin des users j'ai une erreur 500 :

{"notCreated":["toto"],"error":"YesWiki\\Core\\Controller\\UserController::create(): Return value must be of type ?YesWiki\\Core\\Entity\\User, array returned"}

Je pense peut etre qu'il vaudrait mieux que la methode UserController::create() continue d'envoyer juste un objet User, ca parait plus propre et surtout ca evite de casser des trucs ailleurs. Peut etre juste ajouter le recoverPasswordLink dans l'objet User ?

Copy link
Contributor

@mrflos mrflos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok ca semble fonctionner, je te propose juste de renommer "Dernier lien pour changer ..." en "Lien pour changer ..." pour que ce soit plus clair.

image
Après l'interface reste un poil louche, genre tu cliques sur "Mise a jour" ca change le lien d'update, ca devrait peut être s'appeler "Réinitialiser le lien pour changer le mot de passe" et envoyer le mail dans ce cas (comme ca on peut cacher le formulaire du dessous)?
Enfin, que penserais tu que dans le tableau récap. des users, le lien soit aussi affiché dans le tableau s'il existe?

tools/login/lang/login_fr.inc.php Outdated Show resolved Hide resolved
tools/login/templates/usersettings.twig Outdated Show resolved Hide resolved
@mrflos
Copy link
Contributor

mrflos commented Jul 19, 2024

@GayLaurent c'est pret a merger a ton avis ?
Pour les considérations d'ux je ferai tester @gatienbataille et @furax37 .

GayLaurent and others added 6 commits July 31, 2024 13:07
…ot have the means to simply notify the user.

- send reset password email (with link) when admin create user
- show reset password link to admin after created
- if modify user, admin show last reset password link
- if change email of old user, new reset password email is sent (reset link is update)
- new param 'contact_disable_email_for_password' to disabled reset password email (case of LDAP, SSO, ...)
@mrflos mrflos force-pushed the send_email_to_reset_password_when_user_created branch from 45bd671 to cd2d3e4 Compare July 31, 2024 10:55
@mrflos mrflos merged commit bf5f87f into doryphore-dev Jul 31, 2024
2 checks passed
@mrflos mrflos deleted the send_email_to_reset_password_when_user_created branch July 31, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants