AddressBook

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN

Revision history for Perl extension AddressBook.

0.16  2/02/2001
    - Makefile.PL now builds a config file for the LDAP backend test script.	 

0.15  1/22/2001	
    - Added "anonymous" parameter to LDAP constructor to support anonymous binds.
	
0.14  1/18/2001	
    - Added support for 'url', 'lurl', and 'textblock' attribute types
    - Object persistance fix for SyncAbook.pm
    - Missing example files added to MANIFEST
	
0.13  1/14/2001	

    - Added phonelist.cgi sample script
    - Added abook.palm (direct) and SyncAbook.pm (for PilotManager) sample scripts

Makefile.PL  view on Meta::CPAN


$r = prompt("For testing the LDAP backend, I need to know some things about 
your LDAP server.  Continue? [y/n]","y");

if ($r =~ /^y$/i) {
  $hostname = prompt("What is your LDAP server hostname","localhost");
  $base = prompt("What is a valid LDAP base that I can use for searching? 
(eg. \"ou=abook,dc=<your_domain>\")");
  $objectclass = prompt("What is a valid LDAP objectclass that I can search for?",
"organizationalUnit");
  print "The LDAP test script will attempt to bind anonymously to \"$hostname\"
and search for \"objectclass=$objectclass\" 
using the base: $base\n";
  open F, ">t/t.ldap.conf";
  print F << "EDQ";
<AddressBook_config>
  <fields>
    <field name="objectclass">
      <db type="LDAP" name="objectclass" />
    </field>
  </fields>

lib/AddressBook/DB/LDAP.pm  view on Meta::CPAN

    $self->{$_} = $args{$_};
  }
  my ($hostname,$base,$mesg);
  if ($self->{dsn}) {
    ($hostname,$base) = split "/", $self->{dsn};
  }
  $self->{hostname} = $hostname || $self->{hostname};
  $self->{base} = $base || $self->{base};
  $self->{ldap} = Net::LDAP->new($self->{hostname}, async => 1 || croak $@);
  unless ($self->{anonymous}) {
    $mesg = $self->{ldap}->bind($self->{username}, password => $self->{password});
  } else {
    $mesg = $self->{ldap}->bind;
  }
  if ($mesg->is_error) {
    croak "could not bind to LDAP server: " . $mesg->error;
  }
  return $self;
}

sub search {
  my $self = shift;
  my $class = ref $self || croak "Not a method call.";
  my @ret;
  my %arg = @_;
  my $max_size = $arg{entries} || 0;



( run in 0.966 second using v1.01-cache-2.11-cpan-2398b32b56e )