summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6629bb4)
raw | patch | inline | side by side (parent: 6629bb4)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 6 Jan 2010 10:17:13 +0000 (10:17 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 6 Jan 2010 10:17:13 +0000 (10:17 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15078 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/class_faiManagement.inc | patch | blob | history | |
gosa-plugins/fai/admin/fai/class_filterFAI.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 9a9b232e8253083504e49dfc376594ca5adc842c..bc0fef35e34c983104be63821faa501755ecddb4 100644 (file)
}
return(array());
}
+
+
+ /* Check if the given FAI class is used in this release
+ */
+ static function check_class_name($oc,$name,$dn)
+ {
+ $base = FAI::get_release_dn($dn);
+
+ if($oc == "FAIprofile"){
+ $f = "";
+ $ocs = array("FAIprofile","FAItemplate","FAIhook","FAIpartitionTable","FAIpackageList","FAIscript","FAIvariable");
+ foreach($ocs as $oc){
+ $f .= "(objectClass=".$oc.")";
+ }
+ $res = FAI::get_all_objects_for_given_base($base,"(|".$f.")",TRUE);
+ }else{
+ $res = FAI::get_all_objects_for_given_base($base,"(objectClass=".$oc.")",TRUE);
+ }
+ $delete = array();
+ $used = array();
+ foreach($res as $object){
+ $used[$object['cn'][0]]= $object['cn'][0];
+ }
+ return($used);
+ }
+
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/gosa-plugins/fai/admin/fai/class_filterFAI.inc b/gosa-plugins/fai/admin/fai/class_filterFAI.inc
index 49d6d9a54b09278613d6123d40ad413aa06c31d7..c8d8ef6f34bc1829c0c89c8578cf49cc3fdb4546 100644 (file)
$entries[] = $item;
}
+
+ // Append opsi stuff ...
+ $opsi = new opsi($config);
+
+ if($opsi instanceof opsi && $opsi->enabled()){
+ $opsi_acl = $ui->get_permissions($base,"opsi/opsiProperties");
+ if(preg_match("/r/",$opsi_acl)){
+ $err = FALSE;
+ $n_pro = $opsi->get_netboot_products();
+ $err |= $opsi->is_error();
+ foreach($n_pro as $name => $data){
+ $entry = array(
+ "cn" => $name,
+ "description" => $data['DESC'],
+ "type" => "opsi_netboot");
+ $objects[$name]['opsi_netboot'] = $entry;
+ }
+ $l_pro = $opsi->get_local_products();
+ $err |= $opsi->is_error();
+ foreach($l_pro as $name => $data){
+ $entry = array("cn" => $name,
+ "description" => $data['DESC'],
+ "type" => "opsi_local");
+ $objects[$name]["opsi_local"] = $entry;
+ }
+ if($err){
+ msg_dialog::display(_("Error"),msgPool::siError($opsi->get_error()),ERROR_DIALOG);
+ }
+ }
+ }
+
+ foreach($objects as $name => $data)
+ {
+ $data = array_pop($data);
+ $item =array();
+
+ // FAKE_OC_IsBranch allows us to delete this entry (indicates NOT freezed state)
+ $item['objectClass'] = array('count' => 2, $data['type'], "FAKE_OC_IsBranch");
+ $item[] = 'objectClass';
+ $item['cn'] = $data['cn'];
+ $item[] = 'cn';
+ $item['description'] = $data['description'];
+ $item[] = 'description';
+ $item['dn'] = $data['cn'];
+ $item[] = 'dn';
+ $item['TYPES'] = array($data['type']);
+ $item[] = 'TYPES';
+ $item['count'] = '5';
+ $entries[] = $item;
+
+ }
+
return($entries);
}
}