Page MenuHomekolab.org

Restoring a user/domain
Needs ReviewPublic

Authored by machniak on Dec 11 2020, 3:45 PM.

Details

Reviewers
vanmeeuwen
Group Reviewers
Restricted Project
Summary

Added artisan user:restore and domain:restore commands

Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Branch
dev/user-restore
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 32533
Build 12556: arc lint + arc unit

Event Timeline

machniak requested review of this revision.Dec 11 2020, 3:45 PM
machniak created this revision.
vanmeeuwen requested changes to this revision.Dec 23 2020, 11:35 AM
vanmeeuwen added a subscriber: vanmeeuwen.
vanmeeuwen added inline comments.
src/app/Domain.php
271 ↗(On Diff #5308)

Isn't STATUS_LDAP_READY removed when the associated job is done?

src/app/Jobs/Domain/CreateJob.php
20 ↗(On Diff #5308)

Marking a domain as deleted in LDAP is still valid, though, so I'd expect the domain to show up in LDAP with inetdomainstatus &= 8.

src/app/Observers/DomainObserver.php
134

When a domain is restored, we don't update the updated_at column of the entitlements table because it's used to track payment status / due dates for new charges.

150

I believe created_at will remain what it was, which would be the expected result.

I also believe $domain->save() will automatically update updated_at.

src/app/Observers/UserObserver.php
290

Here too, please avoid touching updated_at.

src/app/User.php
733 ↗(On Diff #5308)

This should be an effect of having the associated jobs executed successfully, no?

This revision now requires changes to proceed.Dec 23 2020, 11:35 AM
machniak updated this revision to Diff 5704.Fri, Jan 8, 12:04 PM
  • Complete restoring/restored events handlers in user and domain observers
  • Add test for user:restore command
  • Add domain:restore command
machniak updated this revision to Diff 5710.Fri, Jan 8, 12:21 PM
  • Set proper status in user/domain DeleteJob
machniak retitled this revision from [Draft] Restoring a user account to Restoring a user/domain.Fri, Jan 8, 12:21 PM
machniak edited the summary of this revision. (Show Details)
machniak updated this revision to Diff 5716.Fri, Jan 8, 1:21 PM
  • Complete restoring/restored events handlers in user and domain observers
  • Add test for user:restore command
  • Add domain:restore command
  • Set proper status in user/domain DeleteJob