diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index ede18a1668e4faf5c1ab7ea6a479c008e8c78f39..4a4fde162c069a21fe595b08f4b95b940961ac92 100644 (file)
var $gosaApplicationParameter ;
var $gosaApplicationParameter ;
- function appgroup ($config, $dn= NULL)
+ function appgroup ($config, $dn= NULL, $parent= NULL)
{
/* prepare group app for release management */
{
/* prepare group app for release management */
$this->attributes[] = "FAIrelease";
}
$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.
/* In some case of old applikations with old release tag saving, we
must reassign is_account state.
/* Call parent execute */
plugin::execute();
/* Call parent execute */
plugin::execute();
-
if((isset($_GET['act']))&&($_GET['act']=="depopen")){
$dep = base64_decode($_GET['depid']);
if(isset($this->config->idepartments[$dep])){
if((isset($_GET['act']))&&($_GET['act']=="depopen")){
$dep = base64_decode($_GET['depid']);
if(isset($this->config->idepartments[$dep])){
foreach($this->gosaMemberApplication as $key => $cat){
foreach($cat as $key2 => $app){
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])){
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]);
}
}
unset($this->used_apps[$val]);
}
}
$div->SetHeight(300);
$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]."]";
$fdn= @LDAP::fix($value['dn']);
if($value["description"][0]!=".."){
$departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]";
}
}
}
}
- /* END NEW LIST MANAGMENT
- */
-
$linkopen = "<a href='?plug=".$_GET['plug']."&act=depopen&depid=%s'>%s</a>";
$linkadd = "<a href='?plug=".$_GET['plug']."&act=add&id=%s'>%s</a>";
$linkopen = "<a href='?plug=".$_GET['plug']."&act=depopen&depid=%s'>%s</a>";
$linkadd = "<a href='?plug=".$_GET['plug']."&act=add&id=%s'>%s</a>";
function getReleases()
{
function getReleases()
{
- $dn = "ou=apps,".$this->config->current['BASE'];
+ $dn = $this->config->current['BASE'];
$ldap = $this->config->get_ldap_link();
$ldap->cd($dn);
$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'])){
$ret =array();
while($attrs = $ldap->fetch()){
if(preg_match("/ou=apps,/",$attrs['dn'])){
/* Copy members */
$this->Categories[""]="";
$this->attrs["gosaMemberApplication"]= array();
/* 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])){
foreach($this->Categories as $name => $cats){
$i =0;
if(isset($this->gosaMemberApplication[$name])){
$this->is_modified= TRUE;
}
$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();
function GetSubdirs($dir)
{
$ret = array();