Jump to content
  • 0

Sync Existing Account From Cpanel And Kloxomr


mas.satriyo

Question

Hi,

really interested with blesta, reasonable price but rich features

 

i was running two hosting business before,

- 'closed-market' hosting for my relatives and family using kloxomr as hosting control panel and no billing system

- regular hosting service for everyone using cpanel and boxbilling

 

i want to move both my business to blesta (currently i'm using trial version of blesta since last night), but i found some problems here

 

1. how to move my existing clients from boxbilling to blesta? can't find any modules/plugins. i found that blesta has import manager plugin but only for whmcs 5.2 and blesta 2.5, not from boxbilling

 

2. how to sync my existing clients in cpanel?

i tried to create the same username, same domain, same email and same package but blesta couldn't sync existing account. i had to delete existing account from cpanel and re-create from blesta. is there any simple method?

 

3. where is kloxo/lxadmin module?

i found this thread from old lxadmin forum, http://forum.lxcenter.org/index.php?t=msg&th=14144&

it shows blesta kloxo integration module but i cant find it in available modules page

 

thanks

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0

1. how to move my existing clients from boxbilling to blesta? can't find any modules/plugins. i found that blesta has import manager plugin but only for whmcs 5.2 and blesta 2.5, not from box billing

There's no BoxBilling importer yet so you have to do it manually, I don't think any paid systems have a importer for that rubbish :).

 

2. how to sync my existing clients in cpanel?

i tried to create the same username, same domain, same email and same package but blesta couldn't sync existing account. i had to delete existing account from cpanel and re-create from blesta. is there any simple method?

You can't you have to make them manually and un-tick use module (else it will try and make the account).

 

3. where is kloxo/lxadmin module?

i found this thread from old lxadmin forum, http://forum.lxcenter.org/index.php?t=msg&th=14144&

it shows blesta kloxo integration module but i cant find it in available modules page

That's Blesta 2.5 not 3.0 and I don't believe anyone has made one for Blesta 3.0 and there's no feature request for one yet, it's not secure either so I don't recommend you use it.

Link to comment
Share on other sites

  • 0

There's no BoxBilling importer yet so you have to do it manually, I don't think any paid systems have a importer for that rubbish :).

 

You can't you have to make them manually and un-tick use module (else it will try and make the account).

okay, i'll try

 

That's Blesta 2.5 not 3.0 and I don't believe anyone has made one for Blesta 3.0 and there's no feature request for one yet, it's not secure either so I don't recommend you use it.

 

Actually i'm not using the old Kloxo/LxAdmin but KloxoMR

its v6.5 is based on Kloxo but it's v7.x is brand new with improvised features and in active development

i've been using kloxomr about two years

 

the developer mustafa ramadhan said that kloxomr still has same api like kloxo/lxadmin

where i can get that old module for blesta 2.5?

 

thanks

Link to comment
Share on other sites

  • 0

okay, i'll try

 

 

Actually i'm not using the old Kloxo/LxAdmin but KloxoMR

its v6.5 is based on Kloxo but it's v7.x is brand new with improvised features and in active development

i've been using kloxomr about two years

 

the developer mustafa ramadhan said that kloxomr still has same api like kloxo/lxadmin

where i can get that old module for blesta 2.5?

 

thanks

 

 

I don't trust KloxoMR 100% http://www.webhostingtalk.com/showthread.php?t=1492797&p=9477912#post9477912

 

And a 2.5 module won't work on a 3.0 since it's completely different.

Link to comment
Share on other sites

  • 0

Yeah, looks like you'll need a KloxoMR module for Blesta.

 

In the meantime, you could use the Universal Module, it just won't automatically provision, suspend, etc. Would work ok if you manually approve orders. There are some developers on the forums here that may be able to help you write the module if you like. We have had very few requests for Kloxo.

Link to comment
Share on other sites

  • 0

Yeah, looks like you'll need a KloxoMR module for Blesta.

 

In the meantime, you could use the Universal Module, it just won't automatically provision, suspend, etc. Would work ok if you manually approve orders. There are some developers on the forums here that may be able to help you write the module if you like. We have had very few requests for Kloxo.

 

Hi Paul,

i still don't understand creating order form with universal module

the example in https://docs.blesta.com/display/user/Universal+Module still too general

can you give some explicit example?

 

thank you

Link to comment
Share on other sites

  • 0

Hi Paul,

i still don't understand creating order form with universal module

the example in https://docs.blesta.com/display/user/Universal+Module still too general

can you give some explicit example?

 

thank you

First you need to go to Settings-->Module--->Universal Module and click "menage".and add product .This product you will select latter in package creation process.All fields except name are optional and you can use to configure package and service,If you need just order and billing automation for something than you can add product with just name,when it comes to web hosting you can name it for example Kloxo hosting,in service option you would probably want add filed with label "Domain" and chose  text as type..name is hidden and you can just use 1 for first field..2 for second..etc and in this field client would set domain he want to host on your server.

In service option you can ask information you need for that service/product

In package option you can add more package options client can chose..like dedicated IP..or...anything.

After you set product you will go and add new package..in module drop down menu you will select "universal module"..than you will see one more field "product"..there you will select product you just configure.

Link to comment
Share on other sites

  • 0

First you need to go to Settings-->Module--->Universal Module and click "menage".and add product .This product you will select latter in package creation process.All fields except name are optional and you can use to configure package and service,If you need just order and billing automation for something than you can add product with just name,when it comes to web hosting you can name it for example Kloxo hosting,in service option you would probably want add filed with label "Domain" and chose  text as type..name is hidden and you can just use 1 for first field..2 for second..etc and in this field client would set domain he want to host on your server.

In service option you can ask information you need for that service/product

In package option you can add more package options client can chose..like dedicated IP..or...anything.

After you set product you will go and add new package..in module drop down menu you will select "universal module"..than you will see one more field "product"..there you will select product you just configure.

 

 

 

hi,

 

i got a problem with 'Input Rules'

 

tried to add dedicated server service and i have three variables in 'Service Options', 

- label 1 = hostname  (name 1 = dedi_hostname)

- label 2 = username  (name 2 = dedi_username)

- label 3 = ssh-key (name 3 = dedi_sshkey)

 

i want these rules

- hostname can't be empty

- user can't use 'Root' as username, user have to choose username other than 'Root'

- ssh-key can't be empty

 

i put these lines in 'Input Rules'

{
"dedi_hostname":{
    "valid":{
        "rule":"isEmpty",
        "negate":true,
        "message":"Hostname must not be empty !"
    }
},
"dedi_sshkey":{
    "valid":{
        "rule":"isEmpty",
        "negate":true,
        "message":"SSH Key must not be empty !"
    }
},

"dedi_username":{
    "format":{
        "rule":["compares","==","root"],
        "message":"Username must be other than root!"
    }
}

}

 

but none of them works

hostname still can be empty, root is still possible as username, and ssh key can be empty

 

thank you for your help

Link to comment
Share on other sites

  • 0

Edit I just try this and it work

{"dedi_hostname":{
    "valid":{
        "rule":"isEmpty",
        "negate":true,
        "message":"Hostname must not be empty"
    }
}}  
{"dedi_sshkey":{
    "valid":{
        "rule":"isEmpty",
        "negate":true,
        "message":"SSH Key must not be empty"
    }
}}

Will try third now

Link to comment
Share on other sites

  • 0

Here is working one for username..as you see you need to set !==  between. Your sentece was not also correct but even if it was correct username root would pass because your rule compare IS dedi_username == root .....and  because it is positive system return true...so username pass... in my case system check is username != than root..and  every time it is different system will return true..so it will pass only when != root(not same as root)

{"dedi_username":{
    "format":{
        "rule":["compares","!==","root"],
        "message":"Username must be other than root!"
    }
}}
Link to comment
Share on other sites

  • 0

still a bit confuse between ' !== ' and ' != '

 

here is my code

{"dedi_username":{
    "format":{
        "rule":["compares","!=","root"],
        "message":"Username must be other than root!"
    }
}}

and it won't pass 'root' as username

In comparation...it will pass as long it is true...and will not pass if it is false..

So if you ask Is root username you insert  equal/indentical as root ....system will return true and it will pass...oposite what you want...so you want to ask is user name root you just insert different than root...than system will return false and it will not pass  OR it will pass every time it is not root...so this is what you want

 

 

When it comes logical  operators... == equal ... === identical            != not equal ... !== not identical...

For example 9 == 09  is true because 9 and 09 are equal/same number.. but 9 === 09 is false because 9 and 09 are not identical  ..so it depend what you want..in your case both will work

Link to comment
Share on other sites

  • 0

FYI, explanation of operators.

{"dedi_username":{
    "format":{
        "rule":["compares","!=","root"],
        "message":"Username must be other than root!"
    }
}}

That rule basically means that the module expects a field "dedi_username" to be given. The value of that field must not be "root", otherwise an error will be encountered and the message, "Username must be other than root!" will be displayed.

 

Information on rules is described in Error Checking. While this page lists example rules in php, and the Universal Module (and your rule above) use JSON, the only difference is in formatting.

Link to comment
Share on other sites

  • 0

Yeah, looks like you'll need a KloxoMR module for Blesta.

 

In the meantime, you could use the Universal Module, it just won't automatically provision, suspend, etc. Would work ok if you manually approve orders. There are some developers on the forums here that may be able to help you write the module if you like. We have had very few requests for Kloxo.

 

hi paul,

can you give me the old blesta kloxo module?

just wanna try to recreate the module for blesta 3  :blesta:

thanks

Link to comment
Share on other sites

  • 0

hi paul,

can you give me the old blesta kloxo module?

just wanna try to recreate the module for blesta 3  :blesta:

thanks

 

 

it a one class file ... this is the content

<?php
/*******************************************************************************
 @name Kloxo Module (AKA LXAdmin)
 @author Cody Phillips
 @date May 12, 2009
 @version 1.0
 @notes For use with Blesta version 1.0.0+
*******************************************************************************/

class kloxo implements ModuleInterface {
	private static $module;

	public function __construct() {
		// Adds a new Kloxo that can be added, edited, or deleted
		self::$module = new Module("kloxo", true, true, true);

		// Adds the given fields to the database for this module if it has not already
		// been created. WARNING: if the module has already been created with the name
		// given in the Module constructor you must delete the old module before the
		// new one will be created. This may have an adverse effect on services.
		self::$module->addDBField("varchar(255)", "server", "Server");
		self::$module->addDBField("varchar(255)", "dnstemplate", "DNS Template");
		self::$module->addDBField("varchar(255)", "user", "User Name");
		self::$module->addDBField("varchar(255)", "password", "Password");
		self::$module->addDBField("varchar(5)", "usessl", "Use SSL", "false");
		self::$module->addDBField("int(11)", "max", "Limit", "0");
		self::$module->addDBField("int(11)", "cur", "Current", "0");

		// Options for creating a new module row
		// Example: Kloxo module may store multiple different servers. The HTML Fields below
		// allow you to create/edit a server for the Kloxo module
		// NOTE: The HTML Fields will appear in the order defined here on the module setup/edit pages
		self::$module->addModuleHTMLField("text", "Server", "server");
		self::$module->addModuleHTMLField("text", "DNS Template", "dnstemplate");
		self::$module->addModuleHTMLField("text", "User Name", "user");
		self::$module->addModuleHTMLField("text", "Password", "password");
		self::$module->addModuleHTMLField("select", "Use SSL", "usessl");
		self::$module->addModuleHTMLSelectOption("usessl", "Yes", "true");
		self::$module->addModuleHTMLSelectOption("usessl", "No", "false");
		self::$module->addModuleHTMLField("text", "Account Limit", "max", "^[0-9]+", "Account Limit must be an integer.");
		self::$module->addModuleHTMLField("text", "Current Accounts", "cur", "^[0-9]+", "Current Accounts must be an integer.");
		
		// Module Options while creating a package with this module
		// NOTE: Only one field is accepted of this type and must be named "mstring"
		self::$module->addPackageHTMLField("text", "Plan Name", "mstring", "^(.)+$", "You must enter a plan name.");
		
		// This adds a note to be displayed along with the above package field
		self::$module->addPackageNote("mstring", "Plan Name (ex. bronze)");
		
		// Specify which field from the module table to display in the drop down and give it a friendly name
		// By default items will be shown by ID and have the friendly name of "Module ID".
		// This appears when adding or editing a service for a user.
		self::$module->setModuleRowSelect("DNS Template", "dnstemplate");
		
		// These are shown as column names for each service of this type.
		self::$module->addServiceColumn("user1", "Domain");
		self::$module->addServiceColumn("user2", "Username");
		self::$module->addServiceColumn("pass", "Password");
		self::$module->addServiceColumn("dnstemplate", "DNS Template");
		
		// These are displayed as tags and are usable when creating/editing a package's welcome e-mail
		self::$module->addServiceTag("user1", "domain");
		self::$module->addServiceTag("user2", "username");
		self::$module->addServiceTag("pass", "pass");
		self::$module->addServiceTag("term", "term");
		
		// These are the fields that may be edited when performing a local edit on this service
		self::$module->addServiceEditField("user1", "Domain");
		self::$module->addServiceEditField("user2", "Username"); // Client username
		self::$module->addServiceEditField("pass", "Password");
		self::$module->addServiceEditField("plan", "Package/Term"); // Package/Term
		self::$module->addServiceEditField("dnstemplate", "DNS Template");
		self::$module->addServiceEditField("dated", "Date Deleted");
		self::$module->addServiceEditField("datep", "Date Suspended");
		self::$module->addServiceEditField("dater", "Date Renews");
		self::$module->addServiceEditField("notes", "Notes");
		
		// Fields that are shown to the admins when adding a service that uses this module.
		self::$module->addServiceHTMLField("text", "Domain Name", "user1", "^[a-z0-9._%-]+\.[a-z]{2,6}$", "The domain you entered does not appear to be valid. It should be lowercase and in the format: domain.com.");
		self::$module->addServiceHTMLField("text", "Password", "pass", "^.{4,16}$", "Passwords must be between 4 and 16 characters.");
		
		// Fields that are shown to the user when adding a service that uses this module.
		self::$module->addUserServiceHTMLField("text", "Domain Name", "user1", "^[a-z0-9._%-]+\.[a-z]{2,6}$", "The domain you entered does not appear to be valid. It should be lowercase and in the format: domain.com.");
		self::$module->addUserServiceHTMLField("text", "Password", "pass", "^.{4,16}$", "Passwords must be between 4 and 16 characters.");
		
		
		// Creates the module, adds the module to the database if the module table does not
		// already exist. WARNING: if a module has already been created and you attempt to
		// add additional fields they WILL NOT BE ADDED, and any refrence to those fields
		// WILL RESULT IN AN ERROR.
		self::$module->createModule();
	}

	/**
	 * Returns the module object, this function MUST be present
	 */
	public function getModule() {
		return self::$module;
	}
	
	/**
	 * This is the MAGIC function. This function automatically creates a service
	 * for a user. 
	 *
	 * IT MUST BE DEFINED HERE OR AN E-MAIL WILL BE SENT TO ALL SUBSCRIBED ADMINS
	 * NOTIFYING THEM THAT THE SERVICE MUST BE MANUALLY CREATED.
	 *
	 * IF THIS FUNCTION IS DEFINED AND RETURNS TRUE IT IS ASSUMED THAT IT PERFORMS
	 * THE NECCESSARY ACTIONS TO AUTOMATICALLY ACTIVATE THE SERVICE.
	 */
	public function promodule($action, $serviceInfo, $packageInfo) {
		// packageInfo comes from packagesetinfos() function
		$plan = $packageInfo[4][2];
		
		$conditions = array(array("field" => "id", "value" => $serviceInfo['mid']));
		$data = self::$module->getRows($conditions);
		
		$serviceInfo['dnstemplate'] = $data[0]['dnstemplate'];
		$serviceInfo['plan'] = $plan;

		switch ($action) {
			case "add":
				// Ensure we do not exceed the maximum number of accounts for this server.
				if ($data[0]['cur'] >= $data[0]['max'])
					return false;
				
				$serviceInfo['user2'] = self::makeUserName($serviceInfo['user1']);
				
				if (DEMO)
					return $serviceInfo;
				elseif ($this->addClient($serviceInfo, $data)) {
					// Update the current number of accounts on this server
					self::$module->updateDBFields("cur", $data[0]['cur']+1, $serviceInfo['mid']);
				
					return $serviceInfo;  // return the info that we want to be inserted into the services table
				}
				break;
			case "remove":
				if (DEMO)
					return true;
				elseif ($this->removeClient($serviceInfo['user2'], $data)) {
					// Update the current number of accounts on this server
					self::$module->updateDBFields("cur", $data[0]['cur']-1, $serviceInfo['mid']);
					
					return true;
				}
				break;
			case "suspend":
				if (DEMO)
					return true;
				return $this->suspendClient($serviceInfo['user2'], $data);
				break;
			case "unsuspend":
				if (DEMO)
					return true;
				return $this->unsuspendClient($serviceInfo['user2'], $data);
				break;
		}

		return false;
	}


	/**
	 * Add a client to the VPS system
	 *
	 */
	private function addClient(&$serviceInfo, &$data) {
		$params = array();
		$params['login-class'] = "client";
		$params['login-name'] = $data[0]['user'];
		$params['login-password'] = $data[0]['password'];
		$params['output-type'] = "json";
		
		$params['class'] = "client";
		$params['name'] = $serviceInfo['user2'];
		$params['action'] = "add";
		$params['v-password'] = $serviceInfo['pass'];
		$params['v-type'] = "customer";
		$params['v-plan_name'] = $serviceInfo['plan'];
		$params['v-domain_name'] = $serviceInfo['user1'];
		$params['v-dnstemplate_name'] = $serviceInfo['dnstemplate'];
		
		return $this->request($data[0]['server'], $data[0]['usessl'], $params);
	}

	/**
	 * Remove a client from the VPS system
	 *
	 */
	private function removeClient(&$username, &$data) {
		$params = array();
		$params['login-class'] = "client";
		$params['login-name'] = $data[0]['user'];
		$params['login-password'] = $data[0]['password'];
		$params['output-type'] = "json";
		
		$params['class'] = "client";
		$params['name'] = $username;
		$params['action'] = "delete";
		
		return $this->request($data[0]['server'], $data[0]['usessl'], $params);
	}

	/**
	 * Suspend a client on the VPS system
	 *
	 */
	private function suspendClient(&$username, &$data) {
		$params = array();
		$params['login-class'] = "client";
		$params['login-name'] = $data[0]['user'];
		$params['login-password'] = $data[0]['password'];
		$params['output-type'] = "json";
		
		$params['class'] = "client";
		$params['name'] = $username;
		$params['action'] = "update";
		$params['subaction'] = "disable";
		
		return $this->request($data[0]['server'], $data[0]['usessl'], $params);
	}

	/**
	 * Unsuspend a client on the VPS system
	 *
	 */
	private function unsuspendClient(&$username, &$data) {
		$params = array();
		$params['login-class'] = "client";
		$params['login-name'] = $data[0]['user'];
		$params['login-password'] = $data[0]['password'];
		$params['output-type'] = "json";
		
		$params['class'] = "client";
		$params['name'] = $username;
		$params['action'] = "update";
		$params['subaction'] = "enable";
		
		return $this->request($data[0]['server'], $data[0]['usessl'], $params);
	}

	/*
	* Prepares and executes a CURL request that performs Kloxo API request
	* @return response
	*/
	private function request($host, &$usessl, &$params) {
		// Log data received from Kloxo
		self::$module->logData($params, "input", true);
		
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, "http" . ($usessl == "true" ? "s" : "") . "://" . $host . "/webcommand.php");
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
		
		$response = (array)json_decode(curl_exec($ch));
		curl_close($ch);
		
		// Log data received from Kloxo
		self::$module->logData($response, "output", ($response['return'] == "success" ? true : false)); 
		
		if ($response['return'] == "success")
			return true;
		return false;
	}
	
	// Creates a username that is between 5 and 8 characters long
	// Usernames that are generated randomly are 7 characters in length
	private static function makeUserName($domain) {
		// Remove everything except letters from the domain
		$temp = preg_replace('/[^a-zA-Z]/', '', $domain);
		
		// If what we have left to build the username is less than 5 characters
		// add in some random characters to create a unique username.
		if (strlen($temp) < 5) {
			// Add 3-random characters followed by the rest of temp.
			$chars = array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t',
			'u','v','w','x','y','z');
			$count = count($chars) - 1;
			
			for ($i=0; $i<3; $i++)
				$temp = $chars[rand(0, $count)] . $temp;
		}
		
		return substr($temp, 0, 8);
	}
}
?>
Link to comment
Share on other sites

  • 0

Bantu jawab ya pakde

 

Saya sudah coba blesta dan lumayan lah, dengan harganya, dan fiturnya juga lumayan.

 

Saya migrasi dari whmcs - blesta tapi manual,

ya hitung2 disatu sisi saya mau lihat stabil tidak, cocok tidaknya blesta ini.

Dan ternyata software ini cukup membantu lah pakde.

 

cara transfernya pun gampang pakde

tinggal pakde buat user -> add service. -> change renew update untuk mengubah kapan service expired

 

Hal tersebut juga sama untuk akun-akun cpanel dan domain pakde.

 

Nah, untuk kloxo ini saya ga pernah pake pakde.

 

Kelemahannya disini pakde

We cant find Domain checker for *.id extention, even though its very important if blesta wanna go to indonesian market

 

Ya, sabar-sabar aja lah pakde.. :D

 

Maaf bahasa inggrisnya jelek :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...