Jump to content

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


Blesta Addons

Recommended Posts

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 ;)

Link to comment
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 .

Link to comment
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 .

Link to comment
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:

Link to comment
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 ;
Link to comment
Share on other sites

  • 3 months later...

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);

 

Link to comment
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 :)

 

 

Link to comment
Share on other sites

  • 10 months later...

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);

 

Link to comment
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.

Link to comment
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

 

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
4 hours ago, Blesta Addons said:

where this few lines will be added to cpanel module, a small feature that need a 3 minutes of work waiting from 2016 !!!

i hope if the staff reserve a small patch fix to include all the small feature that don't need time or great effort to implement, just  few lines and is done .

I've bumped it up toward the top of the backlog, and we'll take a look at it soon.

Does the code snippet you posted above still work for you?

Link to comment
Share on other sites

4 hours ago, Paul said:

I've bumped it up toward the top of the backlog, and we'll take a look at it soon.

Does the code snippet you posted above still work for you?

Yes, the complete code :

		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);
		}
		
		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);

 

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
Reply to this topic...

×   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...