Code

Updated ACL handling
[gosa.git] / gosa-plugins / goto / admin / applications / class_applicationManagement.inc
index 0a8914e51ba4793ca1986c4d8ec37eb38025a614..78ec8dede967db3de03095669ac666ad1e540fdb 100644 (file)
@@ -34,6 +34,7 @@ class applicationManagement extends plugin
   var $enableReleaseManagement  = false;
   var $start_pasting_copied_objects = FALSE;
 
+  var $acl_base     ="";
   var $app_base     ="";
   var $app_release  ="";
   var $acl_module   = array("application");  
@@ -66,11 +67,15 @@ class applicationManagement extends plugin
     $this->DivListApplication = new divListApplication($this->config,$this);
 
     if($this->IsReleaseManagementActivated()){
-    /* Check if we should enable the release selection */
+      $this->acl_base = $this->config->current['BASE'];
+
+      /* Check if we should enable the release selection */
       $this->enableReleaseManagement = true;
 
       /* Hide SubSearch checkbox */
       $this->DivListApplication->DisableCheckBox("SubSearch");
+    }else{
+      $this->acl_base = &$this->DivListApplication->selectedBase;
     }
 
     /* Set default release */
@@ -231,7 +236,7 @@ class applicationManagement extends plugin
       /* Create new usertab object */
       $this->apptabs= new apptabs($this->config,$this->config->data['TABS']['APPSTABS'], $this->dn,"application");
       $this->apptabs->parent = &$this;
-      $this->apptabs->set_acl_base($this->app_base);
+      $this->apptabs->set_acl_base($this->acl_base);
     }
 
 
@@ -356,7 +361,7 @@ class applicationManagement extends plugin
           $dns_names = array();
           foreach($this->dns as $dn){
             add_lock ($dn, $this->ui->dn);
-            $dns_names[] =@LDAP::fix($dn);
+            $dns_names[] =LDAP::fix($dn);
           }
 
           /* Lock the current entry, so nobody will edit it during deletion */
@@ -441,7 +446,7 @@ class applicationManagement extends plugin
         /* Lock the current entry, so nobody will edit it during deletion */
         add_lock ($this->dn, $this->ui->dn);
         $smarty= get_smarty();
-        $smarty->assign("intro",msgPool::deleteInfo(@LDAP::fix($this->dn),_("application")));
+        $smarty->assign("intro",msgPool::deleteInfo(LDAP::fix($this->dn),_("application")));
         $smarty->assign("multiple", false);
         return($smarty->fetch (get_template_path('remove.tpl', TRUE)));
       } else {
@@ -572,7 +577,7 @@ class applicationManagement extends plugin
     if(!$this->IsReleaseManagementActivated()){
       $use_base = $this->app_base;
       if($SubSearch){
-        $use_base = preg_replace("/^".normalizePreg(get_ou("applicationRDN"))."/","",$use_base);
+        $use_base = preg_replace("/^".preg_quote(get_ou("applicationRDN"), '/')."/","",$use_base);
       }
     }else{
       $use_base = $this->app_release;