Hi.
I'm getting this error... I'm pasting below the code. I put in the host key and api key, but it looks like the other fields that it says are required are supposed to be fetched from cpanel.
Any suggestions would be appreciated!
I'm getting this error... I'm pasting below the code. I put in the host key and api key, but it looks like the other fields that it says are required are supposed to be fetched from cpanel.
Any suggestions would be appreciated!
Code:
<?php
/*
Client Login API
Documentation: https://www.simplescripts.com/articles/client_login
This file should be used to pre-authenticate users and redirect them to the main account page of SimpleScripts, where all installations are displayed and users will have single click Install Now buttons. If you only want to send users to a login page, please review https://www.simplescripts.com/host/integration.
*/
/* EDIT THE FOLLOWING VALUES WITH YOUR OWN CLIENT INFORMATION (ALL VALUES REQUIRED)
(Existing values are for cpanel, minus the user and password. Values should be initialized in the header template file)
*/
$my_request = array(
//available at simplescripts.com/host/integrate
"host_key" => 'YOUR HOST KEY',
//available at simplescripts.com/host/integrate
"host_api_key" => 'YOUR HOST API KEY',
//we need something that won't change to keep account continuity, such as the account username, or an account id if the username changes constantly.
"user_unique" => '<cpanel print="$CPDATA{'USER'}">',
//main domain name, minus www.
"user_domain" => '<cpanel print="$CPDATA{'DNS'}">',
//ftp ip address (can be different than the domain/box ip)
"user_ip" => '<cpanel print="$CPDATA{'IP'}">',
"user_email" => '<cpanel print="$CPDATA{'CONTACTEMAIL'}">',
"user_username" => '<cpanel print="$CPDATA{'USER'}">',
"user_password" => '<cpanel print="$password">',
);
/* STOP EDITING HERE */
if ($my_request['host_key'] == "YOUR HOST KEY") { die("SimpleScripts is Coming Soon!"); }
$my_request_str = "";
foreach ($my_request as $key => $value) { $my_request_str.= $key."=".urlencode($value)."&"; }
ob_start();
passthru('curl -k https://www.simplescripts.com/api/client_login.php --data "'.rtrim($my_request_str,"& ").'" --max-time 60');
$response = ob_get_contents();
ob_end_clean();
$parts = explode("|",$response);
if ($parts[0] != "1") { die("Something is wrong! Please refresh this page.<br />\n".$parts[1]); }
else {
print '<meta http-equiv="refresh" content="0;url='.$parts[1].'"/>';
print 'Redirecting to <a href="'.$parts[1].'">SimpleScripts</a>.';
}
?>