summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 31ad119)
raw | patch | inline | side by side (parent: 31ad119)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Jul 2006 11:39:12 +0000 (11:39 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Jul 2006 11:39:12 +0000 (11:39 +0000) |
Added handling for newly created objects
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4029 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4029 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions_FAI.inc | patch | blob | history |
index b884925ad6f108e5f1705f92174f76ff65e7b4d1..24ff61ec81169f7f7462fa8f003b2a5ac310da4b 100644 (file)
This function resolves the release management
from base to the given dn.
*/
-function get_all_objects_for_given_base($Current_DN,$detailed = false)
+function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false)
{
global $config;
$ldap = $config->get_ldap_link();
/* Ldap search for fai classes specified in this release */
$ldap->cd($fai_base);
- $ldap->search("(objectClass=FAIclass)",array("dn","objectClass"));
+ $ldap->search($filter,array("dn","objectClass"));
/* check the returned objects, and add/replace them in our return vareable */
while($attr = $ldap->fetch()){
$previous_releases = get_previous_releases_of_this_release($base_release,true);
$following_releases= get_sub_releases_of_this_release($base_release,true);
+
+ global $config;
+ $ldap = $config->get_ldap_link();
+ $ldap->cd($config->current['BASE']);
+ $ldap->cat($Current_DN);
+ if(!$ldap->count()){
+ $is_new = true;
+ }else{
+ $is_new = false;
+ }
echo "<h2>".$Current_DN."</h2>";
if(count($following_releases) == 0 ){
echo "<b>Saving dircetly, is a leaf object</b><br>";
}else{
-
- echo "<b>This object has sub releases: </b><br>";
-
+
$r = get_following_releases_that_inherit_this_object($Current_DN);
- echo "This object must be updated <b>".$r[key($r)]."</b> with <b>".$parent_obj."</b><br>";
- unset($r[key($r)]);
+ if($is_new){
+ echo "Creating an empty entry for <b>".$r[key($r)]."</b><br>";
+ echo "By setting <b>'FAIstate'</b> to <b>'*|removed'</b><br>";
+ }else{
+ echo "<b>This object has sub releases: </b><br>";
+ echo "This object must be updated <b>".$r[key($r)]."</b> with <b>".$parent_obj."</b><br>";
+ }
+ unset($r[key($r)]);
echo "<br> the result will be inherited by .";
foreach($r as $release => $value){
- echo " : <i>".$release."</i><br>";
+ echo "<br> : <i>".$release."</i>";
}
}
-
echo "<br>.--------------------------------------------------------------------.<br>";
-
}
/* Check objectClasses and name to check if this is a release department */
if($ldap->count()){
$attrs = $ldap->fetch();
- if((in_array("FAIbranch",$attrs['objectClass'])) || ($attrs['ou'][0] == "fai")){
+
+ $ou = "";
+ if(isset($attrs['ou'][0])){
+ $ou = $attrs['ou'][0];
+ }
+
+ if((in_array("FAIbranch",$attrs['objectClass'])) || ($ou == "fai")){
return($attrs['dn']);
}
}
return("");
}
-
+// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>