CassidyDNS Posted September 25, 2023 Share Posted September 25, 2023 I've almost finished developing my own server module, however, I'd like to provide the option for using a password or API key (instead of the access hash). I can see that some server modules like cPanel provide an API key instead of an access hash, but I can't find any docs on how to make it use that instead. I've searched Google, etc as well and I can't find anything on how to do this. Would anyone here be able to help please? 0 Quote Link to comment Share on other sites More sharing options...
JavierCN Posted September 26, 2023 Share Posted September 26, 2023 (edited) Hi: Have you tried a var_dump($vars) in the module _TestConnection function and get the values from it? The $vars contains all the authentication values. You can get the authentication values from the tblservers table. Regards. Edited September 26, 2023 by JavierCN Missunderstanding 0 Quote Link to comment Share on other sites More sharing options...
CassidyDNS Posted September 26, 2023 Author Share Posted September 26, 2023 The issue isn't with retrieving the values, it's with setting them. When creating a new server, the cPanel module doesn't ask for an "Access Hash" like other modules, instead it asks for an "API Token". I want my module to ask for an API Token as well and not an Access Hash. 0 Quote Link to comment Share on other sites More sharing options...
JavierCN Posted September 27, 2023 Share Posted September 27, 2023 Hi: I've tested. I guess it's hardcoded in WHMCS, if you name your module "cpanel" the module will show the API Token field, so the module does not control if the "API Token" field appears, it's WHMCS. Just use the "access hash" field to set the token, or use JS (via hook) to change the display of "#newToken" and "#newHash" fields whenever #addType is changed. Regards. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.