[gosa.git] / gosa-plugins / fai / admin / systems / services / repository / class_servRepository.inc
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 349f28ef38ad32772f10583374c7161a6616979e..9dd3e82563b96ced92cb93aa51e2212a22778c04 100644 (file)
$ldap->cd ($this->config->current['BASE']);
$ldap->search("(&(objectClass=gotoWorkstation)(objectClass=FAIobject)(FAIdebianMirror=".$url."))",array("cn","FAIclass"));
$ldap->cd ($this->config->current['BASE']);
$ldap->search("(&(objectClass=gotoWorkstation)(objectClass=FAIobject)(FAIdebianMirror=".$url."))",array("cn","FAIclass"));
+ $found= false;
if ($ldap->count() != 0){
$obj= array();
if ($ldap->count() != 0){
$obj= array();
- $found= false;
while($attrs = $ldap->fetch()){
foreach($attrs['FAIclass'] as $class){
while($attrs = $ldap->fetch()){
foreach($attrs['FAIclass'] as $class){
- if(preg_match("/".str_replace("/","\/",$release)."$/i",$class)){
+ if(preg_match("/:".str_replace("/","\/",$release)."$/i",$class)){
$obj[$ldap->getDN()]= $attrs['cn'][0];
$found= true;
}
}
}
$obj[$ldap->getDN()]= $attrs['cn'][0];
$found= true;
}
}
}
+ }
- if ($found){
- msg_dialog::display(_("Error"), msgPool::stillInUse(_("FAI release"), msgPool::buildList($obj)), ERROR_DIALOG);
- }
+ if ($found){
+ msg_dialog::display(_("Error"), msgPool::stillInUse(_("FAI release"), msgPool::buildList($obj)), ERROR_DIALOG);
}else{
if(isset($this->repositories[$value])){
unset($this->repositories[$value]);
}else{
if(isset($this->repositories[$value])){
unset($this->repositories[$value]);
$evt = $events['TRIGGERED']['DaemonEvent_recreate_fai_server_db'];
$tmp = new $evt['CLASS_NAME']($this->config);
$tmp->set_type(TRIGGERED_EVENT);
$evt = $events['TRIGGERED']['DaemonEvent_recreate_fai_server_db'];
$tmp = new $evt['CLASS_NAME']($this->config);
$tmp->set_type(TRIGGERED_EVENT);
- $tmp->add_targets(array("GOsa"));
+ $tmp->add_targets(array("GOSA"));
$o_queue = new gosaSupportDaemon();
if(!$o_queue->append($tmp)){
msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
$o_queue = new gosaSupportDaemon();
if(!$o_queue->append($tmp)){
msg_dialog::display(_("Service infrastructure"),msgPool::siError($o_queue->get_error()),ERROR_DIALOG);
}
}
+ 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();
function remove_from_parent()
{
goService::remove_from_parent();
# "stop" => _("Service stop"), // Remove this to hide the stop button at all.
# "restart" => _("Service restart"),// Remove this to hide the restart button at all.
# "stop" => _("Service stop"), // Remove this to hide the stop button at all.
# "restart" => _("Service restart"),// Remove this to hide the restart button at all.
- "cn" => _("Name"),
- "Release" => _("Releases"),
- "Section" => _("Sections"),
+# "cn" => _("Name"),
"ParentServer" => _("Parent server"),
"ParentServer" => _("Parent server"),
- "Url" => _("Url"))
+ "Release" => _("Releases"),
+ "Url" => _("URL"),
+ "Section" => _("Sections"))
));
}
}
));
}
}