Code

Some group-application fixes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Aug 2006 06:45:40 +0000 (06:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Aug 2006 06:45:40 +0000 (06:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4531 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc

index f16e89cc1e31a17b13a19b2a8ad725c15a638b5d..133717d6c59ea57244a7a040dafe50b729e8d47d 100644 (file)
@@ -383,8 +383,12 @@ class appgroup extends plugin
     }
 
     /* Do we need to flip is_account state? */
-    if (isset($_POST['modify_state'])){
-      $this->is_account= !$this->is_account;
+    if(isset($_POST['modify_state'])){
+      if($this->is_account && $this->acl_is_removeable()){
+        $this->is_account= FALSE;
+      }elseif(!$this->is_account && $this->acl_is_createable()){
+        $this->is_account= TRUE;
+      }
     }
 
     /* Do we represent a valid group? */
@@ -786,12 +790,12 @@ class appgroup extends plugin
 
   function getReleases()
   {
-    $dn   = $this->config->current['BASE'];
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd($dn);
-    $ldap->search("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",array("ou"));
+    $dn     = $this->config->current['BASE'];
+    $filter = "(&(objectClass=organizationalUnit)(objectClass=FAIbranch))";
+    $res    = get_list($filter,"groups", $dn, array("ou"), GL_SUBSEARCH);
+
     $ret =array();
-    while($attrs = $ldap->fetch()){
+    foreach($res as $attrs){
       if(preg_match("/ou=apps,/",$attrs['dn'])){
         $bb = preg_replace("/ou=apps,.*/","",$attrs['dn']);
         $parts = array_reverse(split("ou=",$bb));
@@ -1055,8 +1059,6 @@ class appgroup extends plugin
 
   /* Return plugin informations for acl handling  */ 
   function plInfo()
-  {
-     function plInfo()
   {
     return (array(
           "plShortName"   => _("Applications"),
@@ -1071,10 +1073,6 @@ class appgroup extends plugin
             "gosaApplicationParameter"  => _("Application parameter"))
           ));
   }
-
-
-
-  }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>