diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index 26af428f42ae7b09e6b3f20492cf7216ea1f1ebf..064b94e6bf79bb58c4735456090e50df220699b6 100644 (file)
var $CopyPasteVars = array("Categories");
var $gosaApplicationParameter ;
var $CopyPasteVars = array("Categories");
var $gosaApplicationParameter ;
+ var $ui ;
- function appgroup ($config, $dn= NULL)
+ function appgroup ($config, $dn= NULL, $parent= NULL)
{
{
-
+ $this->ui = get_userinfo();
+
/* prepare group app for release management */
$tmp = search_config($config->data,"faiManagement","CLASS");
if(!empty($tmp)){
/* prepare group app for release management */
$tmp = search_config($config->data,"faiManagement","CLASS");
if(!empty($tmp)){
$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.
$departments = array();
$res = get_list("(objectClass=gosaDepartment)",$ui->subtreeACL,$this->curbase,array("description","cn","ou"),GL_SIZELIMIT);
foreach($res as $value){
$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{
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);
}
}
}
}
/* release managent is active
*/
if(!$this->enableReleaseManagement){
/* release managent is active
*/
if(!$this->enableReleaseManagement){
- $image = "<img class='center' src='images/select_invalid_application.png'
+ $image = "<img class='center' alt='R' src='images/select_invalid_application.png'
title='"._("This application is no longer available.")."'> ";
}else{
title='"._("This application is no longer available.")."'> ";
}else{
- $image = "<img class='center' src='images/select_invalid_application.png'
- title='".sprintf(_("This application is not available in any release named %s."),$this->FAIrelease)."'> ";
+ $image = "<img class='center' alt='F' src='images/select_invalid_application.png'
+ title=\"".sprintf(_("This application is not available in any release named %s."),$this->FAIrelease)."\"> ";
}
}elseif(isset($Differences[$entry['App']]) && ($Differences[$entry['App']] == true)) {
}
}elseif(isset($Differences[$entry['App']]) && ($Differences[$entry['App']] == true)) {
$ldap = $this->config->get_ldap_link();
$ldap->cd($dn);
$ldap->search("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",array("ou"));
$ldap = $this->config->get_ldap_link();
$ldap->cd($dn);
$ldap->search("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",array("ou"));
-
- $ui = get_userinfo();
- $returned = get_list("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",$ui->subtreeACL,$dn,array("ou"));
$ret =array();
$ret =array();
-
- foreach($returned as $attrs){
+ while($attrs = $ldap->fetch()){
if(preg_match("/ou=apps,/",$attrs['dn'])){
$bb = preg_replace("/ou=apps,.*/","",$attrs['dn']);
$parts = array_reverse(split("ou=",$bb));
if(preg_match("/ou=apps,/",$attrs['dn'])){
$bb = preg_replace("/ou=apps,.*/","",$attrs['dn']);
$parts = array_reverse(split("ou=",$bb));
$ret[$attrs['dn']] = $name;
}
}
$ret[$attrs['dn']] = $name;
}
}
+
+ /* Set releases to / id nor presenet */
+ if (!count($ret)){
+ $ret['/']= '/';
+ }
+
return($ret);
}
return($ret);
}
/* Special handling for release managed apps
*/
$tmp = search_config($this->config->data,"faiManagement","CLASS");
/* 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{
$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;
$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);
}
$base = preg_replace("/ou=apps,.*$/","ou=apps,".$this->curbase,$base);
-
- $ldap = $this->config->get_ldap_link();
- $ldap->cd ($base);
- $ldap->ls ("(objectClass=gosaApplication)",$base);
+ $app_res = get_list("(objectClass=gosaApplication)", $this->ui->subtreeACL, $base,array("cn","description"));
}else{
}else{
- $ldap = $this->config->get_ldap_link();
- $ldap->cd ("ou=apps,".$this->curbase);
- $ldap->ls ("(objectClass=gosaApplication)","ou=apps,".$this->curbase);
+ $app_res = get_list("(objectClass=gosaApplication)", $this->ui->subtreeACL, "ou=apps,".$this->curbase,array("cn","description"));
}
}
- while ($attrs= $ldap->fetch()){
+ foreach($app_res as $attrs){
if (isset($attrs["description"][0])){
$this->apps[$attrs["cn"][0]]=
$attrs["cn"][0]." (".
if (isset($attrs["description"][0])){
$this->apps[$attrs["cn"][0]]=
$attrs["cn"][0]." (".
}
}
}
}
+ $ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
$ldap->search("objectClass=gosaApplication",array("gosaApplicationParameter","cn"));
$tmp = search_config($this->config->data,"faiManagement","CLASS");
$ldap->cd($this->config->current['BASE']);
$ldap->search("objectClass=gosaApplication",array("gosaApplicationParameter","cn"));
$tmp = search_config($this->config->data,"faiManagement","CLASS");