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

Deleting a non-ElggUser should delete its datadir #7130

Closed
juho-jaakkola opened this issue Aug 1, 2014 · 7 comments
Closed

Deleting a non-ElggUser should delete its datadir #7130

juho-jaakkola opened this issue Aug 1, 2014 · 7 comments
Assignees
Labels

Comments

@juho-jaakkola
Copy link
Member

@juho-jaakkola juho-jaakkola commented Aug 1, 2014

In Elgg 1.9 user files are deleted by calling clear_user_files($user) from ElggUser::delete().

It's however also possible for non-users to have their own datadir. These dirs are currently being left behind when the entity is deleted.

Lets deprecate clear_user_files() in favor of clear_entity_files() and call that from ElggEntity::delete(). (Or just move the logic completely into ElggEntity.)

@juho-jaakkola

This comment has been minimized.

Copy link
Member Author

@juho-jaakkola juho-jaakkola commented Aug 1, 2014

Example (future) use case: #4683

@mrclay

This comment has been minimized.

Copy link
Member

@mrclay mrclay commented Aug 1, 2014

I'm generally against moving more logic into ElggEntity. Is there a service we could put it into?

@mrclay

This comment has been minimized.

Copy link
Member

@mrclay mrclay commented Aug 1, 2014

Is clear_user_files() considered public API? Can we just rename it something like _elgg_delete_entity_dir()?

@juho-jaakkola

This comment has been minimized.

Copy link
Member Author

@juho-jaakkola juho-jaakkola commented Aug 2, 2014

Agreed that the logic should eventually go a service. Here's an issue to discuss that further: #4719

Docblock in clear_user_files() says "Don't use this function". Is that enough to consider it private? :)

@mrclay

This comment has been minimized.

Copy link
Member

@mrclay mrclay commented Aug 2, 2014

Seems private to me!

@jdalsem

This comment has been minimized.

Copy link
Member

@jdalsem jdalsem commented Nov 27, 2014

can somebody work on this? This reduces the need for plugins with custom objects to remove the files themselves (event manager, blog tools, etc)

@beck24

This comment has been minimized.

Copy link
Member

@beck24 beck24 commented Nov 27, 2014

This would also fix the event issue: #6953

Assigning it to myself unless anyone feels strongly about taking it?
Would we want a cleanup script to identify and remove orphaned files where this may have happened in the past?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.