Code

Updated pst handling
[gosa.git] / gosa-core / include / class_config.inc
index faf44aab39c86b57e58b951811c19f1a68de7875..17b860c58386189fc00acba33f58227ca1acbe9d 100644 (file)
@@ -64,6 +64,8 @@ class config  {
   var $filename = "";
   var $last_modified = 0;
 
+    private $jsonRPChandle = NULL; 
+
   public $configRegistry = NULL;
 
   /*! \brief Class constructor of the config class
@@ -251,6 +253,10 @@ class config  {
                   $this->data['PATHMENU']= array(); ;
                   break;
 
+      case 'SHORTCUTMENU':
+                  $this->data['SHORTCUTMENU']= array(); ;
+                  break;
+
                   /* Inser plugins */
       case 'PLUGIN':
                   if ($this->tags[$this->level-3] == 'MENU' &&
@@ -261,6 +267,9 @@ class config  {
                   if ($this->tags[$this->level-2] == 'PATHMENU'){
                     $this->data['PATHMENU'][$this->gpc++]= $attrs;
                   }
+                  if ($this->tags[$this->level-2] == 'SHORTCUTMENU'){
+                    $this->data['SHORTCUTMENU'][$this->gpc++]= $attrs;
+                  }
                   if ($this->tags[$this->level-2] == 'SERVICEMENU'){
                     $this->data['SERVICE'][$attrs['CLASS']]= $attrs;
                   }
@@ -297,17 +306,13 @@ class config  {
 
   function getRpcHandle()
   {
-      $server  =  $this->get_cfg_value('core','gosaRpcServer');
-      $user    =  $this->get_cfg_value('core','gosaRpcUser');
-      $passwd  =  $this->get_cfg_value('core','gosaRpcPassword');
-
-      $handle = new jsonRPC($server);
-      $handle->login($user, $passwd);
-
-      //Fixme  Add checks here - login successful aso.
-      return($handle);
+      // Create jsonRPC handle on demand.
+      if(!$this->jsonRPChandle){
+          $this->jsonRPChandle = new jsonRPC($this);
+      }
+      return($this->jsonRPChandle);
   }
-
+    
 
   /*! \brief Get a LDAP link object
    *