Code

Fixed create missing trees
[gosa.git] / include / class_plugin.inc
index bb4863c3e30f7ff4c1102434a4b2d13a1c1013d1..b71e576ca9b205b107d7e07509c0d45aefa6d54d 100644 (file)
@@ -1215,11 +1215,15 @@ class plugin
     $cfg= &$this->config->current;
 
     /* check if there are special server configurations for snapshots */
-    if(isset($cfg['SNAPSHOT_SERVER'])){
+
+    if(isset($cfg['SERVER']) && isset($cfg['SNAPSHOT_SERVER']) && $cfg['SERVER'] == $cfg['SNAPSHOT_SERVER']){
+      $ldap_to    = $ldap;
+    }elseif(isset($cfg['SNAPSHOT_SERVER'])){
       $server       = $cfg['SNAPSHOT_SERVER'];
       $user         = $cfg['SNAPSHOT_USER'];
       $password     = $cfg['SNAPSHOT_PASSWORD'];
       $snapldapbase = $cfg['SNAPSHOT_BASE'];
+
       $ldap_to      = new LDAP($user,$password, $server);
       $ldap_to -> cd ($snapldapbase);
       show_ldap_error($ldap->get_error(), sprintf(_("Method get available snapshots with dn '%s' failed."),$this->dn));
@@ -1406,7 +1410,7 @@ class plugin
 
     /* Create a new snapshot requested, check
        the given attributes and create the snapshot*/
-    if(isset($_POST['CreateSnapshot'])){
+    if(isset($_POST['CreateSnapshot']) && is_object($this->snapDialog)){
       $this->snapDialog->save_object();
       $msgs = $this->snapDialog->check();
       if(count($msgs)){
@@ -1435,7 +1439,7 @@ class plugin
   }
 
 
-  function plInfo()
+  static function plInfo()
   {
     return array();
   }