summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5538f27)
raw | patch | inline | side by side (parent: 5538f27)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 16 Nov 2006 06:10:19 +0000 (06:10 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 16 Nov 2006 06:10:19 +0000 (06:10 +0000) |
To avoid share remove it is still in use
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5136 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5136 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_goShareServer.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_goShareServer.inc b/plugins/admin/systems/class_goShareServer.inc
index f9c0a0a04c946e0428919650a114d93c64efe541..5f580dde93e6d69bc6555e0bbb4f843506252a28 100644 (file)
$this->goExportEntryList[$key]=$entry[$key];
}
- function deleteFromList($id){
- unset($this->goExportEntryList[$id]);
+ function deleteFromList($id)
+ {
+ /* Check if the share is used by someone */
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($this->config->current['BASE']);
+ $ldap->search("(|(gotoProfileServer=*|$id)(gotoShare=*|$id|*))", array("cn"));
+ $cnt= $ldap->count();
+ if ($cnt){
+ $msg= sprintf(_("The share can't be removed since it is still used by %d users:"), $cnt);
+ $msg.= "<br><br><ul>";
+ while ($attrs= $ldap->fetch()){
+ $msg.= "<li>".$attrs["cn"][0]."</li>";
+ }
+ $msg.= "</ul>"._("Please correct the share-/profile settings of these users");
+ print_red($msg);
+
+ } else {
+ /* Finally remove it */
+ unset($this->goExportEntryList[$id]);
+ }
}
function process_mounts() {