summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50aa8d1)
raw | patch | inline | side by side (parent: 50aa8d1)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Jul 2006 11:53:32 +0000 (11:53 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 10 Jul 2006 11:53:32 +0000 (11:53 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4074 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions_FAI.inc | patch | blob | history | |
plugins/admin/fai/class_faiManagement.inc | patch | blob | history |
index a54100c03e90b5125f14a7af7d982b81e3b6b26e..4418a255ab267ccebaf5fcb4027e04a66cf426af 100644 (file)
function get_all_releases_from_base($dn,$appendedName=false)
{
global $config;
- $base = "ou=fai,ou=configs,ou=systems,".$dn;
+
+ if(!preg_match("/ou=fai,ou=configs,ou=systems,/",$dn)){
+ $base = "ou=fai,ou=configs,ou=systems,".$dn;
+ }else{
+ $base = $dn;
+ }
$res = array();
$ldap = $config->get_ldap_link();
}
+/* Remove numeric index and 'count' from ldap->fetch result */
function prepare_ldap_fetch_to_be_saved($attrs)
{
foreach($attrs as $key => $value){
}
+/* Save given attrs to specified dn*/
function save_FAI_object($dn,$attrs)
{
global $config;
$ldap->cat($dn,array("dn"));
if($ldap->count()){
+ /* Remove FAIstate*/
if(!isset($attrs['FAIstate'])){
$attrs['FAIstate'] = array();
}
$ldap->modify($attrs);
}else{
+
+ /* Unset description if empty */
+ if(empty($attrs['description'])){
+ unset($attrs['description']);
+ }
+
$ldap->add($attrs);
}
show_ldap_error($ldap->get_error(),sprintf(_("Release management failed, can't save '%s'"),$dn));
}
+/* Return FAIstate freeze branch or "" for specified release department */
function get_release_tag($dn)
{
global $config;
index 26542a1ae12b4e3c7aef3a17cf59835c89711960..5b202b1aa9c3fcd41b24bec1a7cefe1c53578433 100644 (file)
$ret = array("main"=>"/");
$ldap = $this->config->get_ldap_link();
if(!$base){
- $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
+ $base= $_SESSION['CurrentMainBase'];
}
- $ldap->ls("(objectClass=FAIbranch)",$base);
- while($attrs = $ldap->fetch()){
- if((isset($attrs['ou']))&&($attrs['dn']!=$base)){
- $ret[$attrs['dn']]= $prefix.$attrs['ou'][0];
- $ret = array_merge($ret,$this->getBranches($attrs['dn'],"".$prefix.$attrs['ou'][0]."/"));
- }
+ $tmp = get_all_releases_from_base($base,true);
+ foreach($tmp as $dn => $name){
+ $ret[$dn]=$name;
}
-
+ echo $base;
+ print_a($ret);
return ($ret);
}