NAME
Kinghost::Painel - Object for hosting automation using Kinghost (www.kinghost.net) v2 Control Panel
VERSION
version 0.005
SYNOPSIS
use Kinghost::Painel;
my $painel = Kinghost::Painel->new();
#my $painel = new Kinghost::Painel();
# Loga no painel
$painel->logar("email@revenda.com.br", "senhadarevenda");
# Novo Cliente
my $empresa = "João25";
my $nome = "José João25";
my $tipoPessoa = "F"; # F - J - I(ignorar)
my $cpfcnpj = "000.000.000-00"; # CPF ou CNPJ
my $email = 'xxxxxgg@gmail.com';
my $emailcobranca = 'xxxxx@gmail.com';
my $senha = "teste";
my $senhaConfimacao = "teste";
my $telefone = "";
my $fax = "";
my $cep = "";
my $endereco = "";
my $cidade = "";
my $estado = "";
print $painel->novoCliente($empresa, $nome, $tipoPessoa, $cpfcnpj, $email, $emailcobranca, $senha, $senhaConfimacao, $telefone, $fax, $cep, $endereco, $cidade, $estado);
# Novo Domínio
my $plano = "45198";
my $dominio = "topjeca.com.br";
my $cliente = "107645";
my $pagoate = "2012-03-01";
my $senha = "testeteste";
my $plataforma = "Windows";
my $webmail = "SquirrelMail";
print $painel->novoDominio($plano, $cliente, $pagoate, $dominio, $senha, $plataforma, $webmail);
# Novo Banco PGSql
my $idDominio = "291076";
my $senha = "teste";
print $painel->novoPGSql($idDominio, $senha);
METHODS
logar
Loga no painel de controle. Este método deverá ser chamado antes de qualquer outro método. Ativa flag $statusLogin.
my $status_login = $painel->logar($email, $senha);
Return string
logged, invalid login, not found, unknow HTTP error, connection error
novoCliente
Cadastra novo cliente
print $painel->novoCliente($empresa, $nome, $tipoPessoa, $cpfcnpj, $email, $emailcobranca, $senha, $senhaConfimacao, $telefone, $fax, $cep, $endereco, $cidade, $estado);
Return JSON
{"nome":"José João25","resposta":"registrado","status":"sucesso","codigo":"107630"}
{"resposta":"E-mail em uso","status":"erro"}
{"resposta":"efetue login primeiro","status":"erro"}
novoDominio
Cadastra novo Dominio
print $painel->novoDominio($plano, $cliente, $pagoate, $dominio, $senha, $plataforma, $webmail);
Return JSON
{"dominio":"topjeca.com.br","resposta":"registrado","status":"sucesso","codigo":"291076"}
{"dominio":"topjeca.com.br","resposta":"dominio ja existe","status":"erro"}
novoPGSql
Cadastra Banco PGSql. O nome do banco e do user é criado automaticamente pelo sistema da kinghost, não sendo opcional.
print $painel->novoPGSql($idDominio, $senha);
Return JSON
{"resposta":"banco criado","status":"sucesso","banco":"topjeca"}
novoMySQL
Cadastra Banco MySQL. O nome do banco e do user é criado automaticamente pelo sistema da kinghost, não sendo opcional.
print $painel->novoMySQL($idDominio, $senha);
Return JSON
{"resposta":"banco criado","status":"sucesso","banco":"topjeca"}
importaFTPExterno
Importa conteúdo de um FTP remoto para o ftp do domínio local. Informe o diretório de origem e o diretório de destino
my $idDominio = "xxxxx";
my $host = "ftp.xxxxxx.com.br";
my $user = "usuarioftp";
my $pass = "senhaftp";
my $dirOrigem = 'www';
my $dirDestino = 'www';
print $painel->importaFTPExterno( $idDominio, $host, $user, $pass, $dirOrigem, $dirDestino );
Return JSON
{"resposta":"Migracao em andamento. Quando a migracao terminar os arquivos estarao em seu site","status":"sucesso"}
{"resposta":"Erro de FTP. Verifique as credenciais de acesso ao FTP ou o diretorio alvo no FTP remoto","status":"erro"}
{"resposta":"diretorio de origem invalido","status":"erro"}
EXAMPLES
Look at eg/ folder
AUTHORS
José Eduardo Perotta de Almeida, eduardo at web2solutions.com.br
LICENSE AND COPYRIGHT
Copyright 2012 José Eduardo Perotta de Almeida.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org.
DISCLAIMER OF WARRANTY
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.