1 | package LATMOS::Accounts::Bases::Sql::Revaliases; |
---|
2 | |
---|
3 | use 5.010000; |
---|
4 | use strict; |
---|
5 | use warnings; |
---|
6 | |
---|
7 | use base qw(LATMOS::Accounts::Bases::Sql::objects); |
---|
8 | use LATMOS::Accounts::Log; |
---|
9 | |
---|
10 | our $VERSION = (q$Rev: 341 $ =~ /^Rev: (\d+) /)[0]; |
---|
11 | |
---|
12 | =head1 NAME |
---|
13 | |
---|
14 | LATMOS::Ad - Perl extension for blah blah blah |
---|
15 | |
---|
16 | =head1 SYNOPSIS |
---|
17 | |
---|
18 | use LATMOS::Accounts::Bases; |
---|
19 | my $base = LATMOS::Accounts::Bases->new('sql'); |
---|
20 | ... |
---|
21 | |
---|
22 | =head1 DESCRIPTION |
---|
23 | |
---|
24 | Account base access over standard unix file format. |
---|
25 | |
---|
26 | =head1 FUNCTIONS |
---|
27 | |
---|
28 | =cut |
---|
29 | |
---|
30 | =head2 new(%config) |
---|
31 | |
---|
32 | Create a new LATMOS::Ad object for windows AD $domain. |
---|
33 | |
---|
34 | domain / server: either the Ad domain or directly the server |
---|
35 | |
---|
36 | ldap_args is an optionnal list of arguments to pass to L<Net::LDAP>. |
---|
37 | |
---|
38 | =cut |
---|
39 | |
---|
40 | sub _object_table { 'revaliases' } |
---|
41 | |
---|
42 | sub _key_field { 'name' } |
---|
43 | |
---|
44 | sub _has_extended_attributes { 0 } |
---|
45 | |
---|
46 | sub _get_attr_schema { |
---|
47 | my ($class, $base) = @_; |
---|
48 | |
---|
49 | $class->SUPER::_get_attr_schema($base, |
---|
50 | { |
---|
51 | name => { reference => 'user', inline => 1, }, |
---|
52 | } |
---|
53 | ) |
---|
54 | } |
---|
55 | |
---|
56 | sub _create { |
---|
57 | my ($class, $base, $id, %data) = @_; |
---|
58 | |
---|
59 | my $uobj = $base->get_object('user', $id) or do { |
---|
60 | $base->log(LA_ERR, 'Cannot create revaliases %s: no such user', $id); |
---|
61 | return; |
---|
62 | }; |
---|
63 | $data{exported} = $uobj->get_attributes('exported') || 0; |
---|
64 | |
---|
65 | $class->SUPER::_create($base, $id, %data); |
---|
66 | } |
---|
67 | |
---|
68 | 1; |
---|
69 | |
---|
70 | __END__ |
---|
71 | |
---|
72 | =head1 SEE ALSO |
---|
73 | |
---|
74 | L<LATMOS::Accounts::Bases::Sql::Aliases>, L<LATMOS::Accounts::Bases::Sql> |
---|
75 | |
---|
76 | =head1 AUTHOR |
---|
77 | |
---|
78 | Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt> |
---|
79 | |
---|
80 | =head1 COPYRIGHT AND LICENSE |
---|
81 | |
---|
82 | Copyright (C) 2008, 2009 CNRS SA/CETP/LATMOS |
---|
83 | |
---|
84 | This library is free software; you can redistribute it and/or modify |
---|
85 | it under the same terms as Perl itself, either Perl version 5.10.0 or, |
---|
86 | at your option, any later version of Perl 5 you may have available. |
---|
87 | |
---|
88 | |
---|
89 | =cut |
---|