API-CPanel

 view release on metacpan or  search on metacpan

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

    );
}


# Èçìåíÿåò îñíîâíîé èï ñàéòà
sub change_site_ip {
    my $params = shift;

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

# Äîáàâèòü äîïîëíèòåëüíûé äîìåí
# IN:
#   - dir       - The path that will serve as the addon domain's home directory.
#   - newdomain - The domain name of the addon domain you wish to create. (e.g. sub.example.com).
#   - pass      - Password to access and edit the addon domain's files.

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

    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.
# maxftp (string)	-- Maximum number of FTP accounts the user can create.

t/01-test.t  view on Meta::CPAN

        <MAXSUB>unlimited</MAXSUB>
        <MTIME>1269406519</MTIME>
        <MXCHECK-zse1.ru>0</MXCHECK-zse1.ru>
        <OWNER>root</OWNER>
        <PLAN>default</PLAN>
        <RS>x</RS>
        <STARTDATE>1269406518</STARTDATE>
        <USER>zseasd</USER>
      </cpuser>
      <domain>zse1.ru</domain>
      <setshell>unmodified</setshell>
      <user>zseasd</user>
    </newcfg>
    <status>1</status>
    <statusmsg>Account Modified</statusmsg>
  </result>
</modifyacct>
THEEND

$result = API::CPanel::User::edit(
    {

t/01-test.t  view on Meta::CPAN

Changing max sql accounts from 14 to 99
Changing max ftp accounts from unlimited to unlimited
Changing max lists from unlimited to unlimited
Changing max sub domains from unlimited to unlimited
Changing language from ru to en
Changing max parked domains from 0 to 0
Changing max addon domains from 0 to 0
Shell Access Set Correctly (noshell)
Changing cPanel theme from x to
Changing plan from default to Host-343
Resetting QUOTA....
Using Quota v3 Support
Bandwidth limit (0) is lower than (unlimited) (all limits removed)&lt;br /&gt;&lt;blockquote&gt;&lt;div style='float:left;'&gt;Enabling...&lt;/div&gt;&lt;div style='float:left;'&gt;...zse1.ru...&lt;/div&gt;&lt;div style='float:left;'&gt;Done&lt;/div&...
</rawout>
    <status>1</status>
    <statusmsg>Account Upgrade/Downgrade Complete for zsezse</statusmsg>
  </result>
</changepackage>
THEEND

$result = API::CPanel::User::change_package(

t/01-test.t  view on Meta::CPAN

$result = API::CPanel::Ip::add(
    {
	%correct_params,
	ip      => '192.168.123.150',
	netmask => '255.255.255.0',
    }
);
is( $result, 1, 'API::CPanel::Ip::add');

$API::CPanel::FAKE_ANSWER = ! $ONLINE ? <<THEEND : undef;
<setsiteip>
  <result>
      <status>1</status>
      <statusmsg></statusmsg>
  </result>
</setsiteip>
THEEND

$result = API::CPanel::Domain::change_site_ip(
    {
        %correct_params,
        ip      => '192.168.123.150',
        user    => $manipulate_user,
    }
);
is( $result, 1, 'API::CPanel::Domain::change_site_ip');


$API::CPanel::FAKE_ANSWER = ! $ONLINE ? <<THEEND : undef;
<setsiteip>
  <result>
      <status>1</status>
      <statusmsg></statusmsg>
  </result>
</setsiteip>
THEEND

$result = API::CPanel::Domain::change_site_ip(
    {
        %correct_params,
        ip      => $main_shared_ip,
        user    => $manipulate_user,
    }
);
is( $result, 1, 'API::CPanel::Domain::change_site_ip to main_shared_ip');



( run in 1.474 second using v1.01-cache-2.11-cpan-49f99fa48dc )