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 reset confirmation mail from occ stable10 #34154

Merged
merged 2 commits into from
Feb 7, 2019

Conversation

sharidas
Copy link
Contributor

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/owncloud2   fix-reset-confirmation-mail-from-occ-stable10 ●  export OC_PASS=foo
 sujith@sujith-ownCloud  ~/test/owncloud2   fix-reset-confirmation-mail-from-occ-stable10 ●  ./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/owncloud2   fix-reset-confirmation-mail-from-occ-stable10 ● 

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 added this to the development milestone Jan 16, 2019
@sharidas sharidas self-assigned this Jan 16, 2019
@sharidas
Copy link
Contributor Author

Original PR #34137

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.

LGTM
Leaving for @PVince81 to review/approve and decide when to merge to stable10

@sharidas sharidas force-pushed the fix-reset-confirmation-mail-from-occ-stable10 branch from 2fc7d63 to 2fe25c9 Compare January 16, 2019 07:09
@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #34154 into stable10 will decrease coverage by 18.3%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             stable10   #34154       +/-   ##
===============================================
- Coverage       63.48%   45.18%   -18.31%     
===============================================
  Files            1264      116     -1148     
  Lines           75152    11458    -63694     
  Branches         1286     1286               
===============================================
- Hits            47711     5177    -42534     
+ Misses          27065     5905    -21160     
  Partials          376      376
Flag Coverage Δ Complexity Δ
#javascript 53.32% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 31.02% <ø> (-33.56%) 0 <ø> (-19111)
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Storage/DAV.php 59.45% <0%> (-21.64%) 0% <0%> (ø)
apps/updatenotification/templates/admin.php
lib/private/Encryption/Keys/Storage.php
lib/private/App/CodeChecker/NodeVisitor.php
lib/private/RedisFactory.php
apps/dav/lib/Avatars/AvatarNode.php
...s/dav/appinfo/Migrations/Version20170202213905.php
apps/dav/lib/Upload/ChunkLocationProvider.php
apps/files/lib/AppInfo/Application.php
apps/systemtags/list.php
... and 1139 more

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 c2cbc79...2fe25c9. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 16, 2019

Codecov Report

Merging #34154 into stable10 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##             stable10   #34154      +/-   ##
==============================================
+ Coverage       63.48%   63.48%   +<.01%     
- Complexity      19117    19121       +4     
==============================================
  Files            1264     1264              
  Lines           75175    75184       +9     
  Branches         1288     1288              
==============================================
+ Hits            47723    47729       +6     
- Misses          27074    27077       +3     
  Partials          378      378
Flag Coverage Δ Complexity Δ
#javascript 53.31% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.57% <100%> (ø) 19121 <0> (+4) ⬆️
Impacted Files Coverage Δ Complexity Δ
core/Command/User/ResetPassword.php 70.52% <100%> (+3.46%) 23 <0> (+4) ⬆️
apps/encryption/templates/settings-admin.php 88.23% <0%> (-5.89%) 0% <0%> (ø)
apps/encryption/lib/Session.php 98.03% <0%> (-1.97%) 22% <0%> (ø)
apps/files_trashbin/lib/Expiration.php 96.55% <0%> (-1.73%) 29% <0%> (ø)
...eratedfilesharing/lib/Controller/OcmController.php 66.06% <0%> (-0.21%) 30% <0%> (ø)

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 35324dc...67ce367. Read the comment docs.

sharidas and others added 2 commits January 22, 2019 14:49
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-stable10 branch from 2fe25c9 to 67ce367 Compare January 22, 2019 09:19
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.

👍

@sharidas sharidas merged commit faa0bc1 into stable10 Feb 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-reset-confirmation-mail-from-occ-stable10 branch February 7, 2019 13:25
@PVince81 PVince81 modified the milestones: development, QA Apr 12, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 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.

3 participants