-
Notifications
You must be signed in to change notification settings - Fork 1
/
ferozo.php
56 lines (52 loc) · 1.44 KB
/
ferozo.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* (c) Gabriel Quagliano - gabriel.quagliano@gmail.com
*/
namespace ferozo;
include_once(__DIR__.'/ferozoBase.php');
/**
* Interfaz con el panel de control de hosting Ferozo.
*/
class ferozo extends ferozoBase {
public function obtenerDominios($pagina=1) {
$this->csrf();
$res=$this->postJson('hosting/domain/listdomains',[
'params'=>[
'pagination'=>[
'page'=>$pagina,
'offset'=>50,
'orderBy'=>'',
'orderType'=>''
]
]
]);
if($res) return $res->result;
return null;
}
public function instalarSsl($certificado,$privada) {
$this->csrf();
$res=$this->postJson('hosting/domain/getsslcertinfo',[
'params'=>[
'crt'=>$certificado,
'key'=>$privada
]
]);
if($res->error) return $res->error->data->inputException[0]->errorDesc;
if($res&&!$res->error) {
$dominio=$res->result->domain;
$dominios=$res->result->altDomain;
$this->csrf();
$res=$this->postJson('hosting/domain/installsslcrtkey',[
'params'=>[
'crt'=>$certificado,
'domain'=>$dominio,
'domainAlt'=>$dominios,
'forcedhttps'=>0,
'key'=>$privada
]
]);
if($res&&!$res->error) return true;
}
return null;
}
}