line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package API::Plesk::FTPUser; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
8539
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
92
|
|
|
1
|
|
|
|
|
91
|
|
8
|
1
|
|
|
1
|
|
6
|
use Data::Dumper; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
52
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base 'API::Plesk::Component'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
758
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
#TODO |
13
|
|
|
|
|
|
|
sub add { |
14
|
0
|
|
|
0
|
1
|
|
my ( $self, %params ) = @_; |
15
|
0
|
|
|
|
|
|
my $bulk_send = delete $params{bulk_send}; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my @sort_fields = ( |
18
|
|
|
|
|
|
|
'name', |
19
|
|
|
|
|
|
|
'password', |
20
|
|
|
|
|
|
|
'home', |
21
|
|
|
|
|
|
|
'create_non_existent', |
22
|
|
|
|
|
|
|
'quota', |
23
|
|
|
|
|
|
|
'permissions', |
24
|
|
|
|
|
|
|
[qw(site-id site-name)], |
25
|
|
|
|
|
|
|
); |
26
|
0
|
|
|
|
|
|
my @required_fields = ( |
27
|
|
|
|
|
|
|
'name', |
28
|
|
|
|
|
|
|
'password', |
29
|
|
|
|
|
|
|
[qw(site-id site-name)], |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
$self->check_required_params(\%params, @required_fields); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
my $data = $self->sort_params(\%params, @sort_fields); |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
37
|
|
|
|
|
|
|
$self->plesk->send('ftp-user', 'add', $data); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub get { |
41
|
0
|
|
|
0
|
1
|
|
my ($self, %filter) = @_; |
42
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
43
|
0
|
0
|
|
|
|
|
my $data = { |
44
|
|
|
|
|
|
|
filter => @_ > 2 ? \%filter : '', |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
48
|
|
|
|
|
|
|
$self->plesk->send('ftp-user', 'get', $data); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub set { |
52
|
0
|
|
|
0
|
1
|
|
my ( $self, %params ) = @_; |
53
|
0
|
|
|
|
|
|
my $bulk_send = delete $params{bulk_send}; |
54
|
0
|
|
0
|
|
|
|
my $filter = delete $params{filter} || ''; |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
my @sort_fields = ( |
57
|
|
|
|
|
|
|
'name', |
58
|
|
|
|
|
|
|
'password', |
59
|
|
|
|
|
|
|
'home', |
60
|
|
|
|
|
|
|
'create_non_existent', |
61
|
|
|
|
|
|
|
'quota', |
62
|
|
|
|
|
|
|
'permissions', |
63
|
|
|
|
|
|
|
); |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my $data = { |
66
|
|
|
|
|
|
|
filter => $filter, |
67
|
|
|
|
|
|
|
values => $self->sort_params(\%params, @sort_fields), |
68
|
|
|
|
|
|
|
}; |
69
|
|
|
|
|
|
|
|
70
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
71
|
|
|
|
|
|
|
$self->plesk->send('ftp-user', 'set', $data); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub del { |
75
|
0
|
|
|
0
|
1
|
|
my ($self, %filter) = @_; |
76
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
77
|
|
|
|
|
|
|
|
78
|
0
|
0
|
|
|
|
|
my $data = { |
79
|
|
|
|
|
|
|
filter => @_ > 2 ? \%filter : '' |
80
|
|
|
|
|
|
|
}; |
81
|
|
|
|
|
|
|
|
82
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
83
|
|
|
|
|
|
|
$self->plesk->send('ftl-user', 'del', $data); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
__END__ |