package LATMOS::Accounts::Bases::OCHelper::Group;

# $Id: User.pm 2932 2010-08-10 17:19:21Z nanardon $

use strict;
use warnings;
use base qw(LATMOS::Accounts::Bases::OCHelper);
use LATMOS::Accounts::Utils;

=head1 NAME

LATMOS::Accounts::Bases::OCHelper::User -
Helper to create group in L<LATMOS::Accounts> system

=cut

sub _step {
    my ($self, $info) = @_;
    if ($info->{step} <= 0) {
        $info->{name}{ask} = 1;
        push(@{$info->{ask}}, qw(description label gidNumber managedBy sutype ));
        $info->{step} = 1;
    } 
    elsif ($info->{step} == 1) {
        if ($self->base->create_c_object($self->otype,
                $info->{name}{content},
                %{$info->{contents} || {}},
            )) {
            return 'CREATED';
        } else {
            return 'ERROR';
        }
    } else {
        return undef;
    }
}

1;

__END__

=head1 SEE ALSO

L<LATMOS::Accounts::Bases::OCHelper>

=head1 AUTHOR

Thauvin Olivier, E<lt>olivier.thauvin@latmos.ipsl.frE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2012 by Thauvin Olivier

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.10.0 or,
at your option, any later version of Perl 5 you may have available.

=cut
