Skip to content

Preserve server-side local changes for review#14

Open
mandarl wants to merge 2 commits into
Dallas-Makerspace:masterfrom
mandarl:server-local-changes
Open

Preserve server-side local changes for review#14
mandarl wants to merge 2 commits into
Dallas-Makerspace:masterfrom
mandarl:server-local-changes

Conversation

@mandarl

@mandarl mandarl commented May 9, 2026

Copy link
Copy Markdown
Member

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 into master and the server can be brought into sync with the repo.

  • BadgesController.php — Adds use Cake\Log\Log import
  • EndpointsController.php — Rewrites userAdd and clientAdd to align with WHMCS 8.x hook payload changes (field name renames: useriduser_id/client_id, clientid, etc.)
  • UsersController.php — Adds use Cake\Log\Log import and diagnostic logging during user account merge
  • User.php — Adds LDAP bind error handling with ldap_error/ldap_errno logging (credit: Jared Fowkes, 2023-12-30)
  • default.ctp — Adds form-submit button disabler (prevents double-submit) and Google Analytics tag

Notes

  • The EndpointsController changes contain several Log::error debug statements and a kdetest field that may warrant cleanup before or after merging.
  • The Google Analytics tag (G-TSBVKCC0GS) in default.ctp may be removed in a follow-up PR if not desired.

Test plan

  • Verify WHMCS userAdd and clientAdd hooks fire correctly with WHMCS 8.x
  • Confirm LDAP bind failures now log an error instead of silently returning false
  • Verify form submit disabler does not break any forms (check badge activation, user add, etc.)

🤖 Generated with Claude Code

- 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));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']]);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jut additional logs.

Comment thread src/Model/Entity/User.php
$error = ldap_error($ldap);
$errno = ldap_errno($ldap);
error_log("LDAP bind failed for RDN $ldap_rdn: Error $errno: $error");
ldap_close($ldap);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional logging in case the LDAP request failed, and closing the connection. Probably was debugging some issues with this,

});
});
});
</script>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/Template/Layout/default.ctp Outdated
gtag('js', new Date());

gtag('config', 'G-TSBVKCC0GS');
</script>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone added a Google tag to track visits to the website. The tag ID is G-TSBVKCC0GS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants