1 | package LATMOS::Accounts::Bases::Unix::Group; |
---|
2 | |
---|
3 | use 5.010000; |
---|
4 | use strict; |
---|
5 | use warnings; |
---|
6 | |
---|
7 | use base qw(LATMOS::Accounts::Bases::Objects); |
---|
8 | |
---|
9 | our $VERSION = (q$Rev: 205 $ =~ /^Rev: (\d+) /)[0]; |
---|
10 | |
---|
11 | =head1 NAME |
---|
12 | |
---|
13 | LATMOS::Ad - Perl extension for blah blah blah |
---|
14 | |
---|
15 | =head1 SYNOPSIS |
---|
16 | |
---|
17 | use LATMOS::Accounts::Bases; |
---|
18 | my $base = LATMOS::Accounts::Bases->new('unix'); |
---|
19 | ... |
---|
20 | |
---|
21 | =head1 DESCRIPTION |
---|
22 | |
---|
23 | Account base access over standard unix file format. |
---|
24 | |
---|
25 | =head1 FUNCTIONS |
---|
26 | |
---|
27 | =cut |
---|
28 | |
---|
29 | =head2 new(%options) |
---|
30 | |
---|
31 | Create a new LATMOS::Ad object for windows AD $domain. |
---|
32 | |
---|
33 | domain / server: either the Ad domain or directly the server |
---|
34 | |
---|
35 | ldap_args is an optionnal list of arguments to pass to L<Net::LDAP>. |
---|
36 | |
---|
37 | =cut |
---|
38 | |
---|
39 | sub new { |
---|
40 | my ($class, $base, $id, @args) = @_; |
---|
41 | # we profit of ref, quite easy |
---|
42 | if (exists($base->{groups}{$id}) && $base->{groups}{$id}) { |
---|
43 | return bless($base->{groups}{$id}, $class); |
---|
44 | } else { return } |
---|
45 | } |
---|
46 | |
---|
47 | sub get_field { |
---|
48 | my ($self, $field) = @_; |
---|
49 | $self->{$field} |
---|
50 | } |
---|
51 | |
---|
52 | sub set_fields { |
---|
53 | my ($self, %data) = @_; |
---|
54 | foreach my $field (keys %data) { |
---|
55 | # TODO check fields exists ! |
---|
56 | $self->{$field} = $data{$field}; |
---|
57 | } |
---|
58 | 1; |
---|
59 | } |
---|
60 | |
---|
61 | 1; |
---|
62 | |
---|
63 | __END__ |
---|
64 | |
---|
65 | =head1 SEE ALSO |
---|
66 | |
---|
67 | =head1 AUTHOR |
---|
68 | |
---|
69 | Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt> |
---|
70 | |
---|
71 | =head1 COPYRIGHT AND LICENSE |
---|
72 | |
---|
73 | Copyright (C) 2008, 2009 CNRS SA/CETP/LATMOS |
---|
74 | |
---|
75 | This library is free software; you can redistribute it and/or modify |
---|
76 | it under the same terms as Perl itself, either Perl version 5.10.0 or, |
---|
77 | at your option, any later version of Perl 5 you may have available. |
---|
78 | |
---|
79 | |
---|
80 | =cut |
---|