#!/usr/local/bin/perl # Show the LDAP server's data tree require './ldap-client-lib.pl'; &ui_print_header(undef, $text{'browser_title'}, "", "browser"); &ReadParse(); # Connect to LDAP server, or die trying $ldap = &ldap_connect(1); if (!ref($ldap)) { print &text('browser_econn', $ldap),"
\n"; &ui_print_footer("", $text{'index_return'}); exit; } # Work out the base (current navigation level) if ($in{'goparent'}) { $base = $in{'parent'}; } elsif (!$in{'base'}) { $conf = &get_config(); $base = &find_value("base", $conf); } else { $base = $in{'base'}; } # Show current base (with option to change), and parent button print &ui_form_start("browser.cgi"),"\n"; print "$text{'browser_base'}\n"; print &ui_textbox("base", $base, 60)," ",&ui_submit($text{'browser_ok'}),"\n"; $parent = $base; $parent =~ s/^[^,]+,\s*//; if ($parent =~ /\S/) { print &ui_hidden("parent", $parent),"\n"; print " \n"; print &ui_submit($text{'browser_parent'}, "goparent"),"\n"; } print &ui_form_end(); # Show list of objects under the base, and its attributes $rv = $ldap->search(base => $base, filter => '(objectClass=*)', scope => 'one'); if ($rv->code) { # Search failed print &text('browser_esearch', $rv->error),"
\n"; } else { print "
$text{'browser_subs'} | \n"; print "$text{'browser_attrs'} | \n"; print "||||
\n";
# Show sub-objects
foreach $dn (sort { lc($a->dn()) cmp lc($b->dn()) } $rv->all_entries) {
print "".
&html_escape($dn->dn())." \n"; } if (!$rv->all_entries) { print "$text{'browser_none'} \n"; } print " | \n";
print "
|