line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::LDAP::Command::Add::Ou; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use Modern::Perl; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
593
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
with qw( App::LDAP::Role::Command |
8
|
|
|
|
|
|
|
App::LDAP::Role::Bindable ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has base => ( |
11
|
|
|
|
|
|
|
is => "rw", |
12
|
|
|
|
|
|
|
isa => "Str", |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use App::LDAP::LDIF::OrgUnit; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub run { |
18
|
|
|
|
|
|
|
my ($self, ) = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $ouname = $self->extra_argv->[2] or die "no organization name specified"; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
die "ou $ouname already exists" if App::LDAP::LDIF::OrgUnit->search( |
23
|
|
|
|
|
|
|
base => config()->{base}, |
24
|
|
|
|
|
|
|
scope => config()->{scope}, |
25
|
|
|
|
|
|
|
filter => "ou=$ouname", |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $ou = App::LDAP::LDIF::OrgUnit->new( |
29
|
|
|
|
|
|
|
base => $self->base // config()->{base}, |
30
|
|
|
|
|
|
|
ou => $ouname, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$ou->save; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$ou; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
40
|
|
|
|
|
|
|
no Moose; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=pod |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
App::LDAP::Command::Add::Ou - the handler for adding Organization Units |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |