Code

Only convert samba user (not machines).
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Nov 2006 10:18:55 +0000 (10:18 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Nov 2006 10:18:55 +0000 (10:18 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5245 594d385d-05f5-0310-b6e9-bd551577e9d8

contrib/fix_munged.php

index 754a03666c72c156107603051e48a0607a18f100..405d345afb295f9ee20eda8b90d27075ba0921c8 100755 (executable)
@@ -43,7 +43,7 @@ $ldap_password= "tester";
 
 /* Internal Settings */
 $ldap_protocol= "3";
-$filter= "(objectClass=sambaSamAccount)";
+$filter= "(&(objectClass=sambaSamAccount)(sambaMungedDial=*))";
 $attributes= array("dn","sambaMungedDial");
 
 print("This script will try to convert all ldap entries that have the sambaMungedDial-Attribute set, into the new \n".
@@ -83,11 +83,11 @@ for($i=0; $i<$count; $i++) {
        $mungedDial = new sambaMungedDial();
        $mungedDial->load($entry['sambamungeddial'][0]);
        $modify['sambaMungedDial'][0]= $mungedDial->getMunged();
-       #if(ldap_modify($connection,$entry['dn'],$modify)) {
-       #       print("done.\n");
-       #} else {
-       #       print("failed.\n");
-       #}
+       if(ldap_modify($connection,$entry['dn'],$modify)) {
+               print("done.\n");
+       } else {
+               print("failed.\n");
+       }
 }
 
 ldap_close($connection);