From: cajus Date: Fri, 6 Nov 2009 17:00:59 +0000 (+0000) Subject: Updated a bunch of files for broken dn sensitivity X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=338a7b050f63f05ba9fd5d387e30db1913137f72;p=gosa.git Updated a bunch of files for broken dn sensitivity git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14789 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc index 2e266a903..62d3ff868 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc @@ -129,7 +129,7 @@ class mimetype extends plugin $this->base= dn2base($ui->dn); } } else { - $this->base= preg_replace ("/^.*,".preg_quote(get_ou("mimetypeRDN"), '/')."/", "", $this->dn); + $this->base= preg_replace ("/^.*,".preg_quote(get_ou("mimetypeRDN"), '/')."/i", "", $this->dn); } /* Get icon data */ diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc index f7be97b7e..5074c325f 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc @@ -593,7 +593,7 @@ class mimetypeManagement extends plugin if(!$this->IsReleaseManagementActivated()){ $use_base = $this->mime_base; if($SubSearch){ - $use_base = preg_replace("/^".preg_quote(get_ou("mimeou"), '/')."/","",$use_base); + $use_base = preg_replace("/^".preg_quote(get_ou("mimeou"), '/')."/i","",$use_base); } }else{ $use_base = $this->mime_release; @@ -690,7 +690,7 @@ class mimetypeManagement extends plugin if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){ /* Get dialog */ - $this->CopyPasteHandler->SetVar("base",preg_replace("/^".preg_quote(get_ou("mimetypeRDN"), '/')."/","",$this->mime_base)); + $this->CopyPasteHandler->SetVar("base",preg_replace("/^".preg_quote(get_ou("mimetypeRDN"), '/')."/i","",$this->mime_base)); $this->CopyPasteHandler->SetVar("parent",$this); $data = $this->CopyPasteHandler->execute(); diff --git a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc index 9473158f3..809cd7292 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_printGeneric.inc @@ -65,11 +65,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/Terminal/i",$this->BelongsTo) || preg_match("/TerminalTemplate/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } if(preg_match("/Workstation/i",$this->BelongsTo) || preg_match("/WorkstationTemplate/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } $this->orig_dn = $this->dn; @@ -98,10 +98,10 @@ class printgeneric extends plugin } else { /* Set base and check if the extracted base exists */ - if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/",$this->dn)){ - $this->base= preg_replace("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/","",dn2base($this->dn)); + if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$this->dn)){ + $this->base= preg_replace("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/i","",dn2base($this->dn)); }else{ - $this->base= preg_replace("/".preg_quote(get_ou('printerRDN'), '/')."/","",dn2base($this->dn)); + $this->base= preg_replace("/".preg_quote(get_ou('printerRDN'), '/')."/i","",dn2base($this->dn)); } if(!isset($this->config->idepartments[$this->base])){ @@ -244,11 +244,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/terminal/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } if(preg_match("/workstation/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } /* Detect if this is a valid printer account; @@ -628,11 +628,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/terminal/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/').",/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/').",/i",get_ou('printerRDN'),$this->dn); } if(preg_match("/workstation/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } /* Check if this dn points to a printer, to avoid deleting something else */ @@ -779,11 +779,11 @@ class printgeneric extends plugin /* Update dn, to ensure storing as printer instead of WS / terminal */ if(preg_match("/terminal/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } if(preg_match("/workstation/i",$this->BelongsTo)){ - $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/",get_ou('printerRDN'),$this->dn); + $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'), '/')."/i",get_ou('printerRDN'),$this->dn); } if(!$this->is_account) return; @@ -915,7 +915,7 @@ class printgeneric extends plugin } /* Ensure to create a new object */ - if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/",$this->orig_dn)){ + if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$this->orig_dn)){ $this->orig_dn = "new"; } diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 766eb1fe7..8ad176317 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -128,7 +128,7 @@ class termgeneric extends plugin $ui= get_userinfo(); $this->base= dn2base($ui->dn); } else { - $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("terminalRDN"), '/')."/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("terminalRDN"), '/')."/i", "", $this->dn); } /* Create an array of all Syslog servers */ @@ -465,7 +465,7 @@ class termgeneric extends plugin } if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ - if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/", $ldap->getDN())){ + if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i", $ldap->getDN())){ continue; } else { if ($attrs['dn'] != $this->orig_dn){ @@ -510,7 +510,7 @@ class termgeneric extends plugin $ldap= $this->config->get_ldap_link(); /* Strip relevant part from dn, keep trailing ',' */ - $tmp= preg_replace("/^cn=[^,]+,".get_ou('terminalRDN')."/i", "", $this->dn); + $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou('terminalRDN'), '/')."/i", "", $this->dn); $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp); /* Walk from top to base and try to load default values for diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index b45deb6a5..dd6a3837e 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -473,7 +473,7 @@ class workgeneric extends plugin } if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ - if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".get_ou('systemIncomingRDN')."/", $ldap->getDN())){ + if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i", $ldap->getDN())){ continue; } else { if ($attrs['dn'] != $this->orig_dn){ @@ -503,7 +503,7 @@ class workgeneric extends plugin }else{ /* Warn the user, that this host is currently installing */ if($this->currently_installing && !$this->currently_installing_warned && - !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->orig_dn)){ + !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->orig_dn)){ /* Force aborting without message dialog */ $message[] = ""; diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index 94aec4427..be726ecb4 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -777,7 +777,7 @@ class workstartup extends plugin $ldap= $this->config->get_ldap_link(); /* Strip relevant part from dn, keep trailing ',' */ - $tmp= preg_replace("/^cn=[^,]+,".get_ou('terminalRDN')."/i", "", $this->dn); + $tmp= preg_replace("/^cn=[^,]+,".preg_quote(get_ou('terminalRDN'), '/')."/i", "", $this->dn); $tmp= preg_replace("/".$this->config->current['BASE']."$/i", "", $tmp); /* Walk from top to base and try to load default values for @@ -1327,7 +1327,7 @@ class workstartup extends plugin */ function dn_to_release_name($dn) { - $relevant = preg_replace("/,".preg_quote(get_ou("faiBaseRDN"), '/').".*$/","",$dn); + $relevant = preg_replace("/,".preg_quote(get_ou("faiBaseRDN"), '/').".*$/i","",$dn); $parts = array_reverse(split("\,",$relevant)); $str =""; foreach($parts as $part){ diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index acbdf87ed..cf5ca5f88 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -77,11 +77,7 @@ class servgeneric extends plugin plugin::plugin ($config, $dn, $parent); - /* Initialize kerberos host key plugin */ - if(class_available("krbHostKeys")){ - $this->kerberos_key_service = new krbHostKeys($this->config,$this); - } - + /* Initialize */ $this->ui = get_userinfo(); $this->modes["active"]= _("Activated"); $this->modes["locked"]= _("Locked"); @@ -92,13 +88,18 @@ class servgeneric extends plugin $this->base= dn2base($ui->dn); $this->cn= ""; } else { - $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"), '/')."/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"), '/')."/i", "", $this->dn); } $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses); $this->netConfigDNS->set_acl_category("server"); $this->netConfigDNS->set_acl_base($this->base); $this->netConfigDNS->MACisMust =TRUE; + /* Initialize kerberos host key plugin */ + if(class_available("krbHostKeys")){ + $this->kerberos_key_service = new krbHostKeys($this->config,$this); + } + /* Check if this host is currently in installation process*/ if($this->dn != "new" && class_available("gosaSupportDaemon") && class_available("DaemonEvent")){ $o = new gosaSupportDaemon(); @@ -352,7 +353,7 @@ class servgeneric extends plugin if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ if ($attrs['dn'] != $this->orig_dn){ - if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".get_ou('systemIncomingRDN')."/",$attrs['dn']) && preg_match("/,".get_ou('serverRDN')."/",$attrs['dn'])){ + if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".preg_quote(get_ou('systemIncomingRDN'), '/')."/i",$attrs['dn']) && preg_match("/,".preg_quote(get_ou('serverRDN'), '/')."/i",$attrs['dn'])){ $message[]= msgPool::duplicated(_("Server name")); break; } @@ -362,7 +363,7 @@ class servgeneric extends plugin } /* Warn the user, that this host is currently installing */ - if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->orig_dn)){ + if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->orig_dn)){ /* Force aborting without message dialog */ $message[] = ""; diff --git a/gosa-plugins/systems/admin/systems/class_systemManagement.inc b/gosa-plugins/systems/admin/systems/class_systemManagement.inc index 84bd5b2b5..9caaffdcf 100644 --- a/gosa-plugins/systems/admin/systems/class_systemManagement.inc +++ b/gosa-plugins/systems/admin/systems/class_systemManagement.inc @@ -388,7 +388,7 @@ class systems extends plugin $this->systab= new $tabclass($this->config, $this->config->data['TABS'][$class], $this->dn, $selected_system); $this->systab->set_acl_base($this->DivListSystem->selectedBase); if($selected_group != "none"){ - $this->systab->base = preg_replace("/^[^,]+,".get_ou('ogroupRDN')."/", "", $selected_group); + $this->systab->base = preg_replace("/^[^,]+,".preg_quote(get_ou('ogroupRDN'), '/')."/i", "", $selected_group); $this->systab->by_object[$tabname]->base = $this->systab->base; } else { $this->systab->by_object[$tabname]->base = $this->DivListSystem->selectedBase; @@ -1101,7 +1101,7 @@ class systems extends plugin $dialog = FALSE; $hide_apply = $this->dn == "new"; - $hide_apply = ($this->dn == "new") || (preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/",$this->dn)); + $hide_apply = ($this->dn == "new") || (preg_match("/".preg_quote(get_ou("systemIncomingRDN"), '/')."/i",$this->dn)); if(is_object($this->systab) && !isset($this->systab->by_object)){ $dialog = TRUE; $hide_apply = TRUE;