summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 294e336)
raw | patch | inline | side by side (parent: 294e336)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 20 Oct 2009 08:38:36 +0000 (08:38 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 20 Oct 2009 08:38:36 +0000 (08:38 +0000) |
- prevent removal of used repositories
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14608 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14608 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc b/gosa-plugins/fai/admin/systems/services/repository/class_servRepository.inc
index 3a097e2610bc57f7a1537eb0bdc878d8074dbef7..f64861b2bcce2bec59b84389c7d0c61bf534118c 100644 (file)
}
+ function allow_remove()
+ {
+ /* Check if the service is still in use
+ */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ foreach($this->repositories as $repository) {
+ $url = $repository['Url'];
+ $ldap->search("(&(objectClass=gotoWorkstation)(objectClass=FAIobject)(FAIdebianMirror=".$url."))",array("cn","FAIclass"));
+ if ($ldap->count() != 0){
+ $obj= array();
+ $found= false;
+ while($attrs = $ldap->fetch()){
+ foreach($attrs['FAIclass'] as $class){
+ $obj[$ldap->getDN()]= $attrs['cn'][0];
+ $found= true;
+ }
+ }
+ if ($found){
+ $message = msgPool::stillInUse(_("Repository service")) . msgPool::buildList($obj);
+ return $message;
+ }
+ }
+ }
+ }
+
+
function remove_from_parent()
{
goService::remove_from_parent();