summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2254db6)
raw | patch | inline | side by side (parent: 2254db6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 12 May 2010 15:18:40 +0000 (15:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 12 May 2010 15:18:40 +0000 (15:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18396 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_migrate_userRDN.inc | patch | blob | history |
diff --git a/gosa-core/include/class_migrate_userRDN.inc b/gosa-core/include/class_migrate_userRDN.inc
index 51e9694d598d03bd7a7b11caa23de6342f2a88f3..7dc90db6fda97b4982fdbc078651cd08cd237c43 100644 (file)
$targetValue = $this->property->getValue(TRUE);
$dnMatch = "";
if(!empty($initialValue)){
-
foreach(preg_split("/,/", $initialValue) as $rdnPart){
if(empty($rdnPart)) continue;
list($namingAttrs, $container) = preg_split("/=/",$rdnPart,2);
$this->found['add'][$targetValue.$container] = array();
}
if($dn != $dnTo){
- $this->found['move'][$dn] = $dnTo;
+ $this->found['move'][] = array('from' => $dn, 'to' => $dnTo);
$found = TRUE;
}
}
$this->found['add'][$targetValue.$container] = array();
}
if($dn != $dnTo){
- $this->found['move'][$dn] = $dnTo;
+ $this->found['move'][] = array('from' => $dn, 'to' => $dnTo);
$found = TRUE;
}
}
if(count($this->found['move'])) {
$str.= "<br><h3>"._("Objects that will be moved")."</h3>";
$str.="<pre>";
- foreach($this->found['move'] as $dn => $dnTo){
- $str.= sprintf(_("Moving object '%s' to '%s'"), $dn, $dnTo)."<br>";
+ foreach($this->found['move'] as $id => $data){
+ $checked = (!isset($_POST['migrateNow'])) ? 'checked':'';
+ $str.= "<input $checked type='checkbox' value='1' name='migrateEntry_{$id}'>";
+ $str.= sprintf(_("Moving object '%s' to '%s'"), $data['from'], $data['to'])."<br>";
}
$str.="</pre>";
}
}
// Now move the objects to the new traget
- foreach($this->found['move'] as $from => $to){
- $ldap->rename_dn($from, $to);
+ foreach($this->found['move'] as $id => $data){
+ if(isset($_POST["migrateEntry_{$id}"])){
+ $ldap->rename_dn($data['from'], $data['to']);
+ }
}
$this->checkForIssues();
}