The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SiimpleScripts error ""Something is wrong!"

Discussion in 'cPanel Developers' started by ejc, Mar 14, 2012.

  1. ejc

    ejc Registered

    Joined:
    Apr 29, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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>.';
    }
    ?> 
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    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.
     
  3. Larry_Oqobo

    Larry_Oqobo Registered

    Joined:
    Sep 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Did you ever figure out the issue with your SimpleScripts and Somthing is wrong error?

    Thanks.
     
  4. Larry_Oqobo

    Larry_Oqobo Registered

    Joined:
    Sep 21, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Did you ever figure out the issue with your SimpleScripts and Somthing is wrong error?

    Thanks.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page