Code

Updated generateLdif method
[gosa.git] / gosa-core / include / class_config.inc
index 8c49425ea74b440459a0e9550cd76a5ff82ddc4d..7c9fe51fc80b69af961f9acfb0e5f8ccd9589073 100644 (file)
@@ -314,13 +314,19 @@ class config  {
     }
 
 
-    function getRpcHandle($url="", $user="", $pwd="", $digest = FALSE )
+    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 || TRUE){
-            $this->jsonRPChandle = new jsonRPC($this, $url, $user, $pwd, $digest);
+        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]);
     }