Preserve server-side local changes for review#14
Conversation
- BadgesController: add Log import - EndpointsController: rewrite userAdd/clientAdd for WHMCS 8.x compatibility - UsersController: add Log import and debug logging - User entity: add LDAP bind error handling (Jared Fowkes, 2023-12-30) - default.ctp: add form submit disabler and Google Analytics tag
| Log::error('userAdd: WHMCS user_id creation failed'); | ||
| Log::error('user_data: '.var_export($user_data, true)); | ||
| Log::error(var_export($user->getErrors(), true)); | ||
| } |
There was a problem hiding this comment.
This change seems to be relevant to changes in the WNMCS protocol. They just changed how the records are created in the database.
| Log::error('WHMCS client failed Active Directory password changing in Maker Manager for WHMCS user id ' . $this->request->data['userid'] . '. WHMCS user not found in Maker Manager.', ['scope' => ['users']]); | ||
| $this->_sendEmail('WHMCS client failed Active Directory password changing in Maker Manager for WHMCS user id ' . $this->request->data['clientid'] . '. WHMCS user not found in Maker Manager.'); | ||
| Log::error('WHMCS client failed Active Directory password changing in Maker Manager for WHMCS user id ' . $this->request->data['clientid'] . '. WHMCS user not found in Maker Manager.', ['scope' => ['users']]); | ||
| } |
There was a problem hiding this comment.
All of these changes are just hacking around the changes in how WHMCS fires events and how they are registered in system.
| ]); | ||
|
|
||
| $user = $this->Users->patchEntity($user, $merged_account_data); | ||
| Log::error($user); |
| $error = ldap_error($ldap); | ||
| $errno = ldap_errno($ldap); | ||
| error_log("LDAP bind failed for RDN $ldap_rdn: Error $errno: $error"); | ||
| ldap_close($ldap); |
There was a problem hiding this comment.
Additional logging in case the LDAP request failed, and closing the connection. Probably was debugging some issues with this,
| }); | ||
| }); | ||
| }); | ||
| </script> |
There was a problem hiding this comment.
This is a helper to make sure that all submit buttons are disabled after the first click. My guess is that someone was trying to prevent double submission.
| gtag('js', new Date()); | ||
|
|
||
| gtag('config', 'G-TSBVKCC0GS'); | ||
| </script> |
There was a problem hiding this comment.
Someone added a Google tag to track visits to the website. The tag ID is G-TSBVKCC0GS.
Summary
These changes were found as uncommitted local modifications on the production server (
dms-mm3). They are being submitted for review so they can be merged intomasterand the server can be brought into sync with the repo.BadgesController.php— Addsuse Cake\Log\LogimportEndpointsController.php— RewritesuserAddandclientAddto align with WHMCS 8.x hook payload changes (field name renames:userid→user_id/client_id,clientid, etc.)UsersController.php— Addsuse Cake\Log\Logimport and diagnostic logging during user account mergeUser.php— Adds LDAP bind error handling withldap_error/ldap_errnologging (credit: Jared Fowkes, 2023-12-30)default.ctp— Adds form-submit button disabler (prevents double-submit) andGoogle Analytics tagNotes
EndpointsControllerchanges contain severalLog::errordebug statements and akdetestfield that may warrant cleanup before or after merging.G-TSBVKCC0GS) indefault.ctpmay be removed in a follow-up PR if not desired.Test plan
userAddandclientAddhooks fire correctly with WHMCS 8.x🤖 Generated with Claude Code