API-CPanel
view release on metacpan or search on metacpan
lib/API/CPanel/User.pm view on Meta::CPAN
package API::CPanel::User;
use strict;
use warnings;
use API::CPanel;
use Data::Dumper;
our $VERSION = 0.08;
# Âîçâðàùàåò ñïèñîê ïîëüçîâàòåëåé
sub list {
my $params = shift;
return API::CPanel::fetch_hash_abstract(
params => $params,
func => 'listaccts',
container => 'acct',
key_field => 'user',
);
}
# Âîçâðàùàåò ñïèñîê ïîëüçîâàòåëåé (âîçâðàùàåò ìàññèâ, òîëüêî èìåíà ïîëüçîâàòåëåé)
sub list_simple {
my $params = shift;
return API::CPanel::fetch_array_abstract(
params => $params,
func => 'listaccts',
container => 'acct',
result_field => 'user',
);
}
# Âîçâðàùàåò ÷èñëî àêòèâíûõ ïîëüçîâàòåëåé
sub active_user_count {
my $params = shift;
my $result = API::CPanel::fetch_array_abstract(
params => $params,
func => 'listaccts',
container => 'acct',
result_field => 'suspendtime',
);
my $count = 0;
foreach my $elem ( @$result ) {
$count++ if ref $elem eq "HASH";
};
return $count;
}
# Ñîçäàòü ïîëüçîâàòåëÿ
# username* (string) -- User name.
# domain* (string) -- Domain name.
# plan (string) -- Package to use for account creation.
# pkgname (string) -- Name of a new package to be created based on the settings used.
# savepkg (bool) -- Save the settings used as a new package.
# featurelist (string) -- Name of the feature list to be used when creating a new package.
# quota (integer) -- Disk space quota in Megabytes.
# password (string) -- Password for accessing cPanel.
# ip (string) -- Whether or not the domain has a dedicated IP address.
# cgi (boolean) -- Whether or not the domain has CGI access.
# frontpage (boolean) -- Whether or not the domain has FrontPage extensions installed.
# hasshell (boolean) -- Whether or not the domain has shell/SSH access.
# contactemail (string) -- Contact email address for the account.
# cpmod (string) -- cPanel theme name.
( run in 0.891 second using v1.01-cache-2.11-cpan-39bf76dae61 )