summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e9e337)
raw | patch | inline | side by side (parent: 9e9e337)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 10:13:58 +0000 (10:13 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 10:13:58 +0000 (10:13 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6226 594d385d-05f5-0310-b6e9-bd551577e9d8
setup/class_setupStep_Migrate.inc | patch | blob | history |
index be6ff373f4c56b54e3af84c288f1266f19caeaa6..7d45651766a903c7a4d56463ab61b5bd600cda05 100644 (file)
$this->outside_winstations = array();
while($attrs = $ldap->fetch()){
- if(!preg_match("/^[^,]+,".normalizePreg($winstation_ou)."/",$attrs['dn'])){
+ if((!preg_match("/^[^,]+,".normalizePreg($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();
while($attrs = $ldap->fetch()){
- if(!preg_match("/^[^,]+,".normalizePreg($group_ou)."/",$attrs['dn'])){
+ if((!preg_match("/^[^,]+,".normalizePreg($group_ou)."/",$attrs['dn'])) && !preg_match("/,dc=addressbook,/",$attrs['dn'])){
$attrs['selected'] = FALSE;
$attrs['ldif'] = "";
$this->outside_groups[base64_encode($attrs['dn'])] = $attrs;
$this->outside_users = array();
while($attrs = $ldap->fetch()){
- if(!preg_match("/^[^,]+,".normalizePreg($people_ou)."/",$attrs['dn'])){
+ if((!preg_match("/^[^,]+,".normalizePreg($people_ou)."/",$attrs['dn']) && !preg_match("/,dc=addressbook,/",$attrs['dn']))){
$attrs['selected'] = FALSE;
$attrs['ldif'] = "";
$this->outside_users[base64_encode($attrs['dn'])] = $attrs;
return(FALSE);
}else{
- echo "REMOVE this : Autocreation of the root object will be done by create_missing_tree later. !!!!!!!";
-
- /* Try to find out which values are necessary */
- $tmp = $ldap->get_objectclasses();
- $oc = $tmp['organization'];
-
- $must_attrs = $oc['MUST'];
- if(!is_array($must_attrs)){
- $must_attrs = array($must_attrs);
- }
-
- /* Root object does not exists try to create it */
- $ldapadd["objectclass"][0]="top";
- $ldapadd["objectclass"][1]="organization";
-
- /* Try to fill all collected must attributes */
- $base_parts = preg_split("/,/",$cv['base']);
- foreach($must_attrs as $attr){
- foreach($base_parts as $part){
- if(preg_match("/^".$attr."=/",$part) && !isset($ldapadd[$attr])){
- $ldapadd[$attr]= preg_replace("/^[^=]*+=/","",$part);
- }
- }
- }
-
/* Add root object */
$ldap->cd($cv['base']);
- $res = $ldap->add($ldapadd);
-
- /* Add root object */
- $ldap->cd($cv['base']);
- # $res = $ldap->create_missing_trees($cv['base']);
+ $res = $ldap->create_missing_trees($cv['base']);
/* If adding failed, tell the user */
if(!$res){
$ldap->search("(".$winstation_ou.")",array("dn"));
if($ldap->count() == 0 ){
- $add_dn = $cv['groupou'].",".$cv['base'];
+ $add_dn = $winstation_ou.",ou=systems,".$cv['base'];
$naming_attr = preg_replace("/=.*$/","",$add_dn);
$naming_value = preg_replace("/^[^=]*+=([^,]*).*$/","\\1",$add_dn);
$add = array();