source: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/OCHelper/Group.pm @ 1904

Last change on this file since 1904 was 1409, checked in by nanardon, 9 years ago

Add Helper to create group

File size: 1.3 KB
Line 
1package LATMOS::Accounts::Bases::OCHelper::Group;
2
3# $Id: User.pm 2932 2010-08-10 17:19:21Z nanardon $
4
5use strict;
6use warnings;
7use base qw(LATMOS::Accounts::Bases::OCHelper);
8use LATMOS::Accounts::Utils;
9
10=head1 NAME
11
12LATMOS::Accounts::Bases::OCHelper::User -
13Helper to create group in L<LATMOS::Accounts> system
14
15=cut
16
17sub _step {
18    my ($self, $info) = @_;
19    if ($info->{step} <= 0) {
20        $info->{name}{ask} = 1;
21        push(@{$info->{ask}}, qw(description label gidNumber managedBy sutype ));
22        $info->{step} = 1;
23    } 
24    elsif ($info->{step} == 1) {
25        if ($self->base->create_c_object($self->otype,
26                $info->{name}{content},
27                %{$info->{contents} || {}},
28            )) {
29            return 'CREATED';
30        } else {
31            return 'ERROR';
32        }
33    } else {
34        return undef;
35    }
36}
37
381;
39
40__END__
41
42=head1 SEE ALSO
43
44L<LATMOS::Accounts::Bases::OCHelper>
45
46=head1 AUTHOR
47
48Thauvin Olivier, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>
49
50=head1 COPYRIGHT AND LICENSE
51
52Copyright (C) 2012 by Thauvin Olivier
53
54This library is free software; you can redistribute it and/or modify
55it under the same terms as Perl itself, either Perl version 5.10.0 or,
56at your option, any later version of Perl 5 you may have available.
57
58=cut
Note: See TracBrowser for help on using the repository browser.