Code

Updated generateLdif method
[gosa.git] / gosa-core / include / class_config.inc
index 4480396be833ada67f0b01f57873bf67cd10b708..7c9fe51fc80b69af961f9acfb0e5f8ccd9589073 100644 (file)
@@ -314,13 +314,19 @@ class config  {
     }
 
 
-    function getRpcHandle()
+    function getRpcHandle($connectUrl="", $username="", $userPassword="", $authModeDigest=FALSE)
     {
+        // Get conenct information, if no info was given use the default values from gosa.conf
+        $connectUrl   = (!empty($connectUrl))   ? $connectUrl   : $this->get_cfg_value('core','gosaRpcServer');
+        $username     = (!empty($username))     ? $username     : $this->get_cfg_value('core','gosaRpcUser');
+        $userPassword = (!empty($userPassword)) ? $userPassword : $this->get_cfg_value('core','gosaRpcPassword');
+        $authModeDigest = $authModeDigest;
+
         // Create jsonRPC handle on demand.
-        if(!$this->jsonRPChandle){
-            $this->jsonRPChandle = new jsonRPC($this);
+        if(!isset($this->jsonRPChandle[$connectUrl][$username]) || !$this->jsonRPChandle[$connectUrl][$username]){
+            $this->jsonRPChandle[$connectUrl][$username] = new jsonRPC($this, $connectUrl, $username, $userPassword, $authModeDigest);
         }
-        return($this->jsonRPChandle);
+        return($this->jsonRPChandle[$connectUrl][$username]);
     }