line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package API::Plesk::WebUser; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
2664
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
65
|
|
8
|
1
|
|
|
1
|
|
4
|
use Data::Dumper; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base 'API::Plesk::Component'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
602
|
|
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
|
|
|
|
|
|
$self->check_required_params(\%params, qw(site-id login)); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $data = $self->sort_params(\%params, qw(site-id login password password-type ftp-quota services)); |
20
|
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
22
|
|
|
|
|
|
|
$self->plesk->send('webuser', 'add', $data); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub get { |
26
|
0
|
|
|
0
|
1
|
|
my ($self, %filter) = @_; |
27
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
28
|
|
|
|
|
|
|
|
29
|
0
|
0
|
|
|
|
|
my $data = { |
30
|
|
|
|
|
|
|
filter => @_ > 2 ? \%filter : '', |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
34
|
|
|
|
|
|
|
$self->plesk->send('webuser', 'get', $data); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub get_prefs { |
38
|
0
|
|
|
0
|
1
|
|
my ($self, %filter) = @_; |
39
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
40
|
|
|
|
|
|
|
|
41
|
0
|
0
|
|
|
|
|
my $data = { |
42
|
|
|
|
|
|
|
filter => @_ > 2 ? \%filter : '', |
43
|
|
|
|
|
|
|
}; |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
46
|
|
|
|
|
|
|
$self->plesk->send('webuser', 'get-prefs', $data); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub set { |
50
|
0
|
|
|
0
|
1
|
|
my ( $self, %params ) = @_; |
51
|
0
|
|
|
|
|
|
my $bulk_send = delete $params{bulk_send}; |
52
|
0
|
|
0
|
|
|
|
my $filter = delete $params{filter} || ''; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $data = { |
55
|
|
|
|
|
|
|
filter => $filter, |
56
|
|
|
|
|
|
|
values => $self->sort_params(\%params, qw(password password-type ftp-quota services)), |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
60
|
|
|
|
|
|
|
$self->plesk->send('webuser', 'set', $data); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
sub del { |
64
|
0
|
|
|
0
|
1
|
|
my ($self, %filter) = @_; |
65
|
0
|
|
|
|
|
|
my $bulk_send = delete $filter{bulk_send}; |
66
|
|
|
|
|
|
|
|
67
|
0
|
0
|
|
|
|
|
my $data = { |
68
|
|
|
|
|
|
|
filter => @_ > 2 ? \%filter : '' |
69
|
|
|
|
|
|
|
}; |
70
|
|
|
|
|
|
|
|
71
|
0
|
0
|
|
|
|
|
return $bulk_send ? $data : |
72
|
|
|
|
|
|
|
$self->plesk->send('webuser', 'del', $data); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |