From b42be8afbd0e927aa6db46a198e8dcecd0fb92b0 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 28 Jul 2010 10:53:53 -0400
Subject: [PATCH] Created branch for ISPConfig 3.0.3 stable releases.

---
 interface/lib/classes/remoting.inc.php |   35 ++++++++++++++++++++++++++++++++---
 1 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 1a9c351..6ae0d16 100644
--- a/interface/lib/classes/remoting.inc.php
+++ b/interface/lib/classes/remoting.inc.php
@@ -122,6 +122,29 @@
         return ($app->db->affectedRows() == 1);
 	}
 	
+	// Get server details
+        /**
+        Gets the server configuration
+        @param int session id
+        @param int server id
+        @param string  section of the config field in the server table. Could be 'web', 'dns', 'mail', 'dns', 'cron', etc
+        @author Julio Montoya <gugli100@gmail.com>
+        */
+    public function server_get($session_id, $server_id, $section ='') {
+        global $app;        
+        if(!$this->checkPerm($session_id, 'server_get')) {
+            $this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
+            return false;
+        }
+        if (!empty($session_id) && !empty($server_id)) {    
+            $app->uses('remoting_lib , getconf');        
+            $section_config =  $app->getconf->get_server_config($server_id,$section);        
+            return $section_config;
+        } else {
+            return false;
+        }
+    }
+	
 	//* Get mail domain details
 	public function mail_domain_get($session_id, $primary_id)
     {
@@ -2037,10 +2060,17 @@
 		$app->uses('remoting_lib');
 		
 		//* load the user profile of the client
-		$app->remoting_lib->loadUserProfile($client_id);
+		$app->remoting_lib->loadUserProfile(0);
 		
 		//* Load the form definition
 		$app->remoting_lib->loadFormDef($formdef_file);
+		
+		$old_rec = $app->remoting_lib->getDataRecord($primary_id);
+		
+		// set a few values for compatibility with tform actions, mostly used by plugins
+		$this->oldDataRecord = $old_rec;
+		$this->id = $primary_id;
+		$this->dataRecord = $params;
 		
 		//* Get the SQL query
 		$sql = $app->remoting_lib->getDeleteSQL($primary_id);
@@ -2056,8 +2086,7 @@
 		
 		//* Save changes to Datalog
 		if($app->remoting_lib->formDef["db_history"] == 'yes') {
-			$rec = $app->remoting_lib->getDataRecord($primary_id);
-			$app->remoting_lib->datalogSave('DELETE',$primary_id,$rec,array());
+			$app->remoting_lib->datalogSave('DELETE',$primary_id,$old_rec,array());
 		}
 		
 		

--
Gitblit v1.9.1