| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/classicscash.com/public_html/MigScripts/ |
Upload File : |
<?php
// Connect to DarkReach NATS and create a new member on all sites
$sites_list = nats_api('GET', 'v1/site/site-list', ['tours' => 0]);
$user_data = [
'username' => 'miguelavstest',
'email' => 'geral@migueltavares.com',
'password' => 'M3nz0wnz888!',
'firstname'=> 'Miguel',
'lastname' => 'Tavares',
];
if( !empty($sites_list) ){
foreach( $sites_list as $site ){
$site_id = $site->siteid;
$user_data['siteid'] = $site_id;
echo '<pre>$user_data: ';
print_r($user_data);
echo '</pre>';
$insert_user = nats_api('POST', 'v1/member/manual', $user_data);
echo '<pre>$insert_user: ';
print_r($insert_user);
echo '</pre>';
}
}
function nats_api($method = 'GET', $endpoint = 'v1/site/site-list', $data = []){
$nats_api_url = 'https://darkreachcash.com';
$nats_username = 'absolute';
$nats_api_key = 'bb9bd08d538b15d6ed4b9c89ce48a72a';
$headers = array( //set your username and API key here
'api-key: ' . $nats_api_key,
'api-username: ' . $nats_username
);
$request = Array(
'method' => $method,
'path' => $endpoint,
'data' => $data
);
/*code below is the same for (almost) every API call */
$curl = curl_init();
$url = $nats_api_url.'/api/'.$request['path'];
$query = http_build_query($request['data']);
if($request['method'] == 'GET'){
$url = $url.'?'.$query;
} else {
//send parameters as POST fields
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
if($request['method'] != 'POST'){
$headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method
}
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($curl);
$response = json_decode($resp);
// Close request to clear up some resources
curl_close($curl);
return $response;
}