summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0f6e2fe)
raw | patch | inline | side by side (parent: 0f6e2fe)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 May 2010 09:57:54 +0000 (09:57 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 14 May 2010 09:57:54 +0000 (09:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18473 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/fai/admin/fai/migration/class_migrateFaiRDN.inc | patch | blob | history | |
gosa-plugins/fai/admin/fai/migration/class_migrate_faiBaseRDN.inc | patch | blob | history |
diff --git a/gosa-plugins/fai/admin/fai/migration/class_migrateFaiRDN.inc b/gosa-plugins/fai/admin/fai/migration/class_migrateFaiRDN.inc
index be91061ffa6e6b36418c81df3781989b3514736d..b49c357f27a4643f590e406029b8515d57342067 100644 (file)
protected $suffix = "";
protected $prefix = "";
+ public $faiBaseRDN;
+
function __construct($config,$property)
{
$this->property = &$property;
$initialValue = $this->prefix.$this->property->getValue().$this->suffix;
$targetValue = $this->prefix.$this->property->getValue(TRUE).$this->suffix;
- $prefix = $this->config->get_cfg_value('faiManagement','faiBaseRDN');
+ $prefixProp = $this->config->configRegistry->getProperty('faiManagement','faiBaseRDN');
+ $prefix = $prefixProp->getValue();
+ $prefixNew = $prefixProp->getValue(TRUE);
$dnMatch = "";
if(!empty($initialValue) || !empty($prefix)){
$name = substr($dn,0, (strlen($dn) - strlen($initialValue.$releaseRDN.$prefix.$basePart)));
// Build new container name and check if it exists.
- $newContainer = $targetValue.$releaseRDN.$prefix.$basePart;
+ $newContainer = $targetValue.$releaseRDN.$prefixNew.$basePart;
if(!$ldap->dn_exists($newContainer)){
$this->found['add'][$newContainer] = array();
}
diff --git a/gosa-plugins/fai/admin/fai/migration/class_migrate_faiBaseRDN.inc b/gosa-plugins/fai/admin/fai/migration/class_migrate_faiBaseRDN.inc
index d1e748cff6e8711a90fe48b7bf43cf3ea4e74c29..86380dc89970fc9419d245358e38d2078daa19bf 100644 (file)
class migrate_faiBaseRDN extends migrateFaiRDN implements propertyMigration
{
protected $filter = "(&(objectClass=nothing)%s)";
+
+
+
+ function checkForIssues()
+ {
+
+ // Check every single property which is connected to this property.
+ $ret = array('add' => array(), 'move' => array());
+ foreach(array(
+ 'faiScript'=> 'faiScriptRDN',
+ 'faiHook'=> 'faiHookRDN',
+ 'faiTemplate'=> 'faiTemplateRDN',
+ 'faiVariable'=> 'faiVariableRDN',
+ 'faiProfile'=> 'faiProfileRDN',
+ 'faiPartitionTable'=> 'faiPartitionRDN',
+ 'faiPackage'=> 'faiPackageRDN') as $class => $name){
+
+ if($this->config->configRegistry->propertyExists($class,$name)){
+ $prop = $this->config->configRegistry->getProperty($class,$name);
+ if($prop->migrationRequired()){
+ $migrator = $prop->getMigrationClass();
+ if($migrator){
+ $tmp = $migrator->getChanges();
+ if(isset($tmp['add'])){
+ $ret['add'] = array_merge($tmp['add'],$ret['add']);
+ }
+ if(isset($tmp['move'])){
+ $ret['move'] = array_merge($tmp['move'],$ret['move']);
+ }
+ }
+ }
+ }
+ }
+ $this->found = $ret;
+ return(count($ret['add']) || count($ret['move']));
+ }
}
?>