Skip to content

Commit

Permalink
updates to edit ip fixing the fault response as like in the addip fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
detain committed May 25, 2017
1 parent 713b74b commit 03c7e36
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/Fantastico.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,18 @@ public function getIpDetails($ip) {
*/
public function editIp($ip, $newip) {
if (!$this->valid_ip($ip)) {
return array('faultcode' => 1, 'fault ' => 'Invalid IP Address ' . $ip);
}
if (!$this->valid_ip($newip)) {
return array('faultcode' => 2, 'fault ' => 'Invalid IP Address ' . $newip);
$response = ['faultcode' => 1, 'fault' => 'Invalid IP Address ' . $ip];
} elseif (!$this->valid_ip($newip)) {
$response = ['faultcode' => 2, 'fault' => 'Invalid IP Address ' . $newip];
} else {
$this->connect();
$response = $this->soapClient->editIp($this->getHash(), $ip, $newip);
if (isset($response['fault '])) {
$response['fault'] = $response['fault '];
unset($response['fault ']);
}
}
$this->connect();
$response = $this->soapClient->editIp($this->getHash(), $ip, $newip);
$this->cache = array();
$this->cache = [];
return $response;
}

Expand Down

0 comments on commit 03c7e36

Please sign in to comment.