/[ldap.old]/ldif2dot2
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /ldif2dot2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Fri May 26 11:18:24 2000 UTC (19 years, 1 month ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
show structure, uses Net::LDAP

1 #!/usr/local/bin/perl -w
2
3 use Net::LDAP::LDIF;
4
5 die "Usage: $0 [ldif]" if (!defined($ARGV[0]));
6
7 $ldif = Net::LDAP::LDIF->new( "$ARGV[0]", "r" );
8
9 print "digraph ldif {\n";
10
11 while( $entry = $ldif->read() ) {
12 foreach my $attr ($entry->attributes) {
13 print STDERR join("\n\t",$attr, $entry->get($attr)),"\n";
14 }
15 print STDERR "--------------\n";
16 @dn=$entry->get('objectclass');
17 undef $lval; # last value
18 foreach $val (@dn) {
19 next if (val =~ m,^ns,);
20 if (!defined($exist{$val})) {
21 $exist{$val}++;
22 }
23 if ($lval && $conn{lc($val)} ne lc($lval)) {
24 print "\"$val\" -> \"$lval\";\n";
25 $conn{lc($val)}=lc($lval);
26 }
27 $lval = $val;
28 }
29 }
30
31 print "}\n";
32
33 $ldif->done();

  ViewVC Help
Powered by ViewVC 1.1.26