Handle hostnames with upper-case letters
[webmin.git] / ldap-useradmin / raw.cgi
1 #!/usr/local/bin/perl
2 # Show all attributes for a user or group
3
4 require './ldap-useradmin-lib.pl';
5 &ReadParse();
6 $ldap = &ldap_connect();
7 $schema = $ldap->schema();
8 if ($in{'user'}) {
9         $rv = $ldap->search(base => $in{'dn'},
10                             scope => 'base',
11                             filter => &user_filter());
12         }
13 else {
14         $rv = $ldap->search(base => $in{'dn'},
15                             scope => 'base',
16                             filter => &group_filter());
17         }
18 ($what) = $rv->all_entries;
19
20 &ui_print_header(&text('raw_for', $in{'dn'}), $text{'raw_title'}, "");
21
22 foreach $a ($what->attributes()) {
23         push(@table, [ "<b>$a</b>",
24                        join(" , ", $what->get_value($a)) ]);
25         }
26 print &ui_columns_table([ $text{'raw_name'}, $text{'raw_value'} ],
27                         100, \@table, undef);
28
29 &ui_print_footer($in{'user'} ? ( "edit_user.cgi?dn=".&urlize($in{'dn'}),
30                                  $text{'uedit_return'} )
31                              : ( "edit_group.cgi?dn=".&urlize($in{'dn'}),
32                                  $text{'gedit_return'} ),
33                  "index.cgi?mode=".($in{'user'} ? 'users' : 'groups'),
34                  $text{'index_return'});
35