X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fgroups%2Fclass_groupApplication.inc;h=4a4fde162c069a21fe595b08f4b95b940961ac92;hb=4f507bf6c24fd9a5c50928b3a0c334ba5529c42d;hp=ede18a1668e4faf5c1ab7ea6a479c008e8c78f39;hpb=9e143613e3bf1c2509acbe260a2d5b21a81c7897;p=gosa.git diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index ede18a166..4a4fde162 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -39,7 +39,7 @@ class appgroup extends plugin var $gosaApplicationParameter ; - function appgroup ($config, $dn= NULL) + function appgroup ($config, $dn= NULL, $parent= NULL) { /* prepare group app for release management */ @@ -50,7 +50,7 @@ class appgroup extends plugin $this->attributes[] = "FAIrelease"; } - plugin::plugin ($config, $dn); + plugin::plugin ($config, $dn, $parent); /* In some case of old applikations with old release tag saving, we must reassign is_account state. @@ -371,7 +371,6 @@ class appgroup extends plugin /* Call parent execute */ plugin::execute(); - if((isset($_GET['act']))&&($_GET['act']=="depopen")){ $dep = base64_decode($_GET['depid']); if(isset($this->config->idepartments[$dep])){ @@ -455,9 +454,15 @@ class appgroup extends plugin foreach($this->gosaMemberApplication as $key => $cat){ foreach($cat as $key2 => $app){ + if($app['App'] == $val){ unset($this->gosaMemberApplication[$key][$key2]); if(isset($this->used_apps[$val])){ + foreach($this->getParameters($val) as $para){ + if(isset($this->appoption[$para])){ + unset($this->appoption[$para]); + } + } unset($this->used_apps[$val]); } } @@ -605,22 +610,11 @@ class appgroup extends plugin $div->SetHeight(300); - /* NEW LIST MANAGMENT - * We also need to search for the departments - * So we are able to navigate like in konquerer - */ - - //FIXME: Why do we not use get_list here? It's the same code all over the time... - $ldap = $this->config->get_ldap_link(); - $ldap->cd($this->curbase) ; - $ldap->ls("(objectClass=gosaDepartment)"); - $departments= array(); - $tmp = array(); - while ($value = $ldap->fetch()){ - $tmp[strtolower($value['dn']).$value['dn']]=$value; - } - ksort($tmp); - foreach($tmp as $value){ + /* get departments */ + $ui = get_userinfo(); + $departments = array(); + $res = get_list("(objectClass=gosaDepartment)",$ui->subtreeACL,$this->curbase,array("description","cn","ou"),GL_SIZELIMIT); + foreach($res as $value){ $fdn= @LDAP::fix($value['dn']); if($value["description"][0]!=".."){ $departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]"; @@ -629,9 +623,6 @@ class appgroup extends plugin } } - /* END NEW LIST MANAGMENT - */ - $linkopen = "%s"; $linkadd = "%s"; @@ -795,10 +786,10 @@ class appgroup extends plugin function getReleases() { - $dn = "ou=apps,".$this->config->current['BASE']; + $dn = $this->config->current['BASE']; $ldap = $this->config->get_ldap_link(); $ldap->cd($dn); - $ldap->search("objectClass=organizationalUnit",array("ou")); + $ldap->search("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",array("ou")); $ret =array(); while($attrs = $ldap->fetch()){ if(preg_match("/ou=apps,/",$attrs['dn'])){ @@ -853,6 +844,7 @@ class appgroup extends plugin /* Copy members */ $this->Categories[""]=""; $this->attrs["gosaMemberApplication"]= array(); + $this->attrs["gosaApplicationParameter"]= array(); foreach($this->Categories as $name => $cats){ $i =0; if(isset($this->gosaMemberApplication[$name])){ @@ -1012,6 +1004,27 @@ class appgroup extends plugin $this->is_modified= TRUE; } + function getParameters($app) + { + $tmp = $this->getReleases(); + $ret = array(); + if(in_array($this->FAIrelease,$tmp)){ + $tmp2 = array_flip($tmp); + $base = $tmp2[$this->FAIrelease]; + $ldap = $this->config->get_ldap_link(); + $ldap->cd($this->config->current['BASE']); + $ldap->search("(&(objectClass=gosaApplication)(cn=".$app.")(gosaApplicationParameter=*))",array("gosaApplicationParameter")); + if($ldap->count()){ + $attrs = $ldap->fetch(); + for($i = 0 ; $i < $attrs['gosaApplicationParameter']['count'] ; $i ++ ){ + $name = preg_replace("/:.*$/","",$attrs['gosaApplicationParameter'][$i]); + $ret[$name] = $name; + } + } + } + return($ret); + } + function GetSubdirs($dir) { $ret = array();