Jump to content

Unable to remove created users


Recommended Posts

On 06/11/2020 at 12:28, ZoXx said:

The only solution is that WHMCS reacts here and publish an update which is gdpr confirm and works as we need it in europe.

I think it's safe to say that, barring any emergency issues (and they wouldn't see this as one by the looks of it), there won't be a v8.0.5 release... therefore, their focus will turn to v8.1 - from past experience, I wouldn't expect to see a beta for that this year... unless they go down the silly road again of releasing a beta one week before Christmas and then later complain that no one is testing it. 🙄

if v8.1 doesn't go to beta until the New Year, then I doubt it would go GA before Easter 2021 - especially as there are scheduled to be a Bootstrap 4 upgrade, a new client area theme (let's call it "Eight" lol) and cart template updates due to be included - so it might not even be considered "stable" (by their definition) until months after that.

therefore, it would be good to know definitively, long before then, whether WHMCS see this as an issue they're going to address themselves in v8.1 - ideally both user management and their password management - because if they're not, others can start making alternate solutions... but others likely wouldn't want to waste time going down that road if WHMCS are going to address this themselves (which would be the preferable solution and should really have been in place before v8 when GA).

On 06/11/2020 at 12:36, Ardeshir said:

Guys, does anyone of you know a hook to delete users when deleting clients?

I think a simplistic hook that just deleted the equivalent user when a client is deleted is potentially very dangerous - primarily because in v8, client/account does not necessarily equal user... e.g a user might be linked to more that one client/account, and so auto deleting the user when you delete one of those clients, could cause issues for those remaining clients... so that potentially means warning the admin that a user might be associated with other accounts before they confirm for the deletion to continue.

as Dennis so rightly says, "you just got to account for a lot of things" - the deeper you delve looking at this, the more checks you find that you would need to perform before deleting anything from the database... and one would hope that WHMCS internal developers would understand that relationship better than the rest of us.

On 06/11/2020 at 12:36, Ardeshir said:

And I don't want to touch DB! Last time my DB corrupted, I prefer a hook or a better permanent solution by WHMCS!

as i've outlined, a permanent solution from WHMCS would likely be months away at best - so as long as you know in your case that there is an account = user relationship, then just removing the appropriate row from the tblusers database table will remove that user.... I suppose for completion/tidiness, the relationship should be removed between client/user in tblusers_clients table too - though that's probably not essential... and remember to backup the table(s) before you make changes to them.

Link to comment
Share on other sites

On 11/8/2020 at 6:35 PM, brian! said:

I think a simplistic hook that just deleted the equivalent user when a client is deleted is potentially very dangerous - primarily because in v8, client/account does not necessarily equal user

Isn't it the other way around? A client will always be a user, but a user will not always be a client.

What I was initially suggesting was that the DeleteClient could have an additional argument passed to also delete an existing user with the same email address. It would solve the issue in our case since sometimes we want to delete everything, and sometimes the user would still need to access other clients' accounts.

Thoughts on that?

Link to comment
Share on other sites

57 minutes ago, wsa said:

It dont look like. Admin need to do more work by remove each user from phpMyAdmin

Normal staff and employees usually don't have and should not have access to manipulate a database directly. Unless someone knows all the fields that are linked and require deletion besides the main table, you can end up doing more damage that way. This is the reason API's and GUI's exist. It's a safe measure on which people just click a button and after confirmation all the safe actions that involve data erasure are done by the software.

If the function is missing from the admin side, then its missing from WHMCS. If I wanted to add and edit data directly to the database, then why even require WHMCS 😁

Link to comment
Share on other sites

14 hours ago, DennisHermannsen said:

Isn't it the other way around? A client will always be a user, but a user will not always be a client.

*grabs bottle of painkillers in anticipation of getting a logic migraine* 💊

in the sense that when you create a client, a user is created at the same time, it's true that, at least at the beginning, the relationship will be there... the problem is once you open the option of coding, or direct access to the db, then you can bypass the intended logic and run into the law of unintended consequences.

14 hours ago, DennisHermannsen said:

What I was initially suggesting was that the DeleteClient could have an additional argument passed to also delete an existing user with the same email address. It would solve the issue in our case since sometimes we want to delete everything, and sometimes the user would still need to access other clients' accounts.

but how could they access other accounts if that user has been deleted ?

I think my mind is seeing this from having existing data where clients already have multiple users assigned to them - so a hook that just deletes client/user with same address, could leave orphaned users.... and users could be assigned to other clients manually.

i'm not saying that this can't be done.... and i'm starting to think I might be overcomplicating certain aspects in my own head.. it just feels like the whole account/user functionality has only been partially thought through... and certainly only partially implemented... no doubt with the usual "features will develop in future releases"... which often equates to in two years time, you'll have what should have been present from day 1.

5 hours ago, yggdrasil said:

Does this mean that WHMCS 8 is suddenly not GDRP compliant anymore?

any compliance lawyers in the audience ?

in the sense that the database contains personal information that a user might ask (tell) you to remove, but there is no built-in method for ad admin to remove it... whether the fact that you can remove the data directly from the database makes it compliant, i'm unsure... but surely if GDPR requires you to be able to remove the user data (and it's personal information), you should be able to do it from within the program... and if you can't, then I think WHMCS have to mention the reason why you don't need to be able to do that.

Link to comment
Share on other sites

2 minutes ago, brian! said:

any compliance lawyers in the audience ?

in the sense that the database contains personal information that a user might ask (tell) you to remove, but there is no built-in method for ad admin to remove it... whether the fact that you can remove the data directly from the database makes it compliant, i'm unsure... but surely if GDPR requires you to be able to remove the user data (and it's personal information), you should be able to do it from within the program... and if you can't, then I think WHMCS have to mention the reason why you don't need to be able to do that.

This is exactly what we have to do according to gdpr. all information has to be deleted. this has a high fine, a lot of annoyance and other consequences. whmcs simply did not work properly here and has a huge problem with the eruopean data protection act. either we will improve the system or whmcs is not usable for the eruopean area anymore due to the sanctions we get as a company. 

Link to comment
Share on other sites

19 minutes ago, brian! said:

in the sense that the database contains personal information that a user might ask (tell) you to remove, but there is no built-in method for ad admin to remove it... whether the fact that you can remove the data directly from the database makes it compliant, i'm unsure... but surely if GDPR requires you to be able to remove the user data (and it's personal information), you should be able to do it from within the program... and if you can't, then I think WHMCS have to mention the reason why you don't need to be able to do that.

 
 
 
 
 

Well, that is my point. You are not buying MySQL or MariaDB or the database schema from WHMCS. You are buying the web hosting automation software and the software interacts with a database in the background as well PHP and many other technologies it requires. If I must delete data from the database directly, it means WHMCS is not compliant. My database or company is, but the software (WHMCS) they sell is not since that operation cannot be done directly from the software interface. I need to use another tool, the command line, or just another database management software that interacts with my database to remove it. Technically and legally the requested operation to delete that specific point of data cannot be done with WHMCS.

I'm 100% sure they will add this (they must) but why did they launch version 8 in that state. What was the hurry? They already moved to a subscription model, so they are not precisely making most money from upgrades as people renew their licenses as in the past. I'm not sure why are in such a hurry if they are now on a model that gives them stable monthly income.

Link to comment
Share on other sites

6 hours ago, yggdrasil said:

This seems like a big oversight, not being able to remove users. How did this pass the beta testing?

I know Dennis brought up the GDPR on the day it went GA (Sept 29) - though I don't know if the GA had been specifically released when he posted...

Quote

When deleting a client, the client's user is not deleted. It's only the client account that gets removed from WHMCS. I can see the reasoning behind this but it leaves a problem regarding GDPR - because there's simply no way to delete a User without doing it from the database.

If a Client tells us they need their account deleted, we need to delete everything regarding that client. Leaving the User account is a big problem as we still store their name and email address in that case. Am I just not seeing the "DeleteUser" API function?

i'd link to the thread, but it got deleted, sorry I mean hidden (much like this thread might be next week!) - but I recall he did mention a core number from WHMCS for it - CORE-15257 - of course, there are no timelines... so might get included in v8.1 next year... or just fade away unfixed.

Link to comment
Share on other sites

21 hours ago, brian! said:

I know Dennis brought up the GDPR on the day it went GA (Sept 29) - though I don't know if the GA had been specifically released when he posted...

I actually brought it up before September 29th. I also received this reply before that date:

Quote

Hello,

Thanks for getting in touch with WHMCS support and testing v8 pre-release!

Under v8, the client and user are separate entities and it's possible the user is associated with other client accounts so an automatic deletion is likely not suitable here, I can see our developers are currently looking into delete options for Users under case #CORE-15257 and adding this to future releases.

Any queries please let me know.

I took it as a "We're working on fixing this mistake" - and then the first GA release came shortly after.

Link to comment
Share on other sites

On 11/10/2020 at 3:39 PM, brian! said:

but how could they access other accounts if that user has been deleted ?

You don't delete the user - you delete the client. The DeleteClient function should have an option to delete the user as well (maybe just by passing 'DeleteOwner => True' with the function), and this would remove everything - both the client and the user. In that case, the user would no longer be able to login to manage any of the accounts the user was associated with.
If you don't send 'DeleteOwner => True', only the client should be deleted, and the user would still be able to login to manage other accounts. That's how it works right now.

Does that make any sense? I've not given it too much thought but I think that would work for most cases.

Link to comment
Share on other sites

27 minutes ago, DennisHermannsen said:

You don't delete the user - you delete the client. The DeleteClient function should have an option to delete the user as well (maybe just by passing 'DeleteOwner => True' with the function), and this would remove everything - both the client and the user. In that case, the user would no longer be able to login to manage any of the accounts the user was associated with.

I still think you might need another option to ignore whether the user is associated with other accounts before deleting them.

similarly, a delete all users option that deletes client and all of it's users at the same time... I would have thought in terms of gdpr, that would have to be an option... once you've deleted the client, then you can't delete any associated users from the admin area.

quick question - I could test this myself, but you might have done it already... when you "Remove" an associated user from a client in the admin area, does it delete the user in tblusers or delete the relationship between client/user in tblusers_clients... or both??

Link to comment
Share on other sites

On 09/11/2020 at 22:07, DennisHermannsen said:

Isn't it the other way around? A client will always be a user, but a user will not always be a client.

in relation to this, I just spotted that when you create a new client in v8 (either from the admin area or API), you are given the choice of creating a new equivalent user at the same time, or choosing an existing user...

so I think it's possible that when a client registers directly, a client always being a user might be true - but when created from the admin side, then that's not necessarily the case, e.g client email not necessarily equal to user email.

Link to comment
Share on other sites

Hi

I have updated the hook here is the code

if(!defined("WHMCS")) die("This file cannot be accessed directly");

use WHMCS\User\Client;
use WHMCS\User\User;

add_hook('ClientDelete', 855412, function($vars)
{
  $clientid = $vars['userid'];
  $userid   = Client::find($clientid)->owner()->id;

  if($userid)
  {
    if(User::where('id', $userid)->delete())
    {
      logActivity('User Deleted - ID: '.$userid, 0);
    }
  }
});

 

deleteClientUser.zip

Link to comment
Share on other sites

Quote

 

Thank you for your reply.

We do have a case for deleting a user in the manage user modal and it is staged for our next release. I do not have a specific date for this release, however, it shouldn't be too long.

The case is CORE-15645.

If you would like to continue with WHMCS until the next release, please let me know. 

 

 

Link to comment
Share on other sites

Wow... They really took the easy way out. I don't even know why I'm surprised.
It's definitely progress, but this very minor change hasn't required much thought and is something I would have expected WHMCS to have released at least in 8.0.1. It just checks if a user is associated with any client, and if not, it allows you to delete it (and it just deletes the entry in tblusers). 

Why (oh why) didn't they allow us to force delete users. Why is there no API function that we can use to delete users? I foresee that automating stuff using the API will get more and more difficult in newer versions of WHMCS.

Thanks for making at least some progress on this matter - but it feels like nobody from WHMCS sat down to read feedback in this thread.

Link to comment
Share on other sites

1 hour ago, DennisHermannsen said:

Wow... They really took the easy way out. I don't even know why I'm surprised.
It's definitely progress, but this very minor change hasn't required much thought and is something I would have expected WHMCS to have released at least in 8.0.1. It just checks if a user is associated with any client, and if not, it allows you to delete it (and it just deletes the entry in tblusers). 

Why (oh why) didn't they allow us to force delete users. Why is there no API function that we can use to delete users? I foresee that automating stuff using the API will get more and more difficult in newer versions of WHMCS.

Thanks for making at least some progress on this matter - but it feels like nobody from WHMCS sat down to read feedback in this thread.

If you check every other major release in the past 2 years the story was the same. They are quick to release new versions that hardly passed Beta. That should explain some of your questions. The trick is not to upgrade WHMCS when they release a new major version but wait for the smaller releases that keep fixing stuff.

Link to comment
Share on other sites

  • 3 weeks later...

Version 8.0.4, If you try to create a client from the admin side, and it takes some sort of error ---ala some weird icaan message about client must have a valid reachable email (yes this happens)....WHMCS creates a stranded user, not associated with any client, and it can not be deleted.

This is a different reason we should be able to delete a user from Manage Users. 

If the logic in not allowing this based upon a user accidentally being deleted that should not be (aka an active user associated with a client) then add code to run a check on the database and kick a message saying it can't be deleted because its used.....otherwise, we need a way to delete users from Manage Users,

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi all,

Thanks for your feedback. I'm pleased to advise that following the major overhaul or the authentication and access systems in v8.0, we've implemented the extra features fed-back by our valued users. Manual  and automatic user deletion, and pruning of the invitation history have all been implemented in v8.1, currently in public pre-release testing:

https://blog.whmcs.com/133664/feature-spotlight-user-deletion-in-whmcs-81

Please give it a try and share your feedback in the pre-release board:

https://beta.whmcs.com

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated