From 2d6dac4d5b2c2025dec0f25a745cef5da5709a49 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 30 Jun 2010 09:36:02 -0400
Subject: [PATCH] Implemented: FS#1216 - Add a server_get function to remoting class

---
 interface/lib/classes/remoting.inc.php |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php
index 1a9c351..738f967 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)
     {

--
Gitblit v1.9.1