Code

Added cursor tag to menu entries
[gosa.git] / gosa-core / include / class_plugin.inc
index 5fcbf559736d555af0b2e5700337b6296c33af80..1c57be2cc96bd77e92e8edd950d568e6db171e58 100644 (file)
@@ -152,7 +152,7 @@ class plugin
 
     /* Check if this entry was opened in read only mode */
     if(isset($_POST['open_readonly'])){
-      if(session::is_set("LOCK_CACHE")){
+      if(session::global_is_set("LOCK_CACHE")){
         $cache = &session::get("LOCK_CACHE");
         if(isset($cache['READ_ONLY'][$this->dn])){
           $this->read_only = TRUE;
@@ -259,7 +259,7 @@ class plugin
   function execute()
   {
     /* This one is empty currently. Fabian - please fill in the docu code */
-    session::set('current_class_for_help',get_class($this));
+    session::global_set('current_class_for_help',get_class($this));
 
     /* Reset Lock message POST/GET check array, to prevent perg_match errors*/
     session::set('LOCK_VARS_TO_USE',array());
@@ -925,7 +925,10 @@ class plugin
     $ldap->cd($this->config->current['BASE']);
     $ldap->create_missing_trees(preg_replace("/^[^,]+,/","",$dst_dn));
     if (!$ldap->rename_dn($src_dn,$dst_dn)){
-      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $src_dn, "", get_class()));
+#      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $src_dn, "", get_class()));
+      new log("debug","Ldap Protocol v3 implementation error, ldap_rename failed, falling back to manual copy.","FROM: $src_dn  -- TO: $dst_dn",array(),$ldap->get_error());
+      @DEBUG(DEBUG_LDAP,__LINE__,__FUNCTION__,__FILE__,"Rename failed FROM: $src_dn  -- TO:  $dst_dn", 
+          "Ldap Protocol v3 implementation error, falling back to maunal method.");
       return(FALSE);
     }
 
@@ -990,7 +993,7 @@ class plugin
     if(count($leaf_deps)){
       $this->config->get_departments();
       $this->config->make_idepartments();
-      session::set("config",$this->config);
+      session::global_set("config",$this->config);
       $ui =get_userinfo();
       $ui->reset_acl_cache();
     }
@@ -1304,7 +1307,9 @@ class plugin
     $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
     $ldap->rmdir_recursive($this->dn);
-    msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn));
+    if(!$ldap->success()){
+      msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn));
+    }
     $this->dn = $old_dn;
   }
 
@@ -1515,46 +1520,6 @@ class plugin
 
     foreach($_POST as $name => $value){
 
-##   foreach($_POST as $name => $value){
-## +           $entry = base64_decode(preg_replace("/_[xy]$/","",$name));
-##
-##        /* Create a new snapshot, display a dialog */
-##        if(preg_match("/^CreateSnapShotDialog_/",$name) && $once){
-##          $once = false;
-## -        $entry = preg_replace("/^CreateSnapShotDialog_/","",$name);
-## -        $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
-## +        $entry = preg_replace("/^CreateSnapShotDialog_/","",$entry);
-##
-##          if(!empty($entry) && $ui->allow_snapshot_create($entry,$this->parent->acl_module)){
-##            $this->snapDialog = new SnapShotDialog($this->config,$entry,$this);
-## @@ -1538,8 +1530,7 @@
-##        /* Restore a snapshot, display a dialog with all snapshots of the current object */
-##        if(preg_match("/^RestoreSnapShotDialog_/",$name) && $once){
-##          $once = false;
-## -        $entry = preg_replace("/^RestoreSnapShotDialog_/","",$name);
-## -        $entry = base64_decode(preg_replace("/_[xy]$/","",$entry));
-## +        $entry = preg_replace("/^RestoreSnapShotDialog_/","",$entry);
-##          if(!empty($entry) && $ui->allow_snapshot_restore($entry,$this->parent->acl_module)){
-##            $this->snapDialog = new SnapShotDialog($this->config,$entry,$this);
-##            $this->snapDialog->display_restore_dialog = true;
-## @@ -1566,8 +1557,7 @@
-##        /* Restore selected snapshot */
-##        if(preg_match("/^RestoreSnapShot_/",$name) && $once){
-##          $once = false;
-## -        $entry = preg_replace("/^RestoreSnapShot_/","",$name);
-## -        $entry = base64_decode(trim(preg_replace("/_[xy]$/","",$entry)));
-## +        $entry = preg_replace("/^RestoreSnapShot_/","",$entry);
-##          if(!empty($entry) && $ui->allow_snapshot_restore($entry,$this->parent->acl_module)){
-##            $this->restore_snapshot($entry);
-##            $this->snapDialog = NULL;
-## @@ -1628,6 +1618,7 @@
-## */
-##
-##
-##
-
-
-
       /* Create a new snapshot, display a dialog */
       if(preg_match("/^CreateSnapShotDialog_[^_]*_[xy]$/",$name) && $once){
 
@@ -1765,10 +1730,10 @@ class plugin
     }
 
     /* Update userinfo if necessary */
-    $ui = session::get('ui');
+    $ui = session::global_get('ui');
     if($ui->dn == $old_dn){
       $ui->dn = $new_dn;
-      session::set('ui',$ui);
+      session::global_set('ui',$ui);
       new log("view","acl/".get_class($this),$this->dn,array(),"Updated current object dn from '".$old_dn."' to '".$new_dn."'");
     }
 
@@ -1913,7 +1878,7 @@ class plugin
   function multiple_execute()
   {
     /* This one is empty currently. Fabian - please fill in the docu code */
-    session::set('current_class_for_help',get_class($this));
+    session::global_set('current_class_for_help',get_class($this));
 
     /* Reset Lock message POST/GET check array, to prevent perg_match errors*/
     session::set('LOCK_VARS_TO_USE',array());