Jump to content
Nelson Neoh

Retrieve Registrar credentials in registrar hook

Recommended Posts

Hi all,

I wish to perform some registrar API activities in the registrar hooks, but as the hook's vars or params didn't provide credential details, I tried to get direct from DB Capsule and unfortunately noticed the data stored in encrypted format...

Any suggestions to over come this?

TQ.

Best Regards,
Nelson

Share this post


Link to post
Share on other sites

Using the getRegistrarConfigOptions() function should provide that information in decrypted form -- though have not tested with latest versions.   You may need to include  includes/registrarfunctions.php for that to be available. 

Share this post


Link to post
Share on other sites
14 hours ago, string said:

You need to pass the encrypted string to the DecryptPassword API.

Thanks on the suggestion, will try this out.

4 hours ago, steven99 said:

Using the getRegistrarConfigOptions() function should provide that information in decrypted form -- though have not tested with latest versions.   You may need to include  includes/registrarfunctions.php for that to be available. 

@steven99 Do you have sample code to share the proper way to include these functional pages?  I used to get error and not very familiar on the WHMCS global variables when includes a php page.

 

Thanks you all in advanced.

Share this post


Link to post
Share on other sites

For including the file, you need to backtrack to where the file is located from the current directory that the current script is running in.  Can't post the code as the community web filter is blocking it but basically you would either backtrack using __DIR__ with a bunch of "/../../includes" .  There might be a constant or other method to get to the root directory of whmcs but don't recall right off.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By Jmac4444
      So I have done a little research and have possibly found that this error I am getting is from GoDaddy doing some changes to their API
      Does anyone have an Idea on how I could Adapt WHMCS to these changes?
      Here is the error I'm getting:

    • By Jmac4444
      Hello there, I have been connecting some domains on GoDaddy, with clients in WHMCS but when doing so I received this Error that I have never seen before.
      The client has one extra contact but that contacts information is all filled out so I'm not sure what "fields" this error is talking about. 
      Here is the error that I am seeing at the top of the screen

      Any help would be appreciated. Thanks!
    • By Mas-J
      Dear All,
      I want to show the Next Invoice Date under Next Due Date when admin access Page Client Details on Product/Services Tab.
      But, I've no idea how to show it, I just know to get the Next Invoice Date value related from tblhosting
      Anyone can help me to show it ? Thank you.
      <?php use WHMCS\Database\Capsule; add_hook('AdminClientServicesTabFields', 1, function($vars) { $PID = $vars['id']; $nextinvoicedate = Capsule::table('tblhosting')->where('id', $PID)->pluck('nextinvoicedate'); $result = array(); $result['nextinvoicedate'] = $nextinvoicedate; return $result });
       

    • By Trescpress
      Hello,
      I am working on a custom hook and I find that just by adding an input field of type Tel, the country code is added by WHMCS.
      I am basically showing a modal from my hook if a condition is met.
      Now I am testing the example code on the IntlTelInput plugin website (https://intl-tel-input.com/node_modules/intl-tel-input/examples/gen/default-country-ip.html)
      $(document).ready(function(){ var input = document.querySelector("#phone"); window.intlTelInput(input, { initialCountry: "auto", geoIpLookup: function(callback) { $.get("https://ipinfo.io", function() {}, "jsonp").always(function(resp) { var countryCode = (resp && resp.country) ? resp.country : "us"; callback(countryCode); }); }, }); }); <input type="tel" id="phone">  
      But that's returning an error:
      I basically want to sow the local country code in the form. is there a way to achieve this? bearing in mind that I am not in the tpl file, just echoing a modal from my hook.
    • By thisismatt
      Hey all
      On my WHMCS portal homepage beneath the domain search box I have 3 domain logos showing (ignore the sizing issue!) as per the below screenshot.

      However, when I click through to the pricing page I have all of my Spotlight TLDs visible, as per the second screenshot.

      My question is what controls which TLDs are shown on the homepage? Why is WHMCS showing only 3 (and those particular 3) on the homepage?
      Thanks
      Matt
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated