API-CPanel

 view release on metacpan or  search on metacpan

lib/API/CPanel/User.pm  view on Meta::CPAN

sub create {
    my $params = shift;

    return API::CPanel::action_abstract(
	params         => $params,
	func           => 'createacct',
	container      => 'result',
	want_hash      => $params->{want_hash},
	allowed_fields =>
	   'username
	    domain
	    plan
	    pkgname
	    savepkg
	    featurelist
	    quota
	    password
	    ip
	    cgi
	    frontpage
	    hasshell
	    contactemail
	    cpmod
	    maxftp
	    maxsql
	    maxpop
	    maxlst
	    maxsub
	    maxpark
	    maxaddon
	    bwlimit
	    customip
	    language
	    useregns
	    hasuseregns
	    reseller
	    forcedns
	    mxcheck',
    );
}

# Edit user data
# user* (string)	-- User name of the account.
# domain (string)	-- Domain name.
# newuser (string)	-- Used when changing the username of an account. This will be the new username.
# owner (string)	-- Change the owner of the account to the specified owner.
# CPTHEME (string)	-- cPanel theme name.
# HASCGI (boolean)	-- Whether or not the domain has CGI access.
# LANG (string)		-- Language to use in the account's cPanel interface.
# LOCALE (string)	-- Locale to use in the account's cPanel interface.
# maxftp (string)	-- Maximum number of FTP accounts the user can create.
# maxsql (string)	-- Maximum number of SQL databases the user can create.
# maxpop (string)	-- Maximum number of email accounts the user can create.
# maxlst (string)	-- Maximum number of mailing lists the user can create.
# maxsub (string)	-- Maximum number of subdomains the user can create.
# maxpark (string)	-- Maximum number of parked domains the user can create.
# maxaddon (string)	-- Maximum number of addon domains the user can create.
# shell (boolean)	-- Whether or not the domain has shell/SSH access.

# According to http://docs.cpanel.net/twiki/bin/view/AllDocumentation/AutomationIntegration/ModifyAccount
sub edit {
    my $params = shift;

    return API::CPanel::action_abstract( 
	params         => $params,
	func           => 'modifyacct',
	container      => 'result',
	allowed_fields =>
	   'user
	    domain
	    newuser
	    owner
	    CPTHEME
	    HASCGI
	    LANG
	    LOCALE
	    MAXFTP
	    MAXSQL
	    MAXPOP
	    MAXLST
	    MAXSUB
	    MAXPARK
	    MAXADDON
	    shell',
    );
}

# Delete user from panel
# user* -- user name
sub delete {
    my $params = shift;

    return API::CPanel::action_abstract(
	params         => $params,
	func           => 'removeacct',
	container      => 'result',
	allowed_fields => 'user',
    );
}

# Switch on user account
# user* -- user name
sub enable {
    my $params = shift;

    return API::CPanel::action_abstract(
	params         => $params,
	func           => 'unsuspendacct',
	container      => 'result',
	allowed_fields => 'user',
    );
}

# Switch off user account
# user* -- user name
# reason -- reason of suspend
sub disable {
    my $params = shift;

    return API::CPanel::action_abstract(
	params         => $params,



( run in 0.979 second using v1.01-cache-2.11-cpan-d8267643d1d )