source: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/Revaliases.pm @ 1365

Last change on this file since 1365 was 1071, checked in by nanardon, 12 years ago
  • rename options() to config() to clarify its role
File size: 1.8 KB
Line 
1package LATMOS::Accounts::Bases::Sql::Revaliases;
2
3use 5.010000;
4use strict;
5use warnings;
6
7use base qw(LATMOS::Accounts::Bases::Sql::objects);
8use LATMOS::Accounts::Log;
9
10our $VERSION = (q$Rev: 341 $ =~ /^Rev: (\d+) /)[0];
11
12=head1 NAME
13
14LATMOS::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
24Account base access over standard unix file format.
25
26=head1 FUNCTIONS
27
28=cut
29
30=head2 new(%config)
31
32Create a new LATMOS::Ad object for windows AD $domain.
33
34domain / server: either the Ad domain or directly the server
35
36ldap_args is an optionnal list of arguments to pass to L<Net::LDAP>.
37
38=cut
39
40sub _object_table { 'revaliases' }
41
42sub _key_field { 'name' }
43
44sub _has_extended_attributes { 0 }
45
46sub _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
56sub _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
681;
69
70__END__
71
72=head1 SEE ALSO
73
74L<LATMOS::Accounts::Bases::Sql::Aliases>, L<LATMOS::Accounts::Bases::Sql>
75
76=head1 AUTHOR
77
78Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>
79
80=head1 COPYRIGHT AND LICENSE
81
82Copyright (C) 2008, 2009 CNRS SA/CETP/LATMOS
83
84This library is free software; you can redistribute it and/or modify
85it under the same terms as Perl itself, either Perl version 5.10.0 or,
86at your option, any later version of Perl 5 you may have available.
87
88
89=cut
Note: See TracBrowser for help on using the repository browser.