[gosa.git] / trunk / gosa-plugins / goto / admin / systems / services / shares / class_goShareServer.inc
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];