From: hickert Date: Tue, 11 May 2010 05:29:38 +0000 (+0000) Subject: Updated get_ou it receives values from the config registry now. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5f3f684e841c943ae6e7754dd875efb4fbdbab26;p=gosa.git Updated get_ou it receives values from the config registry now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18301 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index b6ef2a612..6bb494aec 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -166,8 +166,8 @@ class FAI { global $config; - if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",$dn)){ - $base = get_ou('faiBaseRDN').$dn; + if(!preg_match("/".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/')."/i",$dn)){ + $base = get_ou("faiManagement", "faiBaseRDN").$dn; }else{ $base = $dn; } @@ -178,7 +178,7 @@ class FAI $ldap->search("(objectClass=FAIbranch)",array("ou","dn")); while($attrs = $ldap->fetch()){ if($appendedName){ - $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/i","",$attrs['dn'])); + $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/').".*$/i","",$attrs['dn'])); }else{ $res[$attrs['dn']] = $attrs['ou'][0]; } @@ -222,7 +222,7 @@ class FAI /* Dont't try to modify non FAIclasses */ - if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/i",$obj_dn)){ + if(!preg_match("/[^,]+,".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/')."/i",$obj_dn)){ trigger_error("PLEASE check fai class handling in ".__LINE__." -> ".__FILE__); echo "
-->".$Current_DN."
"; echo "
-->".$obj_dn."
"; @@ -923,8 +923,8 @@ class FAI $ldap->search("(objectClass=FAIbranch)",array("ou","FAIstate")); while($attrs = $ldap->fetch()){ foreach($sub_releases as $sub_rel){ - if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/i",$attrs['dn'])){ - $f_releases[$sub_rel.get_ou('faiBaseRDN')] = $attrs; + if(preg_match("/^".preg_quote($sub_rel.get_ou("faiManagement", "faiBaseRDN"), '/')."/i",$attrs['dn'])){ + $f_releases[$sub_rel.get_ou("faiManagement", "faiBaseRDN")] = $attrs; } } } @@ -945,8 +945,8 @@ class FAI foreach($sub_releases as $name => $sub_rel){ $FAIstate = ""; - if(isset($f_releases[$sub_rel.get_ou('faiBaseRDN')]) && isset($f_releases[$sub_rel.get_ou('faiBaseRDN')]['FAIstate'])){ - $FAIstate = $f_releases[$sub_rel.get_ou('faiBaseRDN')]['FAIstate'][0]; + if(isset($f_releases[$sub_rel.get_ou("faiManagement", "faiBaseRDN")]) && isset($f_releases[$sub_rel.get_ou("faiManagement", "faiBaseRDN")]['FAIstate'])){ + $FAIstate = $f_releases[$sub_rel.get_ou("faiManagement", "faiBaseRDN")]['FAIstate'][0]; } foreach($groups as $dn => $data){ diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc index d0e151712..62694d825 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -381,7 +381,7 @@ class faiHook extends plugin */ if($this->is_new){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiHook", "faiHookRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiHook", "faiHookRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAIhook",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 9041bb00d..6574bb3f8 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -61,7 +61,7 @@ class faiManagement extends management $this->opsi = new opsi($this->config);; } - $this->fai_base = get_ou("faiBaseRDN").$this->config->current['BASE']; + $this->fai_base = get_ou("faiManagement", "faiBaseRDN").$this->config->current['BASE']; $cfg_rel = $this->config->get_cfg_value("faiManagement","defaultFaiRelease"); if(!empty($cfg_rel)){ @@ -602,9 +602,9 @@ class faiManagement extends management $ldap->cd($bb); $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/i', ','.get_ou("application", "applicationRDN"), $bb)); + $ldap->cd(preg_replace('/,'.preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/').'/i', ','.get_ou("application", "applicationRDN"), $bb)); $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/i', ','.get_ou("mimetype", "mimetypeRDN"), $bb)); + $ldap->cd(preg_replace('/,'.preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/').'/i', ','.get_ou("mimetype", "mimetypeRDN"), $bb)); $ldap->recursive_remove(); /* Search for all groups with configured application menus. @@ -612,7 +612,7 @@ class faiManagement extends management - The search für menu configuration for the specified release and collect all those dns. - Remove entries */ - $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN"), '/').".*$/i","",$bb); + $release_ou = preg_replace("/".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/').".*$/i","",$bb); $ldap->cd($this->config->current['BASE']); $ldap->search("(objectClass=posixGroup)",array("dn")); @@ -761,11 +761,11 @@ class faiManagement extends management $targetReleaseDN = "ou=".$name.",".$baseToUse; - $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou("application", "applicationRDN"),$baseToUse); - $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou("application", "applicationRDN"),"ou=".$name.",".$baseToUse) ; + $appsrc = preg_replace("/".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/')."/i",get_ou("application", "applicationRDN"),$baseToUse); + $appdst = preg_replace("/".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/')."/i",get_ou("application", "applicationRDN"),"ou=".$name.",".$baseToUse) ; - $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou("mimetype", "mimetypeRDN"),$baseToUse); - $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou("mimetype", "mimetypeRDN"),"ou=".$name.",".$baseToUse) ; + $mimesrc = preg_replace("/".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/')."/i",get_ou("mimetype", "mimetypeRDN"),$baseToUse); + $mimedst = preg_replace("/".preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/')."/i",get_ou("mimetype", "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 28631c25f..933cbe0c9 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -185,7 +185,7 @@ class faiPackage extends plugin /* Assemble release name */ $release = $this->parent->parent->fai_release; - $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/i', '', $release); + $tmp= preg_replace('/[,]*'.preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/').'.*$/i', '', $release); $tmp= preg_replace('/ou=/', '', $tmp); $rev= array_reverse(explode(',', $tmp)); $this->FAIdebianRelease= "/"; @@ -544,7 +544,7 @@ class faiPackage extends plugin */ if($this->is_new){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiPackage", "faiPackageRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiPackage", "faiPackageRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAIpackageList",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); @@ -589,7 +589,7 @@ class faiPackage extends plugin if($this->FAIdebianRelease == "ClearFromCopyPaste"){ $current_release = $this->parent->parent->fai_release; - $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/i', '', $current_release); + $tmp= preg_replace('/,'.preg_quote(get_ou("faiManagement", "faiBaseRDN"), '/').'.*$/i', '', $current_release); $tmp= preg_replace('/ou=/', '', $tmp); $rev= array_reverse(explode(',', $tmp)); $this->FAIdebianRelease= ""; diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc index 6f3630e6e..342b65160 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc @@ -481,7 +481,7 @@ class faiPartitionTable extends plugin */ if($this->is_new){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiPartitionTable", "faiPartitionRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiPartitionTable", "faiPartitionRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAIpartitionTable",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc index 80908909f..98940c170 100644 --- a/gosa-plugins/fai/admin/fai/class_faiProfile.inc +++ b/gosa-plugins/fai/admin/fai/class_faiProfile.inc @@ -284,7 +284,7 @@ class faiProfile extends plugin */ if($this->dn == "new" || $this->cn != $this->old_cn){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiProfile", "faiProfileRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiProfile", "faiProfileRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAIprofile",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 8575e6f8f..1c9f03edf 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -386,7 +386,7 @@ class faiScript extends plugin */ if($this->is_new){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiScript", "faiScriptRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiScript", "faiScriptRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAIscript",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index b370dd6c9..635e5b826 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -404,7 +404,7 @@ class faiTemplate extends plugin */ if($this->is_new){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiTemplate", "faiTemplateRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiTemplate", "faiTemplateRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAItemplate",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc index 9de8ee312..8d35ca731 100644 --- a/gosa-plugins/fai/admin/fai/class_faiVariable.inc +++ b/gosa-plugins/fai/admin/fai/class_faiVariable.inc @@ -290,7 +290,7 @@ class faiVariable extends plugin */ if($this->is_new){ $release = $this->parent->parent->fai_release; - $new_dn= 'cn='.$this->cn.",".get_ou("faiVariable", "faiVariableRDN").get_ou('faiBaseRDN').$release; + $new_dn= 'cn='.$this->cn.",".get_ou("faiVariable", "faiVariableRDN").get_ou("faiManagement", "faiBaseRDN").$release; $res = faiManagement::check_class_name("FAIvariable",$this->cn,$new_dn); if(isset($res[$this->cn])){ $message[] = msgPool::duplicated(_("Name")); diff --git a/gosa-plugins/fai/admin/fai/class_filterFAI.inc b/gosa-plugins/fai/admin/fai/class_filterFAI.inc index 86f2e989b..5f1065ce3 100644 --- a/gosa-plugins/fai/admin/fai/class_filterFAI.inc +++ b/gosa-plugins/fai/admin/fai/class_filterFAI.inc @@ -55,7 +55,7 @@ class filterFAI extends filterLDAP{ /* Clean up object informations */ $obj = array(); $obj['cn'] = $object['cn'][0]; - $obj['dn'] = $object['cn'][0].",".get_ou("faiBaseRDN").$config->current['BASE']; + $obj['dn'] = $object['cn'][0].",".get_ou("faiManagement", "faiBaseRDN").$config->current['BASE']; $obj['acl'] = $acl; $obj['class'] = $rest ['ACL']; $obj['FAIstate'] = $entry['FAIstate']; @@ -98,7 +98,7 @@ class filterFAI extends filterLDAP{ // Append opsi stuff ... - if(class_available('opsi') && $base == get_ou("faiBaseRDN").$config->current['BASE']){ + if(class_available('opsi') && $base == get_ou("faiManagement", "faiBaseRDN").$config->current['BASE']){ $opsi = new opsi($config); $objects = array(); if($opsi instanceof opsi && $opsi->enabled()){ diff --git a/gosa-plugins/fai/admin/fai/class_filterOPSIPackages.inc b/gosa-plugins/fai/admin/fai/class_filterOPSIPackages.inc index 2a52389f1..e17121634 100644 --- a/gosa-plugins/fai/admin/fai/class_filterOPSIPackages.inc +++ b/gosa-plugins/fai/admin/fai/class_filterOPSIPackages.inc @@ -11,7 +11,7 @@ class filterOPSIPackages extends filterLDAP{ $entries = array(); // Append opsi stuff ... - if(class_available('opsi') && $base == get_ou("faiBaseRDN").$config->current['BASE']){ + if(class_available('opsi') && $base == get_ou("faiManagement", "faiBaseRDN").$config->current['BASE']){ $opsi = new opsi($config); $objects = array(); if($opsi instanceof opsi && $opsi->enabled()){