Potential problem when deleting users

10 years 1 month ago #104661 by amazeika
I detected a potential problem when deleting users that have active subscriptions.

Plugins expiration/unsubscribe actions are not executed when the user is deleted. Even if, in the great majority of cases this would not represent a problem since the user is deleted, this is not a good practice since the remaining info on 3rd party components/software could lead to unexpected behaviors.

In my case, Docman groups contained users that no longer exist.

This is just a suggestion.

Best regards.

Post edited by: amazeika, at: 2009/07/13 14:35

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.
10 years 1 month ago #104691 by krileon
Docman stores user in their own tables. Deleting a user from CB won't delete them from docman and vise versa. Deleting in docman won't delete from CB. Not CBSubs related.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
10 years 1 month ago #104696 by amazeika

Docman stores user in their own tables. Deleting a user from CB won't delete them from docman and vise versa. Not CBSubs related.


???

Docman stores user in their own tables.


No, it does not. There is no such thing as a Docman user.

Deleting a user from CB won't delete them from docman and vise versa. Deleting in docman won't delete from CB.


This doesn't make sense because your first statement is wrong.

Not CBSubs related.


Totally CBSubs related. CBSubs plugins make modifications on 3rd party component tables that need to be undone when a Joomla user is deleted (since you are also deleting his subscriptions) as it is indicated on each plugin configuration. There should be no difference between delete subscription/unsubscribe then delete Joomla user and Delete Joomla user directly. This is actually not happening and remaining CBSubs subscription info is left on 3rd party tables. You should call the unsubscribe plugin actions when you delete a user!.

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.
10 years 1 month ago #104720 by nant
Just did the following experiment:

Using docman 1.4 stable on a Joomla 1.5.12 site with legacy enabled (docman needs it) and CB 1.2.1.

+ added a test user from CB User Management
+ added this test user to a docman group
+ deleted use from CB User Management
= test user deleted from docman group

How exactly did you delete your user?
10 years 1 month ago #104724 by amazeika
Hello nick,

I have pretty much the same config, same docman and CB, but I'm using Joomla 1.5.11.

The user was created by CB while subscribing to a CBSubs plan. The CBSubs Docman plugin updates the user list of the Docman Group after payment. So far, OK. I Deleted the user from CB, which has an active subscription. If you check in the Docman group table (from phpMyAdmin), you will see that the user id is still there within the members of that group.

What I'm saying is that when the user is deleted, you should call for the expiration/unsubscribe/delete subscription plugin actions. This is not only happening with the Docman plugin, I also experimented the same thing with the SQL plugin. The expiration/unsubscribe/delete query is not executed when the user is directly deleted from CB user manager.

BTW Nick, I bet that the user that you deleted is still in the docman group list. Of course, you wont see him from the backend (because the user no longer exists) but you probably will in #__docman_groups.

The Docman issue is a bad example, because, it is not a catastrophic problem. Like I said, and in this example, who cares if the id of an non-existing user is still in that group list ?, it is unlikely that this will represent a problem in the future.

However, this kind of little things that are left unresolved could POTENTIALLY represent a problem and can be easily prevented by just making the right call when deleting the user with the CB user manager. If a CBSubs plugin made a change somewhere and it is supposed to undo or make another change at a latter time (expiration/unsubscribing), it should also do it when the user is deleted because indirectly, the subscription is being deleted as well.

Post edited by: amazeika, at: 2009/07/13 19:50

Arunas Mazeika
WeXtend.com - Professional development for Joomla!.
10 years 1 month ago #104746 by nant
I would keep CBSubs out of the picture before we agree on how things work without it.

Well, with Joomla 1.5.12 and using the Joomla User Manager to create a new user and then adding this user to a docman group and then removing the user (again using the Joomla user management) also produces the same result === meaning that the jos_docman_groups table row still shows the id of the deleted user in it.

So, this means that either docman is not responding to the firing of the remove user event (sorry don't know the exact event name) or the event is not fired by Joomla 1.5.12 itself.

So this is a DOCman issue.

I would bet good money that the CB User Management backend fires the proper Joomla trigger (as well as relevant CB API trigger) which DOCman also ignores.

[not 100% sure about this - waiting for Beat to follow-up]

Back to CBSubs - lets not confuse Joomla/CB user registration to CBSubs subscriptions. A user subscribes to a CBSubs plan. When a user unsubscribes, this doesn't mean that the user is removed from the CMS.
Moderators: beatnantkrileon
Time to create page: 0.409 seconds
Facebook Twitter Google LinkedIn