-
Notifications
You must be signed in to change notification settings - Fork 19
WHMCS‐Pterodactyl Sync Setup
This guide provides detailed instructions on configuring PteroSync to work seamlessly with WHMCS. Follow the steps below to ensure a smooth integration and maintain consistency across your platforms.
Warning
- For new clients it create pterodactyl user and it set the password.
- For old/existing clients they must change theirs password at least one time via WHMCS!
- Ensure you follow the steps below.
To ensure proper synchronization between WHMCS and Pterodactyl, adjust the following settings in your config.json
file:
- Purpose: Automatically synchronizes users between WHMCS and Pterodactyl.
-
Recommended Setting:
true
- Benefit: Ensures user information is consistently updated on both platforms.
- Purpose: Manages where users can change their passwords.
-
Recommended Setting:
false
- Benefit: Directs users to change their password through WHMCS, enhancing security and consistency.
To prevent users from bypassing WHMCS for account updates, you'll need to modify specific methods in various Pterodactyl controllers.
-
app/Http/Controllers/Auth/ForgotPasswordController.php
-
Method:
sendResetLinkEmail
-
Method:
-
app/Http/Controllers/Auth/ResetPasswordController.php
-
Method:
resetPassword
-
Method:
-
app/Http/Controllers/Api/Client/AccountController.php
-
Methods:
updateEmail
andupdatePassword
-
Methods:
-
Locate the Methods:
- Navigate to each of the following files:
app/Http/Controllers/Auth/ForgotPasswordController.php
app/Http/Controllers/Auth/ResetPasswordController.php
app/Http/Controllers/Api/Client/AccountController.php
- Find the relevant methods in each file.
- Navigate to each of the following files:
-
Add the Following Code:
- At the top of each method, insert the following return statement:
return response()->json([
'message' => 'This operation is managed through WHMCS. Please update your information there.',
], 403);
public function updateEmail(Request $request)
{
return response()->json([
'message' => 'This operation is managed through WHMCS. Please update your information there.',
], 403);
// Original method code...
}
This modification ensures that any attempt to update user information directly through Pterodactyl will be redirected to WHMCS, maintaining consistent data management.
Please read the Wiki page carefully; it contains all the information you need. If you require support, please provide as many details as possible about your issue. Including the module log from WHMCS will also be very helpful.