/[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

Annotation of /html/find.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (hide annotations) (vendor branch)
Wed May 3 08:28:04 2000 UTC (23 years, 11 months ago) by dpavlin
Branch: DbP
CVS Tags: r0
Changes since 1.1: +0 -0 lines
početni import

1 dpavlin 1.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'=>'ime',
12     'sn'=>'prezime',
13     'cn'=>'ime i prezime');
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=>'*'),p,
24     submit,
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     for($i = 0 ; $i < $max ; $i++) {
37     my $entry = $mesg->entry($i);
38     print li($entry->get('cn')," e-mail: ",$entry->get('mail'));
39     }
40     print end_ul;
41    
42     }

  ViewVC Help
Powered by ViewVC 1.1.26