Skip to content

Commit

Permalink
formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Jul 2, 2017
1 parent a2f9b4c commit 291584b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function getActivate(GenericEvent $event) {
if ($event['category'] == SERVICE_TYPES_LITESPEED) {
myadmin_log(self::$module, 'info', 'LiteSpeed Activation', __LINE__, __FILE__);
function_requirements('activate_litespeed');
$response = activate_litespeed($serviceClass->get_ip(), $event['field1'], $event['field2']);
$response = activate_litespeed($serviceClass->getIp(), $event['field1'], $event['field2']);
if (isset($response['LiteSpeed_eService']['serial']))
$serviceClass->set_extra($response['LiteSpeed_eService']['serial'])->save();
$event->stopPropagation();
Expand All @@ -46,7 +46,7 @@ public static function getDeactivate(GenericEvent $event) {
if ($event['category'] == SERVICE_TYPES_LITESPEED) {
myadmin_log(self::$module, 'info', 'LiteSpeed Deactivation', __LINE__, __FILE__);
function_requirements('deactivate_litespeed');
deactivate_litespeed($serviceClass->get_ip());
deactivate_litespeed($serviceClass->getIp());
$event->stopPropagation();
}
}
Expand All @@ -56,14 +56,14 @@ public static function getChangeIp(GenericEvent $event) {
$serviceClass = $event->getSubject();
$settings = get_module_settings(self::$module);
$litespeed = new \Detain\LiteSpeed\LiteSpeed(FANTASTICO_USERNAME, FANTASTICO_PASSWORD);
myadmin_log(self::$module, 'info', "IP Change - (OLD:".$serviceClass->get_ip().") (NEW:{$event['newip']})", __LINE__, __FILE__);
$result = $litespeed->editIp($serviceClass->get_ip(), $event['newip']);
myadmin_log(self::$module, 'info', "IP Change - (OLD:".$serviceClass->getIp().") (NEW:{$event['newip']})", __LINE__, __FILE__);
$result = $litespeed->editIp($serviceClass->getIp(), $event['newip']);
if (isset($result['faultcode'])) {
myadmin_log(self::$module, 'error', 'LiteSpeed editIp('.$serviceClass->get_ip().', '.$event['newip'].') returned Fault '.$result['faultcode'].': '.$result['fault'], __LINE__, __FILE__);
myadmin_log(self::$module, 'error', 'LiteSpeed editIp('.$serviceClass->getIp().', '.$event['newip'].') returned Fault '.$result['faultcode'].': '.$result['fault'], __LINE__, __FILE__);
$event['status'] = 'error';
$event['status_text'] = 'Error Code '.$result['faultcode'].': '.$result['fault'];
} else {
$GLOBALS['tf']->history->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->get_ip());
$GLOBALS['tf']->history->add($settings['TABLE'], 'change_ip', $event['newip'], $serviceClass->getIp());
$serviceClass->set_ip($event['newip'])->save();
$event['status'] = 'ok';
$event['status_text'] = 'The IP Address has been changed.';
Expand Down

0 comments on commit 291584b

Please sign in to comment.