summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2d3c127)
raw | patch | inline | side by side (parent: 2d3c127)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Apr 2006 07:14:09 +0000 (07:14 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 6 Apr 2006 07:14:09 +0000 (07:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3002 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/groups/class_groupApplication.inc | patch | blob | history |
diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index 5a7da640653e128e4c53dc6934a9dd6d665df9c1..dd7c8ca6ce40fbf0026fc2c7a9f1ed7f93a2328c 100644 (file)
var $objectclasses = array("gosaApplicationGroup");
var $Release = "/";
+ var $Releases = array();
var $enableReleaseManagement = false;
if(!empty($tmp)){
$this->enableReleaseManagement = true;
$this->Release = $this->getReleaseName();
+ $this->Releases= $this->getReleases();
}
}
$tmp = search_config($this->config->data,"faiManagement","CLASS");
if(!empty($tmp)){
- $tmp = array_flip($this->getReleases($this->parent->by_object['group']->base));
- $base = $tmp[$this->Release];
+ $base = $this->Releases[$this->Release];
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=gosaApplication)(cn=$appname))",array("gosaApplicationParameter"));
if($this->enableReleaseManagement){
$smarty->assign("Release", $this->Release);
- $tmp = $this->getReleases($this->parent->by_object['group']->base);
- $smarty->assign("Releases", $tmp);
+ $smarty->assign("Releases", $this->Releases);
if(count($this->used_apps)){
$smarty->assign("ReleaseSelectAble", false);
}
- function getReleases($base)
+ function getReleases()
{
- $dn = "ou=apps,".$base;
-
- $ret = array();
-
- $ret ["ou=apps,".$base] = "/";
-
+ $dn = "ou=apps,".$this->config->current['BASE'];
$ldap = $this->config->get_ldap_link();
$ldap->cd($dn);
-
$ldap->search("objectClass=organizationalUnit",array("ou"));
-
+ $ret =array();
while($attrs = $ldap->fetch()){
- $str = str_replace($dn,"",$attrs['dn']);
- $tmp = array_reverse( split("ou=",$str));
- $str = "";
- foreach($tmp as $val){
- $val = trim(preg_replace("/,/","",$val));
- if(empty($val)) break;
- $str .= "/".$val;
- }
- if(!empty($str)){
- $ret[$attrs['dn']]= preg_replace("/^\//","",$str);
+ if(preg_match("/ou=apps,/",$attrs['dn'])){
+ $bb = preg_replace("/ou=apps,.*/","",$attrs['dn']);
+ $parts = array_reverse(split("ou=",$bb));
+
+ $str ="";
+ foreach($parts as $part){
+ if(empty($part)) {
+ continue;
+ }
+ $str .= str_replace(",","",$part)."/";
+ }
+ $name = preg_replace("/\/$/","",$str);
+ if(empty($name)) {
+ $name ="/";
+ }
+ $ret[$attrs['dn']] = $name;
}
}
return($ret);
if(!empty($tmp)){
$this->enableReleaseManagement = true;
- $tmp = array_flip($this->getReleases($this->parent->by_object['group']->base));
+ $tmp = array_flip($this->Releases);
if(isset($tmp[$this->Release])){
$base = $tmp[$this->Release];
}else{