GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
SPOPS::Tool::LDAP::Datasource(3) User Contributed Perl Documentation SPOPS::Tool::LDAP::Datasource(3)

SPOPS::Tool::LDAP::Datasource -- Embed the parameters for a LDAP handle in object configuration

 # Connect to a server running on localhost:389 using an anonymous
 # bind (no username/password)

 my $spops = {
   myobject => {
     class      => 'My::Object',
     rules_from => [ 'SPOPS::Tool::LDAP::Datasource' ]
     field      => [ qw/ cn sn givenname displayname mail
                         telephonenumber objectclass uid ou / ],
     id_field   => 'uid',
     ldap_base_dn => 'ou=People,dc=MyCompany,dc=com',
     ...
   },
 };
 SPOPS::Initialize->process({ config => $spops });
 my $ldap_filter = '&(objectclass=inetOrgPerson)(mail=*cwinters.com)';
 my $list = My::Object->fetch_group({ where => $ldap_filter });
 foreach my $object ( @{ $list } ) {
     print "Name: $object->{givenname} at $object->{mail}\n";
 }

This rule allows you to embed the LDAP connection information in your object rather than using the strategies described elsewhere. This is very handy for creating simple, one-off scripts, but you should still use the subclassing strategy from SPOPS::Manual::Cookbook if you will have multiple objects using the same datasource.

behavior_factory( $class )

Generates a behavior to generate the datasource retrieval code during the 'manipulate_configuration' phase.

datasource_access( $class )

Generates the 'global_datasource_handle()' method that retrieves an opened database handle if it exists or creates one otherwise.

None known.

Nothing known.

SPOPS::Manual::CodeGeneration

SPOPS::LDAP

Copyright (c) 2001-2004 intes.net, inc.. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Chris Winters <chris@cwinters.com>

Thanks to jeffa on PerlMonks (http://www.perlmonks.org/index.pl?node_id=18800) for suggesting this!

2004-06-02 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.