Page MenuHomePhorge

Restoring a user/domain
ClosedPublic

Authored by machniak on Dec 11 2020, 3:45 PM.
Tags
None
Referenced Files
F11584677: D1924.diff
Thu, Mar 28, 9:05 AM
Unknown Object (File)
Feb 21 2024, 11:06 PM
Unknown Object (File)
Feb 21 2024, 10:09 PM
Unknown Object (File)
Jan 29 2024, 4:14 PM
Unknown Object (File)
Jan 25 2024, 4:23 AM
Unknown Object (File)
Jan 17 2024, 12:23 AM
Unknown Object (File)
Jan 9 2024, 12:18 AM
Unknown Object (File)
Jan 3 2024, 6:30 AM
Subscribers
Restricted Project

Details

Reviewers
vanmeeuwen
Group Reviewers
Restricted Project
Commits
rK2022a3f5a265: Restoring a user/domain
Summary

Added artisan user:restore and domain:restore commands

Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Branch
dev/user-restore
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 32521
Build 12544: arc lint + arc unit

Event Timeline

machniak created this revision.
vanmeeuwen subscribed.
vanmeeuwen added inline comments.
src/app/Domain.php
271

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

src/app/Jobs/Domain/CreateJob.php
20

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
722

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
  • 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
machniak retitled this revision from [Draft] Restoring a user account to Restoring a user/domain.Jan 8 2021, 12:21 PM
machniak edited the summary of this revision. (Show Details)
  • 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
vanmeeuwen added inline comments.
src/app/Console/Commands/DomainRestore.php
46

I don't understand this part.

When john@kolab.org deletes itself and needs to be restored, is the situation not always that both the User as well as the Domain are deleted?

Does it then mandate that first user:restore john@kolab.org is ran?

This revision now requires changes to proceed.Feb 4 2021, 2:35 PM
src/app/Console/Commands/DomainRestore.php
46

It's just that you cannot restore a domain before restoring the user. But the command is still useful if you restore a domain (one of many) on an existing account.

This revision is now accepted and ready to land.Feb 16 2021, 9:12 AM
This revision was automatically updated to reflect the committed changes.