usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.6k stars 613 forks source link

WHMCS Module Bug? #37

Closed realquantumcookie closed 6 years ago

realquantumcookie commented 6 years ago

Hey there.
I just found that WHMCS Module for CyberPanel has a bug that "Terminate Account" does not work properly.
As I went through the source code of Cyberpanel, I found that .py files in the api directory does not include user deletion. Can you go ahead and add this feature?
I am willing to update the cyberpanel WHMCS module for you.

usmannasir commented 6 years ago

What if the same user owns other websites?

realquantumcookie commented 6 years ago

Thats not how WHMCS Works XD.
Everytime a user in WHMCS system creates a website order, the module create a new user in CyberPanel.
So I think deleting user API is necessary.

usmannasir commented 6 years ago

Correct, that is the case when the website is created via WHMCS.

However the same user is not limited to 1 website, the administrator can assign more websites to the same owner.

In this case, if we delete user along with the site from WHMCS API, it will also delete other websites.

realquantumcookie commented 6 years ago

That is right. So how can we solve this WHMCS problem?

usmannasir commented 6 years ago

If the user has only one site, we can remove the user along with deletion.

realquantumcookie commented 6 years ago

While you mention about deletion, do you mean delete the site or user? Is there an API for deleting user? Thanks

usmannasir commented 6 years ago

I've added the possibility of deleting user when the website being deleted is the only website owned by that user, this only happens when the website is deleted from API: https://github.com/usmannasir/cyberpanel/blob/b30a1c56e5ecaed659f66a172b167fd73b302d13/api/views.py#L205

realquantumcookie commented 6 years ago

Thanks. Helps a lot! I will begin changing the WHMCS module now.

usmannasir commented 6 years ago

There are no changes from WHMCS side, but you can still do tests, run this command to install Github version

sh <(curl https://mirror.cyberpanel.net/install-test.sh || wget -O - https://mirror.cyberpanel.net/install-test.sh)

realquantumcookie commented 6 years ago

Thanks!