package LATMOS::Accounts::Bases::Sql::OCHelper::User;

# $Id: Accreq.pm 2041 2010-04-18 13:16:39Z nanardon $

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

sub _step {
    my ($self, $info) = @_;
    if ($info->{step} == 0) {
        $info->{step} = 1;
        $info->{ask} = [
            qw(givenName sn manager department)
        ];

    } elsif ($info->{step} == 1) {
        if ($self->base->create_c_object($self->otype,
                strftime('%Y%m%d%H%M%S', localtime),
                %{$info->{contentss} || {}},
            )) {
            return 'CREATED';
        } else {
            return 'ERROR';
        }
    } else {
        return undef;
    }
}

1;
