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