summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 771102f)
raw | patch | inline | side by side (parent: 771102f)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 May 2009 10:15:32 +0000 (10:15 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 May 2009 10:15:32 +0000 (10:15 +0000) |
to disallow removal of systems, when it provides shares
that are in use. (Trac: #2638)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13672 594d385d-05f5-0310-b6e9-bd551577e9d8
that are in use. (Trac: #2638)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13672 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc b/trunk/gosa-plugins/goto/admin/systems/services/shares/class_goShareServer.inc
index 833239a230670617e8d20440761ec5dcfc6341c0..7d7b05d9a7b19bf7881c1178d6dbd2edab8586d1 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']);
+ $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));
+ }
+ }
+
function addToList($entry){
$key = key($entry);
$this->goExportEntryList[$key]=$entry[$key];
diff --git a/trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po b/trunk/gosa-plugins/goto/locale/de/LC_MESSAGES/messages.po
index 5e54c9360bf6d85643af0f17f9ffbf6a5669b1d8..83d3a6f93420de58b77c1abef4eb5c706214d919 100644 (file)
msgid "Type"
msgstr "Typ"
+#: admin/systems/services/shares/class_goShareServer.inc:237
+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/devices/class_deviceGeneric.inc:265
msgid "Vendor"
msgstr "Hersteller"
diff --git a/trunk/gosa-plugins/goto/locale/messages.po b/trunk/gosa-plugins/goto/locale/messages.po
index f39445b999364a0d28c9b735b78db1a2cb3c36dc..7fd039d1dfb2e2af8f763ee542dce9a93dd7563e 100644 (file)
msgid "share"
msgstr ""
+#: admin/systems/services/shares/class_goShareServer.inc:237
+msgid "Cannot remove share - it is still in use by these objects: %s"
+msgstr ""
+
#: admin/systems/services/shares/class_goShareServer.inc:390
msgid "File service - Shares"
msgstr ""