From 32dcc8752f280299f0e364ccebcc092db8f2cb4e Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Tue, 05 Apr 2016 12:17:42 -0400
Subject: [PATCH] Changed autodetect messages from WARN to INFO in non forced mode.

---
 interface/lib/classes/remote.d/sites.inc.php |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/interface/lib/classes/remote.d/sites.inc.php b/interface/lib/classes/remote.d/sites.inc.php
index f4e6a79..22c1657 100644
--- a/interface/lib/classes/remote.d/sites.inc.php
+++ b/interface/lib/classes/remote.d/sites.inc.php
@@ -127,9 +127,9 @@
 
 			$this->id = 0;
 			$this->dataRecord = $params;
-			$app->sites_database_plugin->processDatabaseInsert($this);
 
 			$retval = $this->insertQueryExecute($sql, $params);
+			$app->sites_database_plugin->processDatabaseInsert($this);
 			
 			// set correct values for backup_interval and backup_copies
 			if(isset($params['backup_interval']) || isset($params['backup_copies'])){
@@ -266,12 +266,12 @@
 
 		$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_user_id = ?", $primary_id);
 		foreach($records as $rec) {
-			$app->db->datalogUpdate('web_database', 'database_user_id=NULL', 'database_id', $rec['database_id']);
+			$app->db->datalogUpdate('web_database', array('database_user_id' => null), 'database_id', $rec['database_id']);
 
 		}
 		$records = $app->db->queryAllRecords("SELECT database_id FROM web_database WHERE database_ro_user_id = ?", $primary_id);
 		foreach($records as $rec) {
-			$app->db->datalogUpdate('web_database', 'database_ro_user_id=NULL', 'database_id', $rec['database_id']);
+			$app->db->datalogUpdate('web_database', array('database_ro_user_id' => null), 'database_id', $rec['database_id']);
 		}
 
 		return $affected_rows;
@@ -405,7 +405,7 @@
 			return false;
 		}
 		$app->uses('remoting_lib');
-		$app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php');
+		$app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php');
 		return $app->remoting_lib->getDataRecord($primary_id);
 	}
 
@@ -434,7 +434,7 @@
 		if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
 		if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
 
-		$domain_id = $this->insertQuery('../sites/form/web_domain.tform.php', $client_id, $params, 'sites:web_domain:on_after_insert');
+		$domain_id = $this->insertQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $params, 'sites:web_domain:on_after_insert');
 		if ($readonly === true)
 			$app->db->query("UPDATE web_domain SET `sys_userid` = '1' WHERE domain_id = ?", $domain_id);
 		return $domain_id;
@@ -454,7 +454,7 @@
 		if($params['pm_min_spare_servers'] == '') $params['pm_min_spare_servers'] = 1;
 		if($params['pm_max_spare_servers'] == '') $params['pm_max_spare_servers'] = 1;
 
-		$affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php', $client_id, $primary_id, $params);
+		$affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', $client_id, $primary_id, $params);
 		return $affected_rows;
 	}
 
@@ -465,7 +465,7 @@
 			throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
 			return false;
 		}
-		$affected_rows = $this->deleteQuery('../sites/form/web_domain.tform.php', $primary_id);
+		$affected_rows = $this->deleteQuery('../sites/form/web_vhost_domain.tform.php', $primary_id);
 		return $affected_rows;
 	}
 
@@ -864,11 +864,11 @@
 			} else {
 				$status = 'n';
 			}
-			$app->remoting_lib->loadFormDef('../sites/form/web_domain.tform.php');
+			$app->remoting_lib->loadFormDef('../sites/form/web_vhost_domain.tform.php');
 			$params = $app->remoting_lib->getDataRecord($primary_id);
 			$params['active'] = $status;
 			
-			$affected_rows = $this->updateQuery('../sites/form/web_domain.tform.php', 0, $primary_id, $params);
+			$affected_rows = $this->updateQuery('../sites/form/web_vhost_domain.tform.php', 0, $primary_id, $params);
 			return $affected_rows;
 		} else {
 			throw new SoapFault('status_undefined', 'The status is not available');
@@ -931,7 +931,7 @@
 			return false;
 		}
 	
-		if ($action_type != 'backup_download' and $action_type != 'backup_restore') {
+		if ($action_type != 'backup_download' and $action_type != 'backup_restore' and $action_type != 'backup_delete') {
 			$this->server->fault('invalid_action', "Invalid action_type $action_type");
 			return false;
 		}
@@ -980,6 +980,21 @@
 		return $app->quota_lib->get_trafficquota_data($client_id, $lastdays);
 	}
 	
+	public function ftptrafficquota_data($session_id, $client_id, $lastdays = 0)
+	{
+		global $app;
+		$app->uses('quota_lib');
+		
+		if(!$this->checkPerm($session_id, 'trafficquota_get_by_user')) {
+			$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+			return false;
+		}
+		if ($client_id != null)
+			$client_id = $app->functions->intval($client_id);
+		
+		return $app->quota_lib->get_ftptrafficquota_data($client_id, $lastdays);
+	}
+	
 	public function databasequota_get_by_user($session_id, $client_id)
 	{
 		global $app;

--
Gitblit v1.9.1