mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-21 20:34:57 +09:00
Plesk is finished.
This commit is contained in:
1 parent
1cca181f5c
commit
de240f39be
1 file changed
+46
-47
@@ -575,35 +575,34 @@ class Server_Manager_Plesk extends Server_Manager
|
||||
throw new Server_Exception('Server manager does not support ip changes');
|
||||
}
|
||||
|
||||
// private function _makeRequest($params) {
|
||||
// $headers = array(
|
||||
// 'HTTP_AUTH_LOGIN: ' . $this->_config['username'],
|
||||
// 'HTTP_AUTH_PASSWD: ' . $this->_config['password'],
|
||||
// 'HTTP_PRETTY_PRINT: TRUE',
|
||||
// 'Content-Type: text/xml'
|
||||
// );
|
||||
//
|
||||
// $xml = $this->_arrayToXml($params, new SimpleXMLElement('<packet />'))
|
||||
// ->asXML();
|
||||
// error_log($xml);
|
||||
// $ch = curl_init ();
|
||||
// curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
// curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
// curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
// curl_setopt ($ch, CURLOPT_URL, $this->getLoginUrl());
|
||||
// curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
// curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
|
||||
// curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml);
|
||||
// curl_setopt ($ch, CURLOPT_POST, $xml);
|
||||
//
|
||||
// $result = curl_exec($ch);
|
||||
//
|
||||
// if (curl_errno ($ch)) {
|
||||
// throw new Server_Exception('cURL error: ' . curl_errno ($ch) . ' - ' . curl_error ($ch));
|
||||
// }
|
||||
//
|
||||
// return $this->_parseResponse($result);
|
||||
// }
|
||||
private function _makeRequest($params) {
|
||||
$headers = array(
|
||||
'HTTP_AUTH_LOGIN: ' . $this->_config['username'],
|
||||
'HTTP_AUTH_PASSWD: ' . $this->_config['password'],
|
||||
'HTTP_PRETTY_PRINT: TRUE',
|
||||
'Content-Type: text/xml'
|
||||
);
|
||||
|
||||
$xml = $this->_arrayToXml($params, new SimpleXMLElement('<packet />'))
|
||||
->asXML();
|
||||
error_log($xml);
|
||||
$ch = curl_init ();
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt ($ch, CURLOPT_URL, $this->getLoginUrl());
|
||||
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt ($ch, CURLOPT_POST, 1);
|
||||
curl_setopt ($ch, CURLOPT_POSTFIELDS, '$params');
|
||||
|
||||
$result = curl_exec($ch);
|
||||
|
||||
if (curl_errno ($ch)) {
|
||||
throw new Server_Exception('cURL error: ' . curl_errno ($ch) . ' - ' . curl_error ($ch));
|
||||
}
|
||||
|
||||
return $this->_parseResponse($result);
|
||||
}
|
||||
|
||||
private function _arrayToXml(array $arr, SimpleXMLElement $xml) {
|
||||
$numbers = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
|
||||
@@ -1006,24 +1005,24 @@ class Server_Manager_Plesk extends Server_Manager
|
||||
* @param string $request
|
||||
* @return string
|
||||
*/
|
||||
public function _makeRequest($request)
|
||||
{
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt($curl, CURLOPT_URL, '"$this->_protocol://$this->_host:$this->_port/enterprise/control/agent.php"');
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $this->_getHeaders());
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, '$request');
|
||||
|
||||
$result = curl_exec($curl);
|
||||
|
||||
curl_close($curl);
|
||||
|
||||
return $result;
|
||||
}
|
||||
// public function _makeRequest($request)
|
||||
// {
|
||||
// $curl = curl_init();
|
||||
//
|
||||
// curl_setopt($curl, CURLOPT_URL, '"$this->_protocol://$this->_host:$this->_port/enterprise/control/agent.php"');
|
||||
// curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
// curl_setopt($curl, CURLOPT_POST, true);
|
||||
// curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
// curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
// curl_setopt($curl, CURLOPT_HTTPHEADER, $this->_getHeaders());
|
||||
// curl_setopt($curl, CURLOPT_POSTFIELDS, $this->_makeRequest($request));
|
||||
//
|
||||
// $result = curl_exec($curl);
|
||||
//
|
||||
// curl_close($curl);
|
||||
//
|
||||
// return $result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Retrieve list of headers needed for request
|
||||
|
||||
Reference in new issue
Block a user