diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index c3ef74b5ecea30a0d533a86707d5cec2a97c04eb..df6f8c094fa44ec231f94f5bc2b0978c49ce3534 100644 (file)
var $gosaApplicationParameter ;
- function appgroup ($config, $dn= NULL)
+ function appgroup ($config, $dn= NULL, $parent= NULL)
{
/* prepare group app for release management */
$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.
/* Call parent execute */
plugin::execute();
-
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){
+
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]);
}
}
$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']);
+
+ $fdn = $value['dn'];
+ $fdn = preg_replace("/".normalizePreg($this->curbase)."/","",$fdn);
+ $fdn= @LDAP::fix($fdn);
if($value["description"][0]!=".."){
$departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]";
}else{
- $departments[$value['dn']]=convert_department_dn($fdn);
+ $departments[$value['dn']]= convert_department_dn($fdn);
}
}
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'])){
$ret[$attrs['dn']] = $name;
}
}
+
+ /* Set releases to / id nor presenet */
+ if (!count($ret)){
+ $ret['/']= '/';
+ }
+
return($ret);
}
/* 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])){
/* Special handling for release managed apps
*/
$tmp = search_config($this->config->data,"faiManagement","CLASS");
- if(!empty($tmp)){
+ if(!empty($tmp) && count($this->Releases)){
$this->enableReleaseManagement = true;
$tmp = array_flip($this->Releases);
if(isset($tmp[$this->FAIrelease])){
$base = $tmp[$this->FAIrelease];
}else{
+ $old_r = $this->FAIrelease;
$k = key($tmp);
$r = $tmp[$k];
$this->FAIrelease = $k;
$base = $r;
- print_red(sprintf(_("Can't resolve the release name '%s', setting release name to '%s'. Possibly the objects base has changed."),$this->FAIrelease,$k));
+ print_red(sprintf(_("Can't resolve the release name '%s', setting release name to '%s'. Possibly the objects base has changed."),$old_r,$k));
}
$base = preg_replace("/ou=apps,.*$/","ou=apps,".$this->curbase,$base);
$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();