
Hi Robert,
Am Mit, 2003-09-17 um 08.44 schrieb Guenther Rasch:
Robert Kehl wrote:
Am Mit, 2003-09-17 um 07.37 schrieb Guenther Rasch:
What are the exact differences between accepted and rejected users? Could you post some (constructed) examples that would fail and that would pass?
I can not find out the differences. We´ve 430 eDirectory-Users, but in otrs i can see 10-20 users...
I can always see the same users.
Is the problem reproducable, ie. does it always happen with the same user accounts, or is it randomly changing?
What you could do to see if it's a problem with the structure of your LDAP tree is as follows:
I don´t think there´s a structure problem. Another application using the same perl-ldap-modules is working very well: #! /usr/bin/perl # NDS-LDAP-Reader und Konvertierprogramm für mysql use Net::LDAP qw(:all); use Net::LDAP::Schema qw(all); @wsattrs = ( ["wMNAMEDNS","Workstation","PCName",1], ["zENINVComputerModel","Workstation","ComputerModell",0], ["zENINVSerialNumber","Workstation","Seriennummer",0], ["zENINVMemorySize","Workstation","RAM",0], ["zENINVDiskInfo","Workstation","Festplatten",0], ["wMNAMEOS","Workstation","OSVersion",0], ["zENINVBIOSType","Workstation","BiosVersion",0], ["zENINVNovellClientVersion","Workstation","NovellClient",0], ["zENINVIPAddress","Workstation","IPAdresse",0], ["zenwmMACAddress","Workstation","MACAdresse",0], ["wMUserHistory","Userhistorie","UserHistorie",0], ["wMNAMEUser","Workstation","User",0], ["wMLastRegisteredTime","Workstation","LetzteAnmeldung",0] ); @userattrs = ( ["cn","User","Loginname",1], ["fullName","User","VollstaendigerName",0], ["zenwmLoggedInWorkstation","Loggedinworkstations","Loggedinworkstation",0], ["mail","User","Mailadresse",0], ["loginDisabled","User","Userdeaktiviert",0], ["loginExpirationTime","User","begrenzteAnmeldungen",0], ["appAssociations","Anwendungen","Anwendungen",0], ["loginTime","User","LoginTime",0], ["groupMembership","Gruppenmitgliedschaften","Gruppenmitgliedschaften",0] ); sub ReadLDAP { ($base,$object,@sicherattrs) = @_; if ($object eq "Workstation") {print "# Workstations : $object\n";} if ($object eq "User") {print "# User : $object";} @attrs = @sicherattrs; if ($ldap = Net::LDAP->new('172.24.4.210')) {} else { $ldap = Net::LDAP->new('172.24.4.205') or die "Konnektierung failed!\n"; } $r=$ldap->bind("cn=ldap,o=kli_pa",password=>"<password>"); $mesg = $ldap->search( base => "$base", scope => 'subtree', filter => "objectclass=$object" # filter => "cn=*" ); my $max = $mesg->count; print "\n# Anzahl Suchergebnisse: $max\n"; for( my $index = 0 ; $index < $max ; $index++) { undef %datensatz; $count=0; my $entry = $mesg->entry($index); my $dn = $entry->dn; # Obtain DN of this entry print "# Objektname : $dn\n"; while ($arref = shift(@attrs)) { ($var,$table,$mysqlattr,$key) = (@$arref); $attr = $entry->get_value( $var, asref => 1 ); if ( defined($attr) ) { foreach my $value ( @$attr ) { $value =~ s/ä/ä/g; $value =~ s/ü/ü/g; $value =~ s/ö/ö/g; if ($key) { $keyname = $mysqlattr; $keyvalue = $value; $normaltable = $table; } if ($table ne $normaltable) { print FH "INSERT into $table ($keyname,$mysqlattr) VALUES(\"$keyvalue\",\"$value\");\n"; } else { $datensatz{"$mysqlattr"}=$value; $count++; } } } } $datensatz{"dn"}=$dn; @attrs = @sicherattrs; $count2=0; while(($mykey,$myval)=each(%datensatz)) { if ($count2==0) { $mykeys = "$mykey"; $myvals = "\"$myval\""; } else { $mykeys .=",$mykey"; $myvals .=",\"$myval\""; } $count2++; } print FH "INSERT into $object ($mykeys) VALUES ($myvals);\n"; } } open FH,">/etc/cronjobs/transferfile"; print FH "DELETE from User;\n"; print FH "DELETE from Workstation;\n"; print FH "DELETE from Userhistorie;\n"; print FH "DELETE from Anwendungen;\n"; print FH "DELETE from Gruppenmitgliedschaften;\n"; print FH "DELETE from Loggedinworkstations;\n"; #ReadLDAP("ou=WORKSTATION,ou=Informatik,o=kli_pa","Workstation",@wsattrs); ReadLDAP("o=kli_pa","Workstation",@wsattrs); ReadLDAP("o=kli_pa","User",@userattrs); #ReadLDAP("ou=WORKSTATION,ou=Chir,o=kli_pa","Workstation",@wsattrs); #ReadLDAP("ou=Informatik,o=kli_pa","User",@userattrs); close (FH); `/usr/bin/mysql -h testweb -u root -p"<password>" inventory < /etc/cronjobs/transferfile`;