summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 504b43e)
raw | patch | inline | side by side (parent: 504b43e)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 May 2009 09:51:54 +0000 (09:51 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 May 2009 09:51:54 +0000 (09:51 +0000) |
to disallow removal of systems, when it provides services
that are in use.
(Trac: #2638)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13670 594d385d-05f5-0310-b6e9-bd551577e9d8
that are in use.
(Trac: #2638)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13670 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/trunk/gosa-plugins/systems/admin/systems/services/class_goService.inc b/trunk/gosa-plugins/systems/admin/systems/services/class_goService.inc
index 1134f1cd7fc3927a1297dda5570c10732b632f3e..f48649c984a5f7de70f560c67c0fc1ae42ba31a7 100644 (file)
$this->$flag = $attrs[$flag][0];
}
}
+
+ function allow_remove()
+ {
+ /* Check if the service is still in use */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $cn = $ldap->getCn($this->dn);
+ $ldap->search("(&(|(objectClass=posixGroup)(objectClass=posixAccount))(gotoShare=$cn|*))", array("dn"));
+
+ if($ldap->count()){
+ /* Number of entries shown in warning */
+ $i = 3;
+ $str = '<p>';
+ while(($attrs = $ldap->fetch()) && $i >= 0){
+ $i --;
+ if(isset($attrs['dn'])){
+ $str .= '<i>' . $attrs['dn']."</i><br/>";
+ }
+ }
+ $str .= '</p>';
+ return(sprintf(_("Cannot remove share - it is still in use by these objects: %s"), $str));
+ }
+ }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?>
diff --git a/trunk/gosa-plugins/systems/locale/de/LC_MESSAGES/messages.po b/trunk/gosa-plugins/systems/locale/de/LC_MESSAGES/messages.po
index eb1a60566e9c212518d0ed5c98b2b48cd212c746..1c25a6107a6072b1ed6b1581d875b855ada8c67b 100644 (file)
msgid "Configuration error"
msgstr "Konfigurationsfehler"
+#: admin/systems/services/class_goService.inc:280
+msgid "Cannot remove share - it is still in use by these objects: %s"
+msgstr "Freigabe kann nicht entfernt werden - sie wird noch von diesen Objekten benutzt: %s"
+
#: admin/systems/services/ServiceAddDialog.tpl:3
msgid "Adding a new service to the current server"
msgstr "Hinzufügen eines neues Dienstes zum gewählten Server"
diff --git a/trunk/gosa-plugins/systems/locale/messages.po b/trunk/gosa-plugins/systems/locale/messages.po
index 92e6f14a26de0fd0b586efeecb88c5b7c65afb10..958d05dddbb635e47695abdce73e2896bc134a8c 100644 (file)
msgid "Restart"
msgstr ""
+#: admin/systems/services/class_goService.inc:280
+msgid "Cannot remove share - it is still in use by these objects: %s"
+msgstr ""
+
#: admin/systems/class_serverService.inc:351
msgid "Information"
msgstr ""