View Single Post
  #2  
Old 1st April 2013, 20:55
abdi abdi is offline
Senior Member
 
Join Date: Sep 2012
Posts: 117
Thanks: 0
Thanked 10 Times in 6 Posts
Default Solution to the problem

My suggested solution to that problem is as follows:

In the API lib file "/usr/local/ispconfig/interface/lib/classes/remoting.inc.php"

I have introduced a new variable called update_stats_password which a user should set to 1 if they wish to update a stats_password. Otherwise by default its removed from the array to avoid messing up the preset stats_password .

Below is my updated function suggesting to be added to the next update if its OK.

Code:
//* Update a record
	public function sites_web_domain_update($session_id, $client_id, $primary_id, $params)
    {
		if(!$this->checkPerm($session_id, 'sites_web_domain_update')) {
			$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
			return false;
		}
		
		//* Set a few defaults for nginx servers
		if($params['pm_max_children'] == '') $params['pm_max_children'] = 1;
		if($params['pm_start_servers'] == '') $params['pm_start_servers'] = 1;
		if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
		if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
		
		//* Added by Abdi Joseph
		if($params['update_stats_password'] != '1') unset($params['stats_password']);
		
		$affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php',$client_id,$primary_id,$params);
		return $affected_rows;
	}
Any suggestions or comments are welcome ...

Abdi Joseph

Last edited by abdi; 1st April 2013 at 20:57.
Reply With Quote