SiimpleScripts error ""Something is wrong!"

ejc

Registered
Apr 29, 2006
1
0
151
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!


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>.';
}
?>
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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!


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>.';
}
?>
cpanel tags are only useful if you are accessing this script via the cPanel interface (cpsrvd) rather than Apache. So you are correct in your assessment that this is pulling information from the cPanel environment.

You may want to consult with the maker of that script as it seems like it may be specialized to their cPanel plugin.
 

Larry_Oqobo

Registered
Sep 21, 2011
3
0
51
cPanel Access Level
Root Administrator
cpanel tags are only useful if you are accessing this script via the cPanel interface (cpsrvd) rather than Apache. So you are correct in your assessment that this is pulling information from the cPanel environment.

You may want to consult with the maker of that script as it seems like it may be specialized to their cPanel plugin.
Did you ever figure out the issue with your SimpleScripts and Somthing is wrong error?

Thanks.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator