Blesta Addons

Cpanel , Allow Staff To Choose Wich Server To Create The Account

19 posts in this topic

cpanel working well , but in a big companies the actual cpanel plugin need some tweaks .

actually, the module create account in the server selected in package , or if module groups created , the cpanel module use "first" methode free server to provision the account in it .  so no options for staff to choose wish server to host the account .

so , what i suggest a option to choose wish server to host the account , if not choosed then use the default method to host account .

when thinking in this request make in consideration a park of  5 or 30 servers dedicated to host website . and some times we need to make a manual activation for account in some servers .

another time v2,  was this option ;)

PauloV and John like this

Share this post


Link to post
Share on other sites

So you would like there to be an option when a service is manually created/activated by an admin for the module row to be specifically selected? Such as an option to Choose Module Row with values of "Use From Package" or choose one of the module rows from a list?

Blesta Addons likes this

Share this post


Link to post
Share on other sites

+1 for this .

 

when we have 1 server, it was no problem, but as now we have 2 servers , we should always check in wich server the cpanel was activated to change the domain dns . is a more task for our staff .

 

i want also a possibility to attach the name server of domain with the cpanel activated account .

Share this post


Link to post
Share on other sites

if anyone want add this to the cpanel module .

 

open cpanel.php module in getAdminAddFields function search

$fields = new ModuleFields();

under add the fallowing code

// Fetch all available server for this package
  $module_row = array() ;
  $rows = array() ;
  if (isset($package->module_group) && $package->module_group != "") {
   $rows = $this->getModuleRows($package->module_row);
  }
  else {
   $rows = $this->getModuleRows();   
  }
 
  foreach ($rows as $row){
   $module_row[$row->id] = $row->meta->server_name;
  }
   
  // Create Server label
  $cpanel_server = $fields->label(Language::_("Cpanel.module_row", true), "module_row_id");
  // Create Server field and attach to Server label
  $cpanel_server->attach($fields->fieldSelect("module_row_id",  $module_row , $this->Html->ifSet($vars->module_row_id , $package->module_row)  , array('id' => "module_row_id")));
  // Set the label as a field
  $fields->setField($cpanel_server);

this fucntion will respect the server group if set in package .

PauloV likes this

Share this post


Link to post
Share on other sites

also it would be nice to see it in edit mode .

 

sometimes we transfer site from server to another server , and we should update module row id also .

 

 

Good catch .

 

we do it like this now , transfer the site to new server . cancel the service in client side , create new service without use_module , with the same old info (domain/login/pass) , and then we change the renew date !!!

 

to step for us, and with your idea we will do it with 1 click :) ....

 

complete the favor and try to make a temprory fix for us :wub:

Share this post


Link to post
Share on other sites

the problem in getAdminEditFields()  is not returning the services info . and for that we can determine wich module_row_id are used .

 

maybe tyson can assist in how we get services info from getAdminEditFields() .

 

EDIT

 

the only solution is to add $service to the admin_clients byt changing

$service_fields = $module->getAdminEditFields($package, $vars);

to

$service_fields = $module->getAdminEditFields($package, $vars, $service);

we can see this as default in the core as improvement of the code ?

 

or add the service info to the $vars ?

$vars->service_fields = $service ;

Share this post


Link to post
Share on other sites

the code is no longer working after upgrade to 3.6.2 ... nos sure why , but the fallowing code will work .

		if (isset($vars->module_group) && $vars->module_group == "") {
			if (isset($vars->module_row) && $vars->module_row > 0) {
				$rows = $this->getModuleRow($vars->module_row);
			}
			else {
				$rows = $this->getModuleRows();
			}
		}
		else 
			// Fetch the 1st server from the list of servers in the selected group
			$rows = $this->getModuleRows($vars->module_group);

 

Licensecart likes this

Share this post


Link to post
Share on other sites

yep, same here. This isn't a deal breaker, but more of a workflow issue for my company. Sometimes you need to place a specific customer on a specific server... think for example managed vps where they only have access to the shared account, like a shared hosting customer. The "shared" account needs to be provisioned on the correct vps. 

 

Not being able to do that in Blesta adds 5-10 minutes to the actual process. It's easy to work around it, just a PITA :)

 

 

Share this post


Link to post
Share on other sites

any ETA for this small smal small fix :)

we have updated lated and we found this has been disappeared, is a pain to make every time a small patch

		// Fetch all available server for this package
		$module_row = [];
		if (isset($vars->module_group) && $vars->module_group == "") {
			if (isset($vars->module_row) && $vars->module_row > 0) {
				$module_row = $this->getModuleRow($vars->module_row);
			}
			else {
				$rows = $this->getModuleRows();
			}
		}
		else {
			// Fetch the 1st server from the list of servers in the selected group
			$rows = $this->getModuleRows($vars->module_group);
		}
		
		foreach ($rows as $row) {
			$module_row[$row->id] = $row->meta->server_name;
		}
  
		// Create Server label
		$cpanel_server = $fields->label(Language::_("Cpanel.module_row", true), "module_row_id");
		// Create Server field and attach to Server label
		$cpanel_server->attach(
			$fields->fieldSelect(
				'module_row_id',
				$module_row, 
				$this->Html->ifSet($vars->module_row_id, $package->module_row),
				['id' => 'module_row_id']
			)
		);
		// Set the label as a field
		$fields->setField($cpanel_server);

 

Joseph H likes this

Share this post


Link to post
Share on other sites

Related to this, it's possible to change the server assigned to a cPanel service when managing the service as an admin. This is useful in cases where the account was migrated from one server to another. However, only servers from the same server group can be selected. Do you think this should be updated to allow any server to be selected?

For example, if you have a server group called "Provisioning" and you have say 5 cPanel servers in it from which new accounts are assigned. But, you are moving an account from an older server to a newer server, the selector will not appear, or it will not allow you to select the new server which is in a different group. Show all instead? I hope that makes sense.

Share this post


Link to post
Share on other sites
16 hours ago, Paul said:

Related to this, it's possible to change the server assigned to a cPanel service when managing the service as an admin. This is useful in cases where the account was migrated from one server to another. However, only servers from the same server group can be selected. Do you think this should be updated to allow any server to be selected?

For example, if you have a server group called "Provisioning" and you have say 5 cPanel servers in it from which new accounts are assigned. But, you are moving an account from an older server to a newer server, the selector will not appear, or it will not allow you to select the new server which is in a different group. Show all instead? I hope that makes sense.

in edit mode , we can't change the assigned server, the probleme with the returned data . check my post

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now