summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0d5bb38)
raw | patch | inline | side by side (parent: 0d5bb38)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 May 2006 08:06:11 +0000 (08:06 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 10 May 2006 08:06:11 +0000 (08:06 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3254 594d385d-05f5-0310-b6e9-bd551577e9d8
16 files changed:
index f5be5bc5f59ee94281bcc2247906b4d7049947bc..0bea1534b7e0d577d74004b31c7921a200da7d37 100644 (file)
--- a/TODO
+++ b/TODO
* Auto-Resize for subdialogs
-* Fix fai objects to generate tags if needed (sub objects)
-
+Now:
+* Add iframe progress for departments when handling tagging
* What about unitTag's when moving objects?
+ - ok for departments - everything is copied here anyway
+ - single object moving has to be checked
+* Check several ldap->cat() for needed attributes
+* Enhance show_ldap_error() with an additional programmer supplied message
+* New FAI package lists have a problem
Target for 2.5:
index 7884026d7b31a94f131b3c3f7e1117f98d5c2970..81e317daa5d5f0daa22c1c1e5f06929000994f28 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
*/
var $attrs= array();
+ /* Save unit tags */
+ var $gosaUnitTag= "";
/*!
\brief Used standard values
/* Copy needed attributes */
foreach ($this->attributes as $val){
- #if (isset($this->attrs["$val"][0])){
$found= array_key_ics($val, $this->attrs);
if ($found != ""){
$this->$val= $this->attrs["$found"][0];
}
}
+ /* gosaUnitTag loading... */
+ if (isset($this->attrs['gosaUnitTag'][0])){
+ $this->gosaUnitTag= $this->attrs['gosaUnitTag'][0];
+ }
+
/* Set the template flag according to the existence of objectClass
gosaUserTemplate */
if (isset($this->attrs['objectClass'])){
function handle_object_tagging($dn= "", $tag= "")
{
- /* Skip if nothing has changed */
- if ($dn == "" && !$this->is_modified){
- return;
- }
+ //FIXME: How to optimize this? We have at least two
+ // LDAP accesses per object. It would be a good
+ // idea to have it integrated.
/* No dn? Self-operation... */
if ($dn == ""){
if ($tag == ""){
$len= strlen($dn);
- echo "No tag for $dn - looking for one...<br>";
+ echo "DEBUG: No tag for $dn - looking for one...<br>";
$relevant= array();
foreach ($this->config->adepartments as $key => $ntag){
/* This one matches with the latter part. Break and don't fix this entry */
if (preg_match('/(^|,)'.normalizePreg($key).'$/', $dn)){
- echo "Possibly relevant: $key<br>";
+ echo "DEBUG: Possibly relevant: $key<br>";
$relevant[strlen($key)]= $ntag;
continue;
}
/* Set tag? */
if ($tag != ""){
- echo "Add tagging ($tag) to $dn.<br>";
-
/* Set objectclass and attribute */
$ldap= $this->config->get_ldap_link();
$ldap->cat($dn);
$attrs= $ldap->fetch();
+ if(isset($attrs['gosaUnitTag'][0]) && $attrs['gosaUnitTag'][0] == $tag){
+ echo "DEBUG: $dn is already tagged<br>";
+ return;
+ }
+ echo "DEBUG: Add tagging ($tag) to $dn.<br>";
$nattrs= array("gosaUnitTag" => $this->gosaUnitTag);
$nattrs['objectClass']= array();
for ($i= 0; $i<$attrs['objectClass']['count']; $i++){
$nattrs['objectClass'][]= "gosaAdministrativeUnitTag";
$ldap->cd($dn);
$ldap->modify($nattrs);
- if ($ldap->error != "Success"){
- print_red($ldap->get_error());
- }
+
} else {
- echo "Remove tagging from $dn.<br>";
-
/* Remove objectclass and attribute */
$ldap= $this->config->get_ldap_link();
$ldap->cat($dn);
$attrs= $ldap->fetch();
+ if (!in_array_ics("gosaAdministrativeUnitTag", $attrs['objectClass'])){
+ echo "DEBUG: $dn is not tagged<br>";
+ return;
+ }
+ echo "DEBUG: Remove tagging from $dn.<br>";
$nattrs= array("gosaUnitTag" => array());
$nattrs['objectClass']= array();
for ($i= 0; $i<$attrs['objectClass']['count']; $i++){
}
$ldap->cd($dn);
$ldap->modify($nattrs);
- if ($ldap->error != "Success"){
- print_red($ldap->get_error());
- }
+ show_ldap_error($ldap->get_error());
}
}
index 7ef96f62d0d0d2fddc3b20da324a1aa876fa4960..3fba9649cb826bbe96ba91b513e24ebe9ed7b38b 100644 (file)
}
show_ldap_error($ldap->get_error());
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
+
+ $ldap->cd($this->dn);
+
/* Prepare FAIscriptEntry to write it to ldap
* First sort array.
* Because we must delete old entries first.
$ldap->add($tmp);
$this->handle_post_events("add");
}
+ $this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
show_ldap_error($ldap->get_error());
}
}
index 7e72481f99b84beb4fe34b651cc44e2977d07add..f634e130506c898c5dbf814c7f8d308cd9e889ba 100644 (file)
}
show_ldap_error($ldap->get_error());
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
+ $ldap->cd($this->dn);
+
/* Save Package configurations */
foreach($this->ConfiguredPackages as $pkgname => $attrs){
foreach($attrs as $name => $attr){
$ldap->add($pkgattrs);
}
show_ldap_error($ldap->get_error());
+
+ /* Handle tagging */
+ $this->handle_object_tagging($pkgdn, $this->gosaUnitTag);
}
}
diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc
index 3e44dcbf3df6f208113de7d6eedbef764744afcc..50a9bb1cd63dfab112d54238721f30477a33f066 100644 (file)
show_ldap_error($ldap->get_error());
}
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
/* Sort entries, because we must delete entries with status="delete" first */
$order = array();
}
$ldap->cd($disk_dn);
$this->cleanup();
-$ldap->modify ($disk_attrs);
+ $ldap->modify ($disk_attrs);
}elseif($disk['status']== "new"){
if(empty($disk_attrs['description'])){
}
show_ldap_error($ldap->get_error());
+ $this->handle_object_tagging($disk_dn, $this->gosaUnitTag);
+ show_ldap_error($ldap->get_error());
+
if($disk['status']!="delete")
/* Add all partitions */
foreach($disk['partitions'] as $key => $partition){
$ldap->modify ($partition_attrs);
}
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error());
+
+ $this->handle_object_tagging($partition_dn, $this->gosaUnitTag);
+ show_ldap_error($ldap->get_error());
}
}
$this->handle_post_events("add");
index 2afb1e596a85c6dde715c32a05502e9fbee04f5f..a3976d254e099afc1c05d757d3add7badb22c478 100644 (file)
$ldap->add($this->attrs);
}
show_ldap_error($ldap->get_error());
+
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
}
}
index 9184d4a25305777080730d1e1c74d30bd67f2a82..c614aa04c8d9e32eeaed08ca6bff74c915eb0a4e 100644 (file)
}
show_ldap_error($ldap->get_error());
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
+
/* Prepare FAIscriptEntry to write it to ldap
* First sort array.
* Because we must delete old entries first.
$this->handle_post_events("add");
}
show_ldap_error($ldap->get_error());
+
+ $this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
+ show_ldap_error($ldap->get_error());
}
}
}
index bcaabc0ec0478ce801d1a2bddc3060ca3bed5e07..9ba26c6496b89a5464ce9b30ffd237f0d199d7fa 100644 (file)
}
show_ldap_error($ldap->get_error());
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
+
/* Prepare FAIscriptEntry to write it to ldap
* First sort array.
* Because we must delete old entries first.
}elseif($obj['status'] == "edited"){
$ldap->cd($sub_dn);
$this->cleanup();
-$ldap->modify ($tmp);
+ $ldap->modify ($tmp);
$this->handle_post_events("modify");
}elseif($obj['status']=="new"){
$this->handle_post_events("add");
}
show_ldap_error($ldap->get_error());
+
+ $this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
+ show_ldap_error($ldap->get_error());
}
}
}
index f0949890e14ea2aa1469139846b6845a96264108..4a901123ea6128c0fc6f4884ff01dce789cb74d6 100644 (file)
}
show_ldap_error($ldap->get_error());
+ /* Do object tagging */
+ $this->handle_object_tagging();
+ show_ldap_error($ldap->get_error());
+
/* Prepare FAIscriptEntry to write it to ldap
* First sort array.
* Because we must delete old entries first.
$this->handle_post_events("add");
}
show_ldap_error($ldap->get_error());
+
+ $this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
+ show_ldap_error($ldap->get_error());
}
}
}
index c097e7afe24d6d4587452d266466c1ea37c18fd2..c16313fe22f23de96f3554959d8533c68e7f7293 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}
index 44b99d69ff947231d4c03fcf58a5ecfb22d1a362..21b2fb48bd299c8d753b0d6d844fff0d1d55c19a 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}
index 5c44b82a721b98f3f082b92479f17bb90b6635d1..c18779abe68b661eecf0b171680ee804a4efba94 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}
index a63ac91660b92a468dbe44b9d266220bc940446a..3131a1dbe63c4c791e5802e7e86107e11b2c3ab0 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}
index 177e88a8e3bb33ede7d8fa3129dc707cb3876f44..22a34d2c9690ceac786eca76a8caa68a85773dc6 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}
index 142a4a5811e316059e87be5e5610c6d9d1d14995..28851dbaf6f0b45d6fcced868a68ba6fa0bfe052 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}
index e2b59917e7923a19db5c0f751986eff179926a53..c41a7f78c307c4fe012b238f00a7df70b3df376b 100644 (file)
$this->dn= $new_dn;
tabs::save(TRUE);
-
- /* Fix tagging if needed */
- $baseobject->handle_object_tagging();
}
}