Code

Updated ACL check for groups.
[gosa.git] / plugins / admin / applications / class_applicationManagement.inc
index d0f1d793476a2ef5f571538296cc0abd6e6cbf5c..7959e6f6db42b3b12582af949382f2c5d8cbb668 100644 (file)
@@ -72,7 +72,7 @@ class applicationManagement extends plugin
     $ldap                   = $this->config->get_ldap_link();
     $dn                     = "ou=apps,".$base;
     $ret                    = array();
-    $ret [$base] = "/";
+    $ret [$dn] = "/";
 
     $ldap->cd($dn);
     $ldap->search("objectClass=organizationalUnit",array("ou"));
@@ -238,6 +238,13 @@ class applicationManagement extends plugin
       /* Get 'dn' from posted 'applist', must be unique */
       $this->dn= $this->applications[$s_entry]['dn'];
 
+      /* Get faistate to check if this applications is frezzed. 
+         Freezed applications can't be modified anyway */
+      $state = "";
+      if(isset($this->applications[$s_entry]['FAIstate'])){
+        $state = $this->applications[$s_entry]['FAIstate'][0];
+      }
+
       /* Check locking, save current plugin in 'back_plugin', so
          the dialog knows where to return. */
       if (($user= get_lock($this->dn)) != ""){
@@ -252,9 +259,14 @@ class applicationManagement extends plugin
       $acl= get_permissions ($this->dn, $this->ui->subtreeACL);
 
       /* Register apptabs to trigger edit dialog */
-      $this->apptabs= new apptabs($this->config,
-          $this->config->data['TABS']['APPSTABS'], $this->dn);
-      $this->apptabs->set_acl($acl);
+      $this->apptabs= new apptabs($this->config,$this->config->data['TABS']['APPSTABS'], $this->dn);
+
+      /* If this is a freeze assign acl none  */
+      if(preg_match("/freeze/",$state)){
+        $this->apptabs->set_acl(array());
+      }else{
+        $this->apptabs->set_acl($acl);
+      }
       $_SESSION['objectinfo']= $this->dn;
     }
 
@@ -359,6 +371,7 @@ class applicationManagement extends plugin
      ****************/
 
     /* Display dialog with system list */
+    $this->DivListApplication->parent = $this;
     $this->DivListApplication->execute();
     $this->DivListApplication->AddDepartments($this->DivListApplication->selectedBase);
     $this->reload();
@@ -382,12 +395,12 @@ class applicationManagement extends plugin
     $Releases   = $this->getReleases($base);
 
     if(!$this->enableReleaseManagement){
-      $use_base = $base;
+      $use_base = "ou=apps,".$base;
     }else{
       if(isset($Releases[$release])){
         $use_base  = $release;
       }else{
-        $use_base  = $base;
+        $use_base  = "ou=apps,".$base;
       }
     }
 
@@ -395,7 +408,7 @@ class applicationManagement extends plugin
       $Flags    |= GL_SUBSEARCH;  
     }
    
-    $res= get_list($Filter, $this->ui->subtreeACL,$use_base, array("cn","description","dn","objectClass"), $Flags);
+    $res= get_list($Filter, $this->ui->subtreeACL,$use_base, array("cn","description","dn","objectClass","FAIstate"), $Flags);
     foreach ($res as $val){
       $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val;
     }