Code

Updated gosaSupportDaemon.
[gosa.git] / gosa-core / include / class_ldap.inc
index 489f3954e1adbd2ebe3c9d45f75087d2c53905ad..642908017b553e236a8ca00710cc2dc60961ec5f 100644 (file)
@@ -558,8 +558,8 @@ class LDAP{
 
           /* Bail out, if we've nothing to do... */
           if ($ocname == ""){
-            msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': no object class found"),$type), ERROR_DIALOG);
-            display_error_page();
+            msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': no object class found"),$type), FATAL_ERROR_DIALOG);
+            exit();
           }
 
           /* Assemble_entry */
@@ -606,8 +606,8 @@ class LDAP{
               $na["dc"]= $param;
               break;
             default:
-              msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': not supported"),$type), ERROR_DIALOG);
-              display_error_page();
+              msg_dialog::display(_("Internal error"), sprintf(_("Cannot automatically create subtrees with RDN '%s': not supported"),$type), FATAL_ERROR_DIALOG);
+              exit();
           }
 
         }
@@ -1110,6 +1110,12 @@ class LDAP{
         return($objectclasses);
       } 
     }
+
+    /* Return the cached results. */
+    if(class_available('session') && session::is_set("LDAP_CACHE::get_objectclasses")){
+      $objectclasses = session::get("LDAP_CACHE::get_objectclasses");
+      return($objectclasses);
+    }
        
          # Get base to look for schema 
          $sr = @ldap_read ($this->cid, NULL, "objectClass=*", array("subschemaSubentry"));
@@ -1173,6 +1179,9 @@ class LDAP{
       }
 
          }
+    if(class_available("session")){
+      session::set("LDAP_CACHE::get_objectclasses",$objectclasses);
+    }
          return $objectclasses;
   }