| Samba-LDAP documentation | Contained in the Samba-LDAP distribution. |
Samba::LDAP::Base - Base class module implementing common functionality
This document describes Samba::LDAP::Base version 0.05
See Class::Base
Base class module which implements a constructor and error reporting functionality for various Samba-LDAP modules. Subclasses Class::Base
DEVELOPER RELEASE!
BE WARNED - Not yet complete and neither are the docs!
See Class::Base
Used to read in our configuration files, on creation of new objects
Returns the current module version number. See Template::Base
my $module = Samba::LDAP->new();
my $version = $module->module_version();
See Class::Base
Samba::LDAP::Base requires no configuration files or environment variables.
None reported.
No bugs have been reported.
Please report any bugs or feature requests to
bug-samba-ldap@rt.cpan.org, or through the web interface at
http://rt.cpan.org.
Gavin Henry <ghenry@suretecsystems.com>
IDEALX for original scripts.
Copyright (c) 2001-2002 IDEALX - Original smbldap-tools
Copyright (c) 2006, Suretec Systems Ltd. - Gavin Henry
<ghenry@suretecsystems.com>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See perlgpl.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
| Samba-LDAP documentation | Contained in the Samba-LDAP distribution. |
package Samba::LDAP::Base; # Returned by Perl::MinimumVersion 0.11 require 5.006; use warnings; use strict; use base qw(Class::Base); use Samba::LDAP::Config; our $VERSION = '0.05'; # # Add Log::Log4perl to all our classes!!!! # #======================================================================== # -- PUBLIC METHODS -- #======================================================================== #------------------------------------------------------------------------ # init() # # Initialisation method called by the new() constructor and passing a # reference to a hash array containing any configuration items specified # as constructor arguments. Should return $self on success or undef on # error, via a call to the error() method to set the error message. # # We don't use the $config reference yet, still deciding how best to # handle that. #------------------------------------------------------------------------ sub init { my ( $self, $config ) = @_; # Do something with $config here later # let's read in smbldap.conf and smbldap_bind.conf and make them # available via $self in every new->(); # smbldap.conf my $conf = Samba::LDAP::Config->new(); $conf = $conf->read_conf( $conf->find_smbldap ); # Stick them all in $self $self->{$_} = $conf->{$_} for keys %$conf; my $bind_conf = $conf->read_conf( $conf->find_smbldap_bind ); # Same again $self->{$_} = $bind_conf->{$_} for keys %$bind_conf; return $self; } #------------------------------------------------------------------------ # module_version() # # Returns the current version number. #------------------------------------------------------------------------ sub module_version { my $self = shift; my $class = ref $self || $self; no strict 'refs'; return ${"${class}::VERSION"}; } 1; # Magic true value required at end of module __END__