pterodactyl / whmcs

WHMCS Module for Pterodactyl (v0.7.3 and higher)
MIT License
183 stars 77 forks source link

Autosetup assigns server to random user #111

Closed tideodk closed 2 years ago

tideodk commented 2 years ago

Hi! Ever since the newest WHMCS update, im having issues where my installation will assign a new order to an already registered user. Example:

user1@email.com is an active client.

user2@email.com orders new server

Module will setup server on user1@email.com´s account.

image

I am unsure on how to resolve this. I´ve tried repasting the new updated module to my WHMCS installation.

Please let me know what debugging you need to look into this, and maybe someone else has issues.


If the random user it assigns the server has 0 servers, and I delete the user, and then recreate the server in whmcs - it Will assign the correct user

TrixterTheTux commented 2 years ago

The user has external_id set in Pterodactyl to the client's ID in WHMCS, thus the module assumes that the user was created before by the module itself. If you're using something that also sets user's external_id field then it'll conflict with this module and lead to this similar behavior.

tideodk commented 2 years ago

Hi. I assume this field is not editable from the users tab, but rather from the database?

tideodk commented 2 years ago

The user has external_id set in Pterodactyl to the client's ID in WHMCS, thus the module assumes that the user was created before by the module itself. If you're using something that also sets user's external_id field then it'll conflict with this module and lead to this similar behavior.

Would removing the creation of the user from the module remove the conflict?

tideodk commented 2 years ago

Hi everyone! I was using a modification that made my WHMCS create a Pterodactyl account anytime someone created a WHMCS account. In this case, some customers created WHMCS accounts to order other products, and the module always assume that the next external_id is the one that it created. Thus, it would just assign the server to the next external_id (which may not even be a client that is using pterodactyl, but rather a other product)

Thanks for all the help :-)