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

Fix password reset confirmation email from occ #34137

Merged
merged 2 commits into from
Jan 15, 2019

Conversation

sharidas
Copy link
Contributor

Fix password reset confirmation email from occ.
This was missing when user:resetpassword command
was used with options "--send-email --password-from-env".
With this change set the issue is resolved.

Signed-off-by: Sujith H [email protected]

Description

When password for user is set using command user:resetpassword, with options --send-email --password-from-env ( apart from username ) , the password successful email is not sent. This is a minor issue though. In this PR an extra condition is added, so that password setting logic is routed to LostController's setPassword, if --send-email is used along with the option password-from-env. Care has also been taken to evaluate the return from LostControllers setPassword() method.

Related Issue

Motivation and Context

An email will be triggered if the password change has been made for the user with the options ``--send-email --password-from-envpassed to commanduser:resetpassword`.

How Has This Been Tested?

  • Create user1 user
  • Execute the command below:
sujith@sujith-ownCloud  ~/test/owncloud3   master ●  ./occ user:resetpassword user1 --send-email --password-from-env
Cannot load Xdebug - it was already loaded
Successfully reset password for user1
 sujith@sujith-ownCloud  ~/test/owncloud3   master ● 
  • Verified that email is sent when the password is changed.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@sharidas sharidas self-assigned this Jan 14, 2019
@sharidas sharidas added this to the development milestone Jan 14, 2019
@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #34137 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34137      +/-   ##
============================================
+ Coverage     64.76%   64.77%   +<.01%     
- Complexity    18345    18349       +4     
============================================
  Files          1198     1198              
  Lines         69450    69460      +10     
  Branches       1281     1281              
============================================
+ Hits          44982    44992      +10     
  Misses        24095    24095              
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.12% <100%> (ø) 18349 <0> (+4) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/Command/User/ResetPassword.php 70.52% <100%> (+3.46%) 23 <0> (+4) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b278e1...f28fa37. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #34137 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34137      +/-   ##
============================================
+ Coverage     64.76%   64.77%   +<.01%     
- Complexity    18345    18349       +4     
============================================
  Files          1198     1198              
  Lines         69450    69460      +10     
  Branches       1281     1281              
============================================
+ Hits          44982    44992      +10     
  Misses        24095    24095              
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.12% <100%> (ø) 18349 <0> (+4) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/Command/User/ResetPassword.php 70.52% <100%> (+3.46%) 23 <0> (+4) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b278e1...f28fa37. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 14, 2019

Codecov Report

Merging #34137 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #34137      +/-   ##
============================================
+ Coverage     64.76%   64.77%   +<.01%     
- Complexity    18347    18351       +4     
============================================
  Files          1198     1198              
  Lines         69454    69464      +10     
  Branches       1281     1281              
============================================
+ Hits          44983    44993      +10     
  Misses        24098    24098              
  Partials        373      373
Flag Coverage Δ Complexity Δ
#javascript 53.09% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.12% <100%> (ø) 18351 <0> (+4) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/Command/User/ResetPassword.php 70.52% <100%> (+3.46%) 23 <0> (+4) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 028ba04...2ab6f12. Read the comment docs.

@phil-davis
Copy link
Contributor

phil-davis commented Jan 14, 2019

@sharidas I discovered that the acceptance test for this issue was not really demonstrating the issue.
I corrected the acceptance test in PR #34139
After that is merged, the acceptance test will then be demonstrating the wrong behavior described in the issue.
Then this PR will need to correct the acceptance test, as well as fixing the issue.
^this is resolved

@sharidas sharidas force-pushed the fix-reset-confirmation-mail-from-occ branch from f28fa37 to cdf7958 Compare January 14, 2019 13:02
Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

Adjusted acceptance test passes, so that is "a good thing"

sharidas and others added 2 commits January 14, 2019 19:58
Fix password reset confirmation email from occ.
This was missing when user:resetpassword command
was used with options "--send-email --password-from-env".
With this change set the issue is resolved.

Signed-off-by: Sujith H <[email protected]>
@sharidas sharidas force-pushed the fix-reset-confirmation-mail-from-occ branch from cdf7958 to 2ab6f12 Compare January 14, 2019 14:30
@sharidas sharidas requested a review from PVince81 January 14, 2019 16:45
@sharidas
Copy link
Contributor Author

Current state of the PR:

  • Verified the issue using this PR. And it resolves the issue.
  • Have cherry-picked one of the commits of @phil-davis for this fix.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit 17675cb into master Jan 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-reset-confirmation-mail-from-occ branch January 15, 2019 16:35
@PVince81
Copy link
Contributor

@sharidas please backport

@sharidas
Copy link
Contributor Author

sharidas commented Jan 16, 2019

Backport to stable10 PR #34154

@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Password reset confirmation email is not sent on occ command user:resetpassword
3 participants