Jump to content

Does anyone know  what hook index has the IP Variable string in it?


Anders

Recommended Posts

Hi guys,

could somebody point me to the right direction please.
i want to get all the  new ip addresses that is created when a client create a new hosting account in whmcs.

So does anyone know  what hook index has the IP Variable string in it?

 

Warm regards Anders

 

Link to comment
Share on other sites

off-hand, I don't think any of them will directly - but the more important question is when/where do you want to get this information, because that determines the hook point to use, and hence what you have to work/start with.

either way, you're probably going to have to query the database, to get the value - whether that's the dedicated IP address in tblhosting, or the server IPs in tblservers.

Link to comment
Share on other sites

Hi Brian.

 

i am going to connect to an api like this example below, and i need the to get the server ip for a all new users not the dedicated. 

so you are saying that whmcs is not getting the clients IP at all? 

 

warm regards Anders

 

<?php

include __DIR__.'/jwudwApiClient.php';

use Dfudw\jwudw\jwudwApiClient;

// get "your_api_username" and "our_api_password" from your license and enter them here
// use this for premium/free licenses
$api = new jwudwApiClient('http://jwudw.com/api/', 'your_api_username', 'your_api_password');
// use this for enterprise licenses and change 'your-bulder-domain.com' to your builder domain
//$api = new jwudwApiClient('http://your-bulder-domain.com/api/', 'your_api_username', 'your_api_password');

try {
	// Note: parameter value types must match documentation
	// (ex.: parameter 'suborderId' type is Number, so "'suborderId' => 2410" is correct and "'suborderId' => '2410'" is incorrect )
	$res = $api->remoteCall('ipList', array(
		'suborderId' => 4310, // suborder ID from your license
		'action' => 'list' // list all added IP's
	));
	
	/*$res = $api->remoteCall('ipList', array(
		'suborderId' => 4310, // suborder ID from your license
		'action' => 'add', // add new IP
		'ip' => '0.0.0.0' // IP you want to add
	));*/
	
	/*$res = $api->remoteCall('ipList', array(
		'suborderId' => 4310, // suborder ID from your license
		'action' => 'delete', // remove IP
		'ip' => '0.0.0.0' // IP you want to remove
	));*/
	
	/*$res = $api->remoteCall('ipList', array(
		'suborderId' => 4310, // suborder ID from your license
		'action' => 'update', // update IP
		'ip' => '0.0.0.0', // IP you want to update
		'newIp' => '0.0.0.0' // new IP you want to set
	));*/
	
	if (!$res || !is_object($res)) {
		throw new ErrorException('Response format error');
	} else if (isset($res->ok) && $res->ok) {
		echo 'Request success: '.print_r($res, true);
	} else {
		throw new ErrorException((isset($res->error->message) && $res->error->message) ? $res->error->message : 'Unknown error');
	}
} catch(ErrorException $ex) {
	echo 'Request error: '.$ex->getMessage();
}

 

Link to comment
Share on other sites

19 minutes ago, Anders said:

i am going to connect to an api like this example below, and i need the to get the server ip for a all new users not the dedicated. 

when a hosting account is ordered, each hosting record in the database should include the server ID the account is hosted on - that value will relate to the id value in tblservers... and tblservers will contain the IP address for that particular server.

some pages in the client area would know the server being used, though not necessarily its IP addresses.

19 minutes ago, Anders said:

so you are saying that whmcs is not getting the clients IP at all? 

client IP? I thought we were talking about the server IP ??

Edited by brian!
Link to comment
Share on other sites

Hi Brian,

super thx for trying to help me, i am still looking for  some way to get the ip from server.

you are saying that tblservers will contain the IP address for that particular server. is it any hooks that have that string variable from the  tblserver?

warm regards 

Link to comment
Share on other sites

3 hours ago, Anders said:

you are saying that tblservers will contain the IP address for that particular server.

yes... if you know the server ID assigned to the hosting account, querying tblservers will give you the server IP, e.g by using capsule.

3 hours ago, Anders said:

is it any hooks that have that string variable from the  tblserver?

as I said, not that I can think of... but even if there were, you're thinking about it the wrong way round... when you want to do something determines the choice of hook, not what a hook can return.

Link to comment
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.

  • 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