/[ldap]/html/find.cgi
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 /html/find.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations)
Wed May 3 09:14:39 2000 UTC (24 years ago) by dpavlin
Branch: MAIN
Changes since 1.2: +1 -1 lines
zaboravljen /a tag!

1 #!/usr/local/bin/perl -w
2
3 use Net::LDAP;
4 use Net::LDAP::LDIF;
5 use CGI qw/:standard/;
6
7 $ldap = Net::LDAP->new('ldap.pliva.hr',port=>389) || die "$@";
8
9 $ldap->bind; # anonymous
10
11 %labels = ('givenname'=>'imenu',
12 'sn'=>'prezimenu',
13 'cn'=>'imenu i prezimenu');
14
15
16 print header,
17 start_html('LDAP pretra¾ivanje'),
18 start_form,
19 "Pretra¾ujte prema ",popup_menu(-name=>'what',
20 -values=>['givenname','sn','cn'],
21 -default=>'cn',
22 -labels=>\%labels),
23 textfield(-name=>'search',-default=>'*'),
24 submit(-value=>"Poèni"),p
25 end_form;
26
27 if(param()) {
28 $mesg = $ldap->search (
29 base => 'o=pliva.hr',
30 # filter => 'sn=Pavlinusic'
31 filter => param('what').'='.param('search')
32 );
33
34 print begin_ul;
35 my $max = $mesg->count;
36 print "Broj osoba koje odgovaraju upitu: ",$mesg->count,p;
37 for($i = 0 ; $i < $max ; $i++) {
38 my $entry = $mesg->entry($i);
39 my ($mail) = $entry->get('mail'); # array, take first
40 print li($entry->get('cn')," <tt><a href=\"mailto: $mail\">$mail</a></tt>");
41 }
42 print end_ul;
43
44 }

  ViewVC Help
Powered by ViewVC 1.1.26