Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error on Step 5 [Kloxo with THT]
#1
Hello

First of all i would like to thank the Developers for making a Kloxo server scipt for billing. But i have an issue making this work.

I'm facing an issue at Step 5 of the order process. I can see the JQuery loader at step 5 load for a second and then shows up as "An error has occurred. Please inform your system administrator."

I've read the Wiki and older posts and they say that if the Server details were to be wrong this would happen.

Well I've followed the instructions on the Kloxo plugin read me

1) Edited Kloxo.php SSL Port to : 7777 ( i have SSL on my domain and enabled on kloxo) , changed DNSTemple to : mydomain.dnst ( assume mydomain is my domains DNStemplate)
2) I've installed THT, deleted Install folder, CHModed 444 to conf.inc.php.
3) Added a server with the following details :

Servername : <gave my servers name>
Server host : my FQDN - full TLD domain name.
Username : Created an Auxiliary login through kloxo > copied the .aux name to this field. > webhost.com_api.aux ( Assume webhost.com is my domain name and a reseller client.)
I've also tried a normal Admin client - username : api.aux
Password : Auxiliary login password.
Type : Kloxo ( I've uploaded this script in /bill/includes/servers/kloxo.php ( latest one 1.2 Final) (tried 1.0 also)

4) Created a package
a) Packages >add package
b) Name : <custom package name>
c) Backend: The internal name of the Resource plan from Kloxo goes like this > package___client-webhost.com ( Assume webhost.com is my domain name)
d) Gave a description>selected Server > Free>Add
e) Now on order page on completing all fields with all having " TICKED Marks" on step 5 i keep getting "An error has occurred. Please inform your system administrator."
f)I don't know if it has anything to do with lighttpd's URL rewriting rules.

My Server apps :
Lighttpd
Kloxo 6.1.10

Reply
#2
Hello. First of all, thanks for using my plugin Smile

The plugin error has nothing to do with the web server. You can run it on any, either Apache or LightTPD. It does not matter.

I would like the details of these:

1. What is the version of the plugin you are using? Did you download it recently as an attachment, or did you download it from an adf.ly link? If so, please use the newest version available as an attachment on the plugin thread.

2. Make sure that there are no spaces on the internal package name.

3. Did you do some debugging on the script?

4. Please do NOT use SSL. Use the default 7778 port for non-SSL, or use the non-SSL port you specified in Kloxo > Port Config. The plugin does not work on an SSL port yet.
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply
#3
Thank you for your reply Liam Smile

I've used the Adf.ly one which was version 1.0.0 and also now I've downloaded your latest version which was attached 1.2 . I've tried both .Oh well, since 1.0.0 didn't work for me, i'm guessing 1.2 wouldn't either.

I've re-verified my package name and there's no spaces anywhere at the start, in between or at the end of it . There's a long underscore just to indicate that i've created the package within a reseller account , and kloxo does that.

I've not debugged the script. I'm not sure how to Sad
Reply
#4
Please copy-paste the content of the kloxo.php file enclosed with the [CODE] BBCode so I can have a look.
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply
#5
I've changed to the Non SSL port now and tried still no luck at step 5

Code:
<?php

/**
* TheHostingTool :: Kloxo Server Class
* Created by Liam Demafelix (c) 2011
* http://www.rocketslice.com/
* Kloxo Class Version 1.0
**/

class kloxo {
    
    public $name = "Kloxo";
    public $hash = false;
    
    private $port = 7778;
    private $dnstemplate = "hostumble.dnst";
    
    
    private $server;
    
    private function serverDetails($server) {
        global $db;
        global $main;
        $query = $db->query("SELECT * FROM `<PRE>servers` WHERE `id` = '{$db->strip($server)}'");
        if($db->num_rows($query) == 0) {
            $array['Error'] = "That server doesn't exist!";
            $array['Server ID'] = $id;
            $main->error($array);
            return;    
        }
        else {
            return $db->fetch_array($query);
        }
    }
    
    private function remote($action) {
        $data = $this->serverDetails($this->server);
        
        $ip = gethostbyname($data['host']);
        
        // Build the Kloxo URI
        $serverstuff = "http://" . $data['host'] . ":" . $this->port . "/webcommand.php?login-class=auxiliary&login-name=" . $data['user'] . "&login-password=" . $data['accesshash'] . "&" . $action;
        
        // Connect
        /** As per THT team recommendation (by Kevin), this plugin now uses cURL to connect **/
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $serverstuff);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $data = curl_exec($ch);
        curl_close($ch);
        
        
        
        // Parse Data
        $data = htmlentities($data);
        
        // End
        
        if(strpos($data, "success") != false) {
            return true;
        }
        else {
            return false;
        }
        
    }
    
     public function GenUsername() {
                $t = rand(5,8);
                for ($digit = 0; $digit < $t; $digit++) {
                        $r = rand(0,1);
                        $c = ($r==0)? rand(65,90) : rand(97,122);
                        $user .= chr($c);
                }
                return $user;
        }
      
        public function GenPassword() {
                for ($digit = 0; $digit < 5; $digit++) {
                        $r = rand(0,1);
                        $c = ($r==0)? rand(65,90) : rand(97,122);
                        $passwd .= chr($c);
                }
                return $passwd;
        }
        
    public function signup($server, $reseller, $user = '', $email = '', $pass = '') {
                global $main;
                global $db;
                if ($user == '') { $user = $main->getvar['username']; }
                if ($email == '') { $email = $main->getvar['email']; }
                if ($pass == '') { $pass = $main->getvar['password']; }
                $this->server = $server;
                $data = $this->serverDetails($this->server);
                $ip = gethostbyname($data['host']);
                $string =   "action=add&class=client&name=". $user . "".
                                        "&v-password=". $pass ."".
                                        "&v-domain_name=". $main->getvar['fdom'] ."".
                                        "&v-dnstemplate_name=" . $this->dnstemplate ."".
                                        "&v-plan_name=". $main->getvar['fplan'] ."".
                                        "&v-send_welcome_f=off".
                                        "&v-contactemail=".$email."";
                // Reseller or Not?
                if($reseller) {
                        $string .= "&v-type=reseller";
                }
                else {
                        $string .= "&v-type=customer";
                }
                //echo $action."<br />". $reseller;
                $command = $this->remote($string);
                if($command == true) {
                        return true;      
                }
                else {
                      echo "An error has occurred. Please inform your system administrator.";
                       return false;
                    }
                
        }
        
        /**
         * Thanks to Days and Kevin for fixing the suspend, unsuspend and terminate functions
        **/
        
        public function suspend($user, $server, $reason = false) {
                $this->server = $server;
                $action = "action=update&subaction=disable&class=client&name=" . strtolower($user);
                return $this->remote($action);
        }
      
        public function unsuspend($user, $server) {
                $this->server = $server;
                $action = "action=update&subaction=enable&class=client&name=" . strtolower($user);
                return $this->remote($action);
        }
        public function terminate($user, $server) {
                $this->server = $server;
                $action = "action=delete&class=client&name=" . strtolower($user);
                return $this->remote($action);
        }
}
Reply
#6
Hello.

Try this first as yourself signing up for a test account. On step 5, you should receive a server response. Please reply back with the response. Replace the contents of kloxo.php with this one:

Code:
<?php

/**
* TheHostingTool :: Kloxo Server Class
* Created by Liam Demafelix (c) 2011
* http://www.rocketslice.com/
* Kloxo Class Version 1.0
**/

class kloxo {
    
    public $name = "Kloxo";
    public $hash = false;
    
    private $port = 7778;
    private $dnstemplate = "hostumble.dnst";
    
    
    private $server;
    
    private function serverDetails($server) {
        global $db;
        global $main;
        $query = $db->query("SELECT * FROM `<PRE>servers` WHERE `id` = '{$db->strip($server)}'");
        if($db->num_rows($query) == 0) {
            $array['Error'] = "That server doesn't exist!";
            $array['Server ID'] = $id;
            $main->error($array);
            return;    
        }
        else {
            return $db->fetch_array($query);
        }
    }
    
    private function remote($action) {
        $data = $this->serverDetails($this->server);
        
        $ip = gethostbyname($data['host']);
        
        // Build the Kloxo URI
        $serverstuff = "http://" . $data['host'] . ":" . $this->port . "/webcommand.php?login-class=auxiliary&login-name=" . $data['user'] . "&login-password=" . $data['accesshash'] . "&" . $action;
        
        // Connect
        /** As per THT team recommendation (by Kevin), this plugin now uses cURL to connect **/
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $serverstuff);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $data = curl_exec($ch);
        curl_close($ch);
        
        
        
        // Parse Data
        $data = htmlentities($data);
        var_dump($data);
        exit();
        // End
        
        if(strpos($data, "success") != false) {
            return true;
        }
        else {
            return false;
        }
        
    }
    
     public function GenUsername() {
                $t = rand(5,8);
                for ($digit = 0; $digit < $t; $digit++) {
                        $r = rand(0,1);
                        $c = ($r==0)? rand(65,90) : rand(97,122);
                        $user .= chr($c);
                }
                return $user;
        }
      
        public function GenPassword() {
                for ($digit = 0; $digit < 5; $digit++) {
                        $r = rand(0,1);
                        $c = ($r==0)? rand(65,90) : rand(97,122);
                        $passwd .= chr($c);
                }
                return $passwd;
        }
        
    public function signup($server, $reseller, $user = '', $email = '', $pass = '') {
                global $main;
                global $db;
                if ($user == '') { $user = $main->getvar['username']; }
                if ($email == '') { $email = $main->getvar['email']; }
                if ($pass == '') { $pass = $main->getvar['password']; }
                $this->server = $server;
                $data = $this->serverDetails($this->server);
                $ip = gethostbyname($data['host']);
                $string =   "action=add&class=client&name=". $user . "".
                                        "&v-password=". $pass ."".
                                        "&v-domain_name=". $main->getvar['fdom'] ."".
                                        "&v-dnstemplate_name=" . $this->dnstemplate ."".
                                        "&v-plan_name=". $main->getvar['fplan'] ."".
                                        "&v-send_welcome_f=off".
                                        "&v-contactemail=".$email."";
                // Reseller or Not?
                if($reseller) {
                        $string .= "&v-type=reseller";
                }
                else {
                        $string .= "&v-type=customer";
                }
                //echo $action."<br />". $reseller;
                $command = $this->remote($string);
                if($command == true) {
                        return true;      
                }
                else {
                      echo "An error has occurred. Please inform your system administrator.";
                       return false;
                    }
                
        }
        
        /**
         * Thanks to Days and Kevin for fixing the suspend, unsuspend and terminate functions
        **/
        
        public function suspend($user, $server, $reason = false) {
                $this->server = $server;
                $action = "action=update&subaction=disable&class=client&name=" . strtolower($user);
                return $this->remote($action);
        }
      
        public function unsuspend($user, $server) {
                $this->server = $server;
                $action = "action=update&subaction=enable&class=client&name=" . strtolower($user);
                return $this->remote($action);
        }
        public function terminate($user, $server) {
                $this->server = $server;
                $action = "action=delete&class=client&name=" . strtolower($user);
                return $this->remote($action);
        }
}
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply
#7
Thank you for that.

The output i get on step 5 is :

Code:
string(0) ""
Reply
#8
Hm.. Well. Can you PM me with an auxiliary account for your Kloxo server and THT? I'd like to take a look on things. I can't seem to define what the problem is.
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply
#9
Okay, i've PM'd you the details that you need.

Please do thee needful and sort this issue for me if possible Smile
Reply
#10
Yes, will do.
(facepalm) I enabled display_errors on your server, and guess what:

Warning: curl_exec() has been disabled for security reasons in /home/hostramp.tk/hostumble.com/bill/includes/servers/kloxo.php on line 51

So, a big LOL for that on my part Tongue Please enable curl_exec via the Kloxo admin panel and everything will work out perfectly.
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)