summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: daa0ee4)
raw | patch | inline | side by side (parent: daa0ee4)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Oct 2008 15:53:01 +0000 (15:53 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Oct 2008 15:53:01 +0000 (15:53 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12851 594d385d-05f5-0310-b6e9-bd551577e9d8
47 files changed:
diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc
index d256d7a682eaf35e1f4c298af984d5a2bbbc2fd9..27ad5c002bd9f29a56a6d8104ad5d8a94aec92b6 100644 (file)
}
/* This one matches with the latter part. Break and don't fix this entry */
- if (preg_match('/(^|,)'.normalizePreg($key).'$/', $attrs['dn'])){
+ if (preg_match('/(^|,)'.preg_quote($key).'$/', $attrs['dn'])){
$fix= false;
break;
}
}
/* This one matches with the latter part. Break and don't fix this entry */
- if (preg_match('/(^|,)'.normalizePreg($key).'$/', $dn)){
+ if (preg_match('/(^|,)'.preg_quote($key).'$/', $dn)){
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, "DEBUG: Possibly relevant: $key", "Tagging");
$relevant[strlen($key)]= $ntag;
continue;
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 3cafa82664b88a07973703976789b872900a05d0..35c12d1516bd241131227b59484d17b14e3ee7c7 100644 (file)
$this->usertab->givenName = $this->givenName;
$template_dn = $_POST['template'];
$this->usertab->adapt_from_template($template_dn);
- $template_base = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/", '', $template_dn);
+ $template_base = preg_replace("/^[^,]+,".preg_quote(get_people_ou())."/", '', $template_dn);
$this->usertab->by_object['user']->base= $template_base;
}
/* Skip entries that are not located under the people ou (normaly 'ou=people,')
* Else winstations will be listed too, if you use the subtree flag.
*/
- if(!preg_match("/".normalizePreg(get_people_ou())."/i",$Entry['dn'])){
+ if(!preg_match("/".preg_quote(get_people_ou())."/i",$Entry['dn'])){
continue;
}else{
diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc
index 9de097644c1a9d0bb6c1eb4940a77f1c7b0346be..70fb3b4f2fcd8149ea8880c4a0d9551e5b071505 100644 (file)
$this->outside_winstations = array();
while($attrs = $ldap->fetch()){
- if((!preg_match("/^[^,]+,".normalizePreg($winstation_ou)."/",$attrs['dn'])) && !preg_match("/,dc=addressbook,/",$attrs['dn'])){
+ if((!preg_match("/^[^,]+,".preg_quote($winstation_ou)."/",$attrs['dn'])) && !preg_match("/,dc=addressbook,/",$attrs['dn'])){
$attrs['selected'] = FALSE;
$attrs['ldif'] = "";
$this->outside_winstations[base64_encode($attrs['dn'])] = $attrs;
$this->outside_groups = array();
$this->groups_list = array();;
while($attrs = $ldap->fetch()){
- $group_db_base = preg_replace("/^[^,]+,".normalizePreg($group_ou)."+,/i","",$attrs['dn']);
+ $group_db_base = preg_replace("/^[^,]+,".preg_quote($group_ou)."+,/i","",$attrs['dn']);
/* Check if entry is not an addressbook only user
* and verify that he is in a valid department
*/
- if( !preg_match("/".normalizePreg("dc=addressbook,")."/",$group_db_base) &&
+ if( !preg_match("/".preg_quote("dc=addressbook,")."/",$group_db_base) &&
!in_array($group_db_base,$valid_deps)
){
$attrs['selected'] = FALSE;
}
while($attrs = $ldap->fetch()){
- $people_db_base = preg_replace("/^[^,]+,".normalizePreg($people_ou)."/i","",$attrs['dn']);
+ $people_db_base = preg_replace("/^[^,]+,".preg_quote($people_ou)."/i","",$attrs['dn']);
/* Check if entry is not an addressbook only user
* and verify that he is in a valid department
*/
- if( !preg_match("/".normalizePreg("dc=addressbook,")."/",$people_db_base) &&
+ if( !preg_match("/".preg_quote("dc=addressbook,")."/",$people_db_base) &&
!in_array($people_db_base,$valid_deps)
){
$attrs['selected'] = FALSE;
diff --git a/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc b/gosa-plugins/addressbook/addons/addressbook/class_addressbook.inc
index 369acd0dd866a9476c0fb340401f793fb9dfdf89..fd3304b082ad4a0ebaa68b4f1bb6f231bf5c3f29 100644 (file)
$acls = "";
/* Use addressbook acls */
- if(preg_match("/".normalizePreg($this->abobjectclass)."/",$dn)) {
- $dn = preg_replace("/".normalizePreg($this->abobjectclass).",/","",$dn);
+ if(preg_match("/".preg_quote($this->abobjectclass)."/",$dn)) {
+ $dn = preg_replace("/".preg_quote($this->abobjectclass).",/","",$dn);
$acls = $this->ui->get_permissions($dn,"addressbook/addressbook",$attr);
}
diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc
index 1a2222230f5d784440e3e16300662ae4fbf63150..1b5201d24043e060f5351f88ce47a33003c021de 100644 (file)
foreach ($this->dhcpObjectCache as $dn => $data){
if($this->dn != $this->orig_dn){
- $dn = preg_replace("/".normalizePreg($this->orig_dn)."$/i",$this->dn,$dn);
+ $dn = preg_replace("/".preg_quote($this->orig_dn)."$/i",$this->dn,$dn);
}
/* Remove entry? */
if(in_array($attribute,array("dhcpPrimaryDN","dhcpSecondaryDN","dhcpServerDN","dhcpFailOverPeerDN"))){
foreach($values as $v_key => $value){
- $values[$v_key] = preg_replace("/".normalizePreg($this->orig_dn)."$/i",$this->dn,$value);
+ $values[$v_key] = preg_replace("/".preg_quote($this->orig_dn)."$/i",$this->dn,$value);
}
}
$this->dhcpServiceDN= $this->serviceDN;
if($this->dn != $this->orig_dn){
- $this->dhcpServiceDN= preg_replace("/".normalizePreg($this->orig_dn)."$/i",$this->dn,$this->dhcpServiceDN);
+ $this->dhcpServiceDN= preg_replace("/".preg_quote($this->orig_dn)."$/i",$this->dn,$this->dhcpServiceDN);
}
/* Replace 'new' dn */
while($attrs = $ldap->fetch()){
/* Skip own config */
- if($this->dn != "new" && preg_match("/".normalizePreg($this->dn)."$/",$attrs['dn'])){
+ if($this->dn != "new" && preg_match("/".preg_quote($this->dn)."$/",$attrs['dn'])){
continue;
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_DNS.inc
index af7994697441a997990e35ca91a0e07af30f2187..205e3320912083d901fbaa9bd8b5e7416f8fa39f 100644 (file)
*/
$zN = trim($zone,".");
$nN = trim($name,".");
- if(preg_match("/".normalizePreg($zN)."$/",$nN)){
- $nN = preg_replace("/[\.]*".normalizePreg($zN)."[\.]*$/","",$nN);
+ if(preg_match("/".preg_quote($zN)."$/",$nN)){
+ $nN = preg_replace("/[\.]*".preg_quote($zN)."[\.]*$/","",$nN);
}else{
$nN = $name;
}
/* Check given host name with zone settings
*/
- if(preg_match("/".normalizePreg($testname)."[\.]*$/",$nN) || $attrs['relativeDomainName'][0] == $name){
+ if(preg_match("/".preg_quote($testname)."[\.]*$/",$nN) || $attrs['relativeDomainName'][0] == $name){
$ret['exists'] = true;
$ret['zoneName'] = $id_tmp;
foreach(array("dNSClass","dNSTTL") as $atr){
$zN = trim($zoneName,".");
$nN = trim($newName,".");
$oN = trim($oldName,".");
- $newName = preg_replace("/[\.]*".normalizePreg($zN)."$/i","",$nN);
- $oldName = preg_replace("/[\.]*".normalizePreg($zN)."$/i","",$oN);
+ $newName = preg_replace("/[\.]*".preg_quote($zN)."$/i","",$nN);
+ $oldName = preg_replace("/[\.]*".preg_quote($zN)."$/i","",$oN);
/* If reverseZone can't be resolved ... this
* can't be a valid entry, so remove this account
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNS.inc
index bd90bd28d5b70bf3c9d38c05bec8134f34ace8f2..aa9722b108ded139fca7c07a96b96142702bdd0c 100644 (file)
$dns = array();
while($attrs = $ldap->fetch()){
/* Skip own config */
- if($this->dn != "new" && preg_match("/".normalizePreg($this->dn)."$/",$attrs['dn'])){
+ if($this->dn != "new" && preg_match("/".preg_quote($this->dn)."$/",$attrs['dn'])){
continue;
}
$dn = preg_replace("/^zoneName=[^,]+,/","",$attrs['dn']);
$ldap->ls("(objectClass=dnsZone)",$src,array('cn'));
while($attrs = $ldap->fetch()){
$src_zone = $attrs['dn'];
- $dst_zone = preg_replace("/".normalizePreg($src)."$/",$this->dn,$src_zone);
+ $dst_zone = preg_replace("/".preg_quote($src)."$/",$this->dn,$src_zone);
$res = plugin::recursive_move($src_zone, $dst_zone);
if($res){
foreach($tmp as $key1 => $data1){
$tmp2[$key1] = array();
foreach($data1 as $key2 => $data2){
- $tmp2[$key1][preg_replace("/".normalizePreg($old_dn)."$/",$this->dn,$key2)] = $data2;
+ $tmp2[$key1][preg_replace("/".preg_quote($old_dn)."$/",$this->dn,$key2)] = $data2;
}
}
$tmp = $tmp2;
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZone.inc
index 160790fab921c9626727f1ee1e87bbfb5a402407..b5854fc9d780e888160481691f294e34e49a8ff6 100644 (file)
$tmp2[$tmp[0]] = $rec;
unset($this->Records[$key]);
}
- if($rec['type'] == "nSRecord" && preg_match("/".normalizePreg($this->sOAprimary)."/",$rec['value'])){
+ if($rec['type'] == "nSRecord" && preg_match("/".preg_quote($this->sOAprimary)."/",$rec['value'])){
unset($this->Records[$key]);
}
}
diff --git a/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc b/gosa-plugins/dns/admin/systems/services/dns/class_servDNSeditZoneEntries.inc
index 78b9be741e3819c429ec63295341b81302612168..59cab870136f24026f8cd9ceae52de3d6c9d2517 100644 (file)
$found = false;
$ip = $value;
$match = preg_replace("/^[^\/]*+\//","",$this->reverseName);
- $ip = preg_replace("/^".normalizePreg($match)."/","",$ip);
+ $ip = preg_replace("/^".preg_quote($match)."/","",$ip);
$ip = preg_replace("/^\./","",$ip);
foreach($this->Devices[$Name]['RECORDS'] as $key => $dev){
index e6e191814e596b3526b6b555fe3791ef98acc9b3..677a8b925e8b4c6ba33bc06dec7ac4e9a31fcbdf 100644 (file)
foreach($res_tmp as $attr){
$buffer = array();
- $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']);
+ $name = preg_replace("/".preg_quote($release)."/i","",$attr['dn']);
if(isset($attr['FAIstate'][0])){
if(preg_match("/removed$/",$attr['FAIstate'][0])){
/* Seems to be an inherited class, apply current FAIstate to this classes
*/
- if(!preg_match("/".normalizePreg($base_release)."$/i",$attr['dn'])){
+ if(!preg_match("/".preg_quote($base_release)."$/i",$attr['dn'])){
$buffer['FAIstate'] = $FAIstate;
}else{
{
global $config;
- if(!preg_match("/".normalizePreg(get_ou('faiBaseRDN'))."/",$dn)){
+ if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'))."/",$dn)){
$base = get_ou('faiBaseRDN').$dn;
}else{
$base = $dn;
$ldap->search("(objectClass=FAIbranch)",array("ou","dn"));
while($attrs = $ldap->fetch()){
if($appendedName){
- $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".normalizePreg(get_ou('faiBaseRDN')).".*$/","",$attrs['dn']));
+ $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN')).".*$/","",$attrs['dn']));
}else{
$res[$attrs['dn']] = $attrs['ou'][0];
}
/* Dont't try to modify non FAIclasses
*/
- if(!preg_match("/[^,]+,".normalizePreg(get_ou("faiBaseRDN"))."/",$obj_dn)){
+ if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"))."/",$obj_dn)){
trigger_error("PLEASE check fai class handling in ".__LINE__." -> ".__FILE__);
echo "<br>-->".$Current_DN."<br>";
echo "<br>-->".$obj_dn."<br>";
/* Check if this Profile uses the source class ($cn)
*/
- if(preg_match("/".normalizePreg($cn)."/",$attrs['FAIclass'])){
- $attrs['FAIclass'] = preg_replace("/[ ]*".normalizePreg($cn)."[ ]*/i"," ",$attrs['FAIclass']);
+ if(preg_match("/".preg_quote($cn)."/",$attrs['FAIclass'])){
+ $attrs['FAIclass'] = preg_replace("/[ ]*".preg_quote($cn)."[ ]*/i"," ",$attrs['FAIclass']);
if(empty($attrs['FAIclass'])){
$attrs['FAIclass'] = array();
}
$buffer = array();
# $name = str_ireplace($release,"",$attr['dn']);
- $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']);
+ $name = preg_replace("/".preg_quote($release)."/i","",$attr['dn']);
if(isset($attr['FAIstate'][0])&&(preg_match("/removed$/",$attr['FAIstate'][0]))){
/* Get dn suffix. Example "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */
# $dn_suffix = str_ireplace($base_release,"",$dn);
- $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn);
+ $dn_suffix = preg_replace("/".preg_quote($base_release)."/i","",$dn);
/* Check if given object also exists whitin one of these releases */
foreach($sub_releases as $p_release => $name){
/* Get dn suffix. Example "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */
# $dn_suffix = str_ireplace($base_release,"",$dn);
- $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn);
+ $dn_suffix = preg_replace("/".preg_quote($base_release)."/i","",$dn);
/* Check if given object also exists whitin one of these releases */
foreach($previous_releases as $p_release){
$ret = array();
/* Explode dns into pieces, to be able to build parent dns */
- $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$dn));
+ $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".preg_quote(",".$config->current['BASE'])."/i","",$dn));
if(!is_array($dns_to_check)){
return;
$ldap->search("(objectClass=FAIbranch)",array("ou","FAIstate"));
while($attrs = $ldap->fetch()){
foreach($sub_releases as $sub_rel){
- if(preg_match("/^".normalizePreg($sub_rel.get_ou('faiBaseRDN'))."/",$attrs['dn'])){
+ if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'))."/",$attrs['dn'])){
$f_releases[$sub_rel.get_ou('faiBaseRDN')] = $attrs;
}
}
}else{
$source_dns = array();
foreach($g_releases as $dn => $data){
- if(preg_match("/^".normalizePreg($source_dn)."/",$dn)){
+ if(preg_match("/^".preg_quote($source_dn)."/",$dn)){
$source_dns[$dn] = $data;
}
}
$ldap->cd($dn);
$ldap->ls("(|(objectClass=gotoSubmenuEntry)(objectClass=gotoMenuEntry))",$dn,array("dn"));
while($attrs = $ldap->fetch()){
- $destination = preg_replace("/".normalizePreg($dn)."$/","ou=".$destination_name.",".$dn,$attrs['dn']);
+ $destination = preg_replace("/".preg_quote($dn)."$/","ou=".$destination_name.",".$dn,$attrs['dn']);
$to_copy[$attrs['dn']] = $destination;
}
}
$ldap->cd($config->current['BASE']);
/* Split dn into pices */
- $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$Current_DN));
+ $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".preg_quote(",".$config->current['BASE'])."/i","",$Current_DN));
if(!is_array($dns_to_check)){
return;
diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc
index 5753521c68310288c0de6ec92d391efbbc619683..5005cce1563c607489a25d89f0cc462699ff753c 100644 (file)
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "FreshLoaded";
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
foreach($this->SubObjects as $name => $obj){
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
}
$this->handle_post_events("remove");
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "edited";
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index adf9d12cbea4afa8ccfa715fa2455db30212d049..3114ba7fab802cecd5872d59e024a682e25975a0 100644 (file)
$ldap->cd($bb);
$ldap->recursive_remove();
- $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiBaseRDN')).'/', ','.get_ou('applicationRDN'), $bb));
+ $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN')).'/', ','.get_ou('applicationRDN'), $bb));
$ldap->recursive_remove();
- $ldap->cd(preg_replace('/,'.normalizePreg(get_ou('faiBaseRDN')).'/', ','.get_ou('mimetypeRDN'), $bb));
+ $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN')).'/', ','.get_ou('mimetypeRDN'), $bb));
$ldap->recursive_remove();
/* Search for all groups with configured application menus.
- The search für menu configuration for the specified release and collect all those dns.
- Remove entries
*/
- $release_ou = preg_replace("/".normalizePreg(get_ou("faiBaseRDN")).".*$/","",$bb);
+ $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN")).".*$/","",$bb);
$ldap->cd($this->config->current['BASE']);
$ldap->search("(objectClass=posixGroup)",array("dn"));
$ldap->cd($dn);
$ldap->search("(objectClass=FAIbranch)",array("dn"));
while($attrs = $ldap->fetch()){
- if(preg_match("/^".normalizePreg($release_ou)."/",$attrs['dn'])){
+ if(preg_match("/^".preg_quote($release_ou)."/",$attrs['dn'])){
$dns[] = $attrs['dn'];
}
}
}
}
- $appsrc = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),$baseToUse);
- $appdst = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ;
+ $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),$baseToUse);
+ $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ;
- $mimesrc = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),$baseToUse);
- $mimedst = preg_replace("/".normalizePreg(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ;
+ $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),$baseToUse);
+ $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'))."/",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ;
/* Check if source depeartments exist */
foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index 22c8637c07c0c0b564fb8ff1ad4855e749d94088..d62a5458c171324b0793d67c6146d48eac396d9e 100644 (file)
/* Assemble release name */
$release = $this->parent->parent->fai_release;
- $tmp= preg_replace('/[,]*'.normalizePreg(get_ou('faiBaseRDN')).'.*$/', '', $release);
+ $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN')).'.*$/', '', $release);
$tmp= preg_replace('/ou=/', '', $tmp);
$rev= array_reverse(split(',', $tmp));
$this->FAIdebianRelease= "/";
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
foreach($this->ConfiguredPackages as $pkgname => $attrs){
foreach($attrs as $name => $attr){
$pkgdn = "FAIvariable=".$name.",".$this->dn;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $pkgdn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $pkgdn);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
}
}
if($this->FAIdebianRelease == "ClearFromCopyPaste"){
$current_release = $this->parent->parent->fai_release;
- $tmp= preg_replace('/,'.normalizePreg(get_ou('faiBaseRDN')).'.*$/', '', $current_release);
+ $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN')).'.*$/', '', $current_release);
$tmp= preg_replace('/ou=/', '', $tmp);
$rev= array_reverse(split(',', $tmp));
$this->FAIdebianRelease= "";
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index eac75522a0ed88d522d730b979a4b4000e64d082..d83ae91b6c1306b8eb65b2a8ea914949b496652c 100644 (file)
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
$objects = array();
$objects['description'] = "";
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($disk['dn'])."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($disk['dn'])."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "edited";
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
foreach($this->disks as $disk){
$disk_dn = "cn=".$disk['cn'].",".$this->dn;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i",$release, $disk_dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i",$release, $disk_dn);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
foreach($disk['partitions'] as $key => $partition){
$partition_dn= "FAIpartitionNr=".$partition['FAIpartitionNr'].",".$disk_dn;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $partition_dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $partition_dn);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
}
}
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
$objects = array();
$objects['description'] = "";
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($disk['dn'])."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($disk['dn'])."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "edited";
diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc
index e6c007efbff6626a5674652118cbfa01f31926d2..9eca6ad6528a5e8ffdf63f358bfed6908801ec87 100644 (file)
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
$this->handle_post_events("remove");
diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc
index 7a480bbea4acc83676a45c10e9707fab401af1cb..a762beb54dee114183b6ef2fc0f68c3b98147fc5 100644 (file)
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "FreshLoaded";
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
foreach($this->SubObjects as $name => $obj){
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
}
$this->handle_post_events("remove");
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "edited";
diff --git a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc
index 99e6043783299f6b674cfae43fc8813ef36fb672..6d6aa0b4250a4a788c58ed83f332bb9b7f29a137 100644 (file)
/* Get Classes and release */
$this->Classes = $this->parent->by_object['faiProfile']->FAIclasses;
$this->base = $this->parent->by_object['faiProfile']->parent->parent->fai_release;
- $str = preg_replace("/^.*".normalizePreg(get_ou('faiProfileRDN'))."/","",$this->dn);
+ $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'))."/","",$this->dn);
$tmp = $this->parent->by_object['faiProfile']->parent->parent->getBranches();
$this->Release = $tmp[$this->base];
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
index f53314bda3a6daa2739b43a2cb0425d51f01a8a1..3bc50dd4a261643d3c366fc79f28387f1a383e12 100644 (file)
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($this->dn)."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($this->dn)."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "FreshLoaded";
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
foreach($this->SubObjects as $name => $obj){
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
}
$this->handle_post_events("remove");
foreach($res as $obj){
/* Skip not relevant objects */
- if(!preg_match("/".normalizePreg($source['dn'])."$/i",$obj['dn'])) continue;
+ if(!preg_match("/".preg_quote($source['dn'])."$/i",$obj['dn'])) continue;
$objects = array();
$objects['status'] = "edited";
diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc
index 40ece132514c32bb34b116f27ba164e1ca17b31b..f8f1b3be44483430aeca053dce72cf9e50cab267 100644 (file)
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$release = $this->parent->parent->fai_release;
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $this->dn);
new log("remove","fai/".get_class($this),$use_dn,$this->attributes);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
foreach($this->SubObjects as $name => $obj){
- $use_dn = preg_replace("/".normalizePreg(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
+ $use_dn = preg_replace("/".preg_quote(FAI::get_release_dn($this->dn))."/i", $release, $obj['dn']);
FAI::prepare_to_save_FAI_object($use_dn,array(),true);
}
$this->handle_post_events("remove");
diff --git a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc
index f40e3cb71ab0cce6ed3cf3f0df79a3d97dc1026d..e0b758aafbbc4ff656d2bca05d3b8e39c722af53 100644 (file)
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("phoneRDN"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("phoneRDN"))."/", "", $this->dn);
}
if($this->goFonMSN != ""){
diff --git a/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc b/gosa-plugins/gofon/gofon/conference/class_phoneConferenceGeneric.inc
index 1c2e698aa645c238ea5e94fa352b83686dfa815e..899b2c231d9b850b5614dfe85b266a4b4ccd01cf 100644 (file)
} else {
/* Get base */
- $this->base = preg_replace ("/^[^,]+,".normalizePreg(get_ou('phoneConferenceRDN'))."/i","",$this->dn);;
+ $this->base = preg_replace ("/^[^,]+,".preg_quote(get_ou('phoneConferenceRDN'))."/i","",$this->dn);;
}
$this->goFonConferenceOwner=$this->ui->dn;
diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc
index 273e6853188ef3b8ce66ae16001e59a49c69488c..d9f2cf6ba57ccb821949d76fb5812eeb863fa02e 100644 (file)
}
} else {
$this->orig_cn=$this->cn;
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("phoneMacroRDN"))."/i", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("phoneMacroRDN"))."/i", "", $this->dn);
}
/* Check server configurations
diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc
index 2d234439726f1f53b46467aaf77263fffbf17042..2176e776b63c367c75f5e4815535c1b00330aff5 100644 (file)
/* Skip all macros we are not able to read
execpt, the currently selected macro.
*/
- if(!preg_match("/r/",$acl) && !preg_match("/^".normalizePreg($attrs['dn'])."/",$this->goFonMacro)){
+ if(!preg_match("/r/",$acl) && !preg_match("/^".preg_quote($attrs['dn'])."/",$this->goFonMacro)){
continue;
}
diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc
index 953f45a823a21adad40343c7fc1d3c7611df7755..f8364a09999fc3dd0ae42a310269a1fce468605c 100644 (file)
restore_error_handler();
/* Parse release out of object dn */
- $release = preg_replace("/".get_ou("applicationRDN").normalizePreg($this->base)."$/","",$this->dn);
+ $release = preg_replace("/".get_ou("applicationRDN").preg_quote($this->base)."$/","",$this->dn);
$release = preg_replace("/^cn=[^,]+,/","",$release);
/* Get a list of all groups
$ldap->cd($release.$group);
$ldap->search("(objectClass=gotoMenuEntry)",array("dn"));
while($attrs = $ldap->fetch()){
- $info = preg_replace("/".normalizePreg($release.$group)."$/","",$attrs['dn']);
+ $info = preg_replace("/".preg_quote($release.$group)."$/","",$attrs['dn']);
if(preg_match("/^cn=".$this->cn."/",$info) && !preg_match("/ou=[^,]+,/",$info)){
$found[] = $attrs['dn'];
}
diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc
index 0a8914e51ba4793ca1986c4d8ec37eb38025a614..942e1c4bf5cfff6955df6f79e04d0f6e7368635a 100644 (file)
if(!$this->IsReleaseManagementActivated()){
$use_base = $this->app_base;
if($SubSearch){
- $use_base = preg_replace("/^".normalizePreg(get_ou("applicationRDN"))."/","",$use_base);
+ $use_base = preg_replace("/^".preg_quote(get_ou("applicationRDN"))."/","",$use_base);
}
}else{
$use_base = $this->app_release;
diff --git a/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc b/gosa-plugins/goto/admin/groups/apps/class_groupApplication.inc
index f69fe17890cbee57918e489dd177c2c62a84d5fb..069c394238443205baeffd047dab132284176c7c 100644 (file)
and fetch all applications from those departments.
*/
foreach($app_deps as $dep){
- if(preg_match("/^".normalizePreg($release_info['suffix'])."/",$dep)){
+ if(preg_match("/^".preg_quote($release_info['suffix'])."/",$dep)){
$ret = array_merge($ret,get_list("(objectClass=gosaApplication)","application",$dep,array("*"),GL_NONE));
}
}
$all = $this->_get_all_entries();
$found = FALSE;
foreach($all as $entry){
- if(isset($entry['DN']) && preg_match("/^".normalizePreg($bb)."/",$entry['DN'])){
+ if(isset($entry['DN']) && preg_match("/^".preg_quote($bb)."/",$entry['DN'])){
$found =TRUE;
break;
}
*/
$cur = &$this->a_Structure[0]['ENTRIES'];
$parent_id = $base['UNIQID'];
- $sub_dn = preg_replace("/,".normalizePreg($this->dn)."$/","",$attrs['dn']);
+ $sub_dn = preg_replace("/,".preg_quote($this->dn)."$/","",$attrs['dn']);
$sub_dn_array = split("\,",$sub_dn);
/* Walk through our menu structure array while we have found
$res = get_list("(objectClass=gosaDepartment)", "application", $this->curbase,array("description","cn","ou"),GL_SIZELIMIT);
foreach($res as $value){
$fdn = $value['dn'];
- $fdn = preg_replace("/".normalizePreg($this->curbase)."/","",$fdn);
+ $fdn = preg_replace("/".preg_quote($this->curbase)."/","",$fdn);
$fdn= @LDAP::fix($fdn);
if($value["description"][0]!=".."){
$departments[$value['dn']]= convert_department_dn($fdn)." - [".$value["description"][0]."]";
if(in_array($app['cn'][0],$used_apps)){
continue;
}
- if(!preg_match("/".get_ou('applicationRDN').normalizePreg($this->curbase)."$/",$app['dn'])){
+ if(!preg_match("/".get_ou('applicationRDN').preg_quote($this->curbase)."$/",$app['dn'])){
continue;
}
diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeGeneric.inc
index b097b88b87aed860073144574e3b7f8a6c797359..97b28e77949865b12206b45b6ab3c17fc0586749 100644 (file)
$this->base= dn2base($ui->dn);
}
} else {
- $this->base= preg_replace ("/^.*,".normalizePreg(get_ou("mimetypeRDN"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^.*,".preg_quote(get_ou("mimetypeRDN"))."/", "", $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 219e17d06445d8fbb74fa370dd62f46d59d52aa3..ac4b762922a55cf42c7b0008cf84be0f80569e72 100644 (file)
if(!$this->IsReleaseManagementActivated()){
$use_base = $this->mime_base;
if($SubSearch){
- $use_base = preg_replace("/^".normalizePreg(get_ou("mimeou"))."/","",$use_base);
+ $use_base = preg_replace("/^".preg_quote(get_ou("mimeou"))."/","",$use_base);
}
}else{
$use_base = $this->mime_release;
if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
/* Get dialog */
- $this->CopyPasteHandler->SetVar("base",preg_replace("/^".normalizePreg(get_ou("mimetypeRDN"))."/","",$this->mime_base));
+ $this->CopyPasteHandler->SetVar("base",preg_replace("/^".preg_quote(get_ou("mimetypeRDN"))."/","",$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 4041548a16441a7066f1e330db44d2b8d17f9c72..d6e2626e8da797dbb677077d4695faf9e2dd31ef 100644 (file)
/* 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("/".normalizePreg(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
}
if(preg_match("/Workstation/i",$this->BelongsTo) || preg_match("/WorkstationTemplate/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
}
$this->orig_dn = $this->dn;
} else {
/* Set base and check if the extracted base exists */
- if(preg_match("/".normalizePreg(get_ou('systemIncomingRDN'))."/",$this->dn)){
- $this->base= preg_replace("/".normalizePreg(get_ou('systemIncomingRDN'))."/","",dn2base($this->dn));
+ if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'))."/",$this->dn)){
+ $this->base= preg_replace("/".preg_quote(get_ou('systemIncomingRDN'))."/","",dn2base($this->dn));
}else{
- $this->base= preg_replace("/".normalizePreg(get_ou('printerRDN'))."/","",dn2base($this->dn));
+ $this->base= preg_replace("/".preg_quote(get_ou('printerRDN'))."/","",dn2base($this->dn));
}
if(!isset($this->config->idepartments[$this->base])){
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
if(preg_match("/terminal/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
}
if(preg_match("/workstation/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
}
/* Detect if this is a valid printer account;
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
if(preg_match("/terminal/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN')).",/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN')).",/",get_ou('printerRDN'),$this->dn);
}
if(preg_match("/workstation/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
}
/* Check if this dn points to a printer, to avoid deleting something else */
/* Update dn, to ensure storing as printer instead of WS / terminal
*/
if(preg_match("/terminal/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('terminalRDN'))."/",get_ou('printerRDN'),$this->dn);
}
if(preg_match("/workstation/i",$this->BelongsTo)){
- $this->dn= preg_replace("/".normalizePreg(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
+ $this->dn= preg_replace("/".preg_quote(get_ou('workstationRDN'))."/",get_ou('printerRDN'),$this->dn);
}
if(!$this->is_account) return;
}
/* Ensure to create a new object */
- if(preg_match("/".normalizePreg(get_ou('systemIncomingRDN'))."/",$this->orig_dn)){
+ if(preg_match("/".preg_quote(get_ou('systemIncomingRDN'))."/",$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 350195bb9806b86e732807271f440c1e153903e1..d18612059dd397b881f15b333ba479f700e54624 100644 (file)
$ui= get_userinfo();
$this->base= dn2base($ui->dn);
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("terminalRDN"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("terminalRDN"))."/", "", $this->dn);
}
/* Create an array of all Syslog servers */
}
if ($ldap->count() != 0){
while ($attrs= $ldap->fetch()){
- if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".normalizePreg(get_ou('systemIncomingRDN'))."/", $ldap->getDN())){
+ if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou('systemIncomingRDN'))."/", $ldap->getDN())){
continue;
} else {
if ($attrs['dn'] != $this->orig_dn){
diff --git a/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc b/gosa-plugins/goto/admin/systems/goto/class_terminalService.inc
index 9236b8bec04a472fd7856ba5dc1dac599b68991f..f156bc07507582fe557c873c3b3ed06a30080084 100644 (file)
*/
$p = $this->parent->by_object['ogroup'];
foreach($p->memberList as $dn => $obj){
- if(preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$dn)) continue;
+ if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$dn)) continue;
if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
$macs[] = $p->objcache[$dn]['macAddress'];
}
/* We are a workstation. Add current mac.
*/
$mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
- if(!empty($mac) && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+ if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
$macs[] = $mac;
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc
index 083f981c50c0a1555314fdd3338d73c2cbbd0425..4ec0149260391411df36c9f32f8d1f7a702c2958 100644 (file)
$ui= get_userinfo();
$this->base= dn2base($ui->dn);
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("workstationRDN"))."/i", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workstationRDN"))."/i", "", $this->dn);
}
/* Create an array of all Syslog servers */
}else{
/* Warn the user, that this host is currently installing */
if($this->currently_installing && !$this->currently_installing_warned &&
- !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+ !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
/* Force aborting without message dialog */
$message[] = "";
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationService.inc
index 1aae67b27c6a00f7cc8951f782b65ac444fdfb4f..f3a7f17a15c52d155e5c3503335b8042cf880631 100644 (file)
*/
$p = $this->parent->by_object['ogroup'];
foreach($p->memberList as $dn => $obj){
- if(preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$dn)) continue;
+ if(preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$dn)) continue;
if(isset($p->objcache[$dn]['macAddress']) && !empty($p->objcache[$dn]['macAddress'])){
$macs[] = $p->objcache[$dn]['macAddress'];
}
/* We are a workstation. Add current mac.
*/
$mac = $this->parent->by_object['workgeneric']->netConfigDNS->macAddress;
- if(!empty($mac) && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+ if(!empty($mac) && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
$macs[] = $mac;
}
}
diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc
index 7f910757eb38ec95f608e970cadcb4938d783e69..3b623259d1316bf5cac5209fa0edf2758f3605cf 100644 (file)
*/
function dn_to_release_name($dn)
{
- $relevant = preg_replace("/,".normalizePreg(get_ou("faiBaseRDN")).".*$/","",$dn);
+ $relevant = preg_replace("/,".preg_quote(get_ou("faiBaseRDN")).".*$/","",$dn);
$parts = array_reverse(split("\,",$relevant));
$str ="";
foreach($parts as $part){
diff --git a/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc b/gosa-plugins/goto/admin/systems/services/ldap/class_goLdapServer.inc
index 3a86186ce3207ef32ded0cddfbb27b984bb7aae1..f2dc8669c91085d73b75e1aa1581398643aa4016 100644 (file)
while($attrs = $ldap->fetch()){
$ldapServer = array();
for($i = 0 ; $i < $attrs['gotoLdapServer']['count'] ; $i ++ ){
- $ldapServer[] = preg_replace("/".normalizePreg($this->oldBase)."/",$this->goLdapBase,$attrs['gotoLdapServer'][$i]);
+ $ldapServer[] = preg_replace("/".preg_quote($this->oldBase)."/",$this->goLdapBase,$attrs['gotoLdapServer'][$i]);
}
$new[$attrs['dn']]['gotoLdapServer'] = $ldapServer;
}
diff --git a/gosa-plugins/log/addons/logview/class_gosa_logview.inc b/gosa-plugins/log/addons/logview/class_gosa_logview.inc
index 958c2ae7d235307c52b77407d0621729cea68d3a..42b8781c2300526bd202231c132b03dbd7a80b83 100644 (file)
if(isset($this->uid_map[$line['user']])){
$user = $this->uid_map[$line['user']];
}else{
- $user = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['user']);
+ $user = preg_replace("/,".preg_quote($this->config->current['BASE'])."/",$base,$line['user']);
}
- $object = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['object']);
+ $object = preg_replace("/,".preg_quote($this->config->current['BASE'])."/",$base,$line['object']);
$res.=" <tr style=\"$col\">\n";
$res.=" <td title='".$line['objecttype']."'>".$line['action']."</td>";
diff --git a/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_mailqueue.inc
index 3a83d5040fdc449c0dd20688bc73460ecf139c6d..d9159bafb9a171e0afad7630c698fc904602d851 100644 (file)
foreach($hosts as $mac){
$found = FALSE;
foreach($res as $entry){
- if(preg_match("/^".normalizePreg($mac)."$/i",$entry['macAddress'][0])){
+ if(preg_match("/^".preg_quote($mac)."$/i",$entry['macAddress'][0])){
$ret[$mac] = $entry['cn'][0];
$found = TRUE;
break;
diff --git a/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc b/gosa-plugins/mail/addons/mailqueue/class_si_mailqueue.inc
index 9992d9f2fcc7a9744def6f0420c3d6fde6cbf874..553150cd8e652ee2839c33a7c529dffdc2edd817 100644 (file)
/* Prepare search filter
*/
- $search_str = preg_replace("/\\\\\*/",".*",normalizePreg($search_str));
+ $search_str = preg_replace("/\\\\\*/",".*",preg_quote($search_str));
/* Query mailqueue
*/
diff --git a/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc b/gosa-plugins/mail/personal/mail/class_mail-methods-cyrus.inc
index 147661bf8235683855725f8ba83a36e077583b50..5553dfd666082b3d1cbb9992d865d71b22b9de8b 100644 (file)
/* Cut domain name */
$val = preg_replace("/@.*$/","",$val);
- $result[]=preg_replace ("/^.*".normalizePreg($folder)."/","INBOX", mb_convert_encoding($val, "UTF-8", "UTF7-IMAP"));
+ $result[]=preg_replace ("/^.*".preg_quote($folder)."/","INBOX", mb_convert_encoding($val, "UTF-8", "UTF7-IMAP"));
}
}
diff --git a/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc b/gosa-plugins/mit-krb5/admin/systems/services/kerberos/class_krb_host_keys.inc
index 05c18449a5472ca794ccd731958e9259da3c1898..970f2c7f3295cd58617cf81538e854fd7d34c2f6 100644 (file)
*/
foreach($this->server_list as $server => $data){
foreach($data['PRINCIPALS'] as $p_name){
- if(preg_match("/\/".normalizePreg($this->namingAttr)."\@/",$p_name)){
+ if(preg_match("/\/".preg_quote($this->namingAttr)."\@/",$p_name)){
$pre = preg_replace("/\/.*$/","/",$p_name);
$this->delete_key($server, $pre.$this->namingAttr."@".$data['REALM']);
$this->create_key($server, $pre.$this->object->cn."@".$data['REALM']);
/* Collect all principals for the current host.
*/
- if(preg_match("/\/".normalizePreg($this->namingAttr)."\@/",$p_name)){
+ if(preg_match("/\/".preg_quote($this->namingAttr)."\@/",$p_name)){
$pre = preg_replace("/\/.*$/","/",$p_name);
$found[] = "<b>".$pre.$this->namingAttr."@".$data['REALM']."</b> ".
_("updated to").
$master_princ = $prefix.$this->namingAttr."@".$realm;
foreach($server['PRINCIPALS'] as $id => $princ){
- if(preg_match("/^".normalizePreg($master_princ)."$/i",$princ)){
+ if(preg_match("/^".preg_quote($master_princ)."$/i",$princ)){
$found = TRUE;
break;
}
*/
if(!$service_plugin){
foreach($server['PRINCIPALS'] as $id => $princ){
- if(preg_match("/".normalizePreg("/".$this->namingAttr."@")."/i",$princ) &&
- !preg_match("/^".normalizePreg($prefix)."/",$princ)){
+ if(preg_match("/".preg_quote("/".$this->namingAttr."@")."/i",$princ) &&
+ !preg_match("/^".preg_quote($prefix)."/",$princ)){
/* Display buttons to "create" or to "remove/recreate" wheteher the prefix esists or not
*/
/* Detect all principals for the current host.
*/
- if(preg_match("/".normalizePreg($prefix.$this->namingAttr)."\@/",$p_name)){
+ if(preg_match("/".preg_quote($prefix.$this->namingAttr)."\@/",$p_name)){
$this->delete_key($server, $p_name);
}
}
diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc
index 89c2527a1caf47a4d5998a7cdda5394b067f6226..7791cb4e0a42f4e9e85f3f3cef111600928419dc 100644 (file)
if($this->dn === "new" || $this->dn === NULL) {
$base = session::get('CurrentMainBase');
} else {
- $base = preg_replace("/^[^,]+,".normalizePreg(get_people_ou())."/","",$this->dn);
+ $base = preg_replace("/^[^,]+,".preg_quote(get_people_ou())."/","",$this->dn);
}
$ldap->cd($base);
diff --git a/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc b/gosa-plugins/opsi/admin/opsi/class_opsigeneric.inc
index 4737d6afc2d82e2e12142f6948e9d997b5bae0ce..1cc1186f9f58076c72953f3ab4aad58e94964bdf 100644 (file)
#FIXME Implement an opsi method which returns infos for only one opsi client, not all.
*/
foreach($list as $entry){
- if(preg_match("/^".normalizePreg($this->hostId)."$/i",$entry['NAME'][0]['VALUE'])){
+ if(preg_match("/^".preg_quote($this->hostId)."$/i",$entry['NAME'][0]['VALUE'])){
$this->initially_was_account = TRUE;
$this->is_account = TRUE;
foreach(array(
diff --git a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc
index 63e20f21b88e08c301ac994e20d07ccb1872b170..1cac6ba02cda3267c982e5e7bfeb60e37b393a19 100644 (file)
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_winstations_ou())."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_winstations_ou())."/", "", $this->dn);
}
$this->cn= preg_replace("/\\\$\$/","",$this->cn);
diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc
index 743da7e2c9908e35e5b7772a4f60d056b1065955..72a770afbea776a5d971c0f7e76ed6748c72ba3c 100644 (file)
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("componentRDN"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"))."/", "", $this->dn);
}
$this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
/* Save dn for later references */
if(preg_match("/cn=dhcp,/",$attrs['dn'])){
continue;
}
- if ($attrs['dn'] != $this->orig_dn && preg_match("/".normalizePreg(get_ou("componentRDN"))."/",$attrs['dn'])){
+ if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"))."/",$attrs['dn'])){
$message[]= msgPool::duplicated(_("Component name"));
break;
}
diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc
index 664f024c7c5d6192b24db4d2a5567642b6f1929e..44b1cc4a8579e14ac8eca178d43d23df3549442b 100644 (file)
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("serverRDN"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("serverRDN"))."/", "", $this->dn);
}
$this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses);
$this->netConfigDNS->set_acl_category("server");
}
/* Warn the user, that this host is currently installing */
- if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->orig_dn)){
+ if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$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 f2c37eecf1fb58dad694940c67fa852bea23cce4..07cea7c68d115b9770931d5fb45c2312c7314a5c 100644 (file)
$dialog = FALSE;
$hide_apply = $this->dn == "new";
- $hide_apply = ($this->dn == "new") || (preg_match("/".normalizePreg(get_ou("systemIncomingRDN"))."/",$this->dn));
+ $hide_apply = ($this->dn == "new") || (preg_match("/".preg_quote(get_ou("systemIncomingRDN"))."/",$this->dn));
if(is_object($this->systab) && !isset($this->systab->by_object)){
$dialog = TRUE;
$hide_apply = TRUE;
diff --git a/gosa-plugins/systems/admin/systems/class_termDNS.inc b/gosa-plugins/systems/admin/systems/class_termDNS.inc
index 58d9a23a2d59eb13417237478e2f3fb96a574d1f..059e4f9614878df1c3be98e1c1fb0a5490b17105 100644 (file)
function get_dhcp_parent_node()
{
- return(preg_replace("/^cn=".normalizePreg($this->cn).",/","",$this->get_dhcp_host_entry_dn()));
+ return(preg_replace("/^cn=".preg_quote($this->cn).",/","",$this->get_dhcp_host_entry_dn()));
}
$tmp = array_flip($this->Zones);
$tmp = preg_replace("/^[^\/]*+\//","",$tmp[$this->dnsEntry['zoneName']]);
$tmp = trim(preg_replace("/\.in-addr.arpa$/","",$tmp));
- $ptr = preg_replace("/^".normalizePreg(DNS::FlipIp($tmp))."\./","",$this->ipHostNumber);
+ $ptr = preg_replace("/^".preg_quote(DNS::FlipIp($tmp))."\./","",$this->ipHostNumber);
return($ptr);
}else{
return(FALSE);
$ret = array();
foreach($arr as $r => $name){
$base_part = str_replace($base,"",$r);
- if(preg_match("/^[a-z]*=".normalizePreg($name)."(|,)$/i",$base_part)){
+ if(preg_match("/^[a-z]*=".preg_quote($name)."(|,)$/i",$base_part)){
$ret[$r] = $current.$name;
$tmp = $this->create_tree($arr,$r,$current.". ");
foreach($tmp as $sub_key => $sub_name){