Skip to content

Commit

Permalink
field1 handlign fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Jul 2, 2017
1 parent 7f3039a commit 40c3b13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function_requirements('whm_api');
'maxlst' => 0,
'maxsub' => 'unlimited',
);
if ($event['field1'] == 'reseller')
if (in_array('reseller', explode(',', $event['field1'])))
$reseller = TRUE;
else
$reseller = FALSE;
Expand Down Expand Up @@ -306,7 +306,7 @@ function_requirements('whm_api');
$whm->set_user($user);
$whm->set_hash($hash);
//$whm = whm_api('faith.interserver.net');
if (in_array('reseller', $event['field1']))
if (in_array('reseller', explode(',', $event['field1'])))
$response = json_decode($whm->suspendreseller($serviceClass->getUsername(), 'Canceled Service'), true);
else
$response = json_decode($whm->suspendacct($serviceClass->getUsername(), 'Canceled Service'), true);
Expand Down Expand Up @@ -335,7 +335,7 @@ function_requirements('whm_api');
$whm->set_hash($hash);
//$whm = whm_api('faith.interserver.net');
if (trim($serviceClass->getUsername()) != '') {
if (in_array('reseller', $event['field1']))
if (in_array('reseller', explode(',', $event['field1'])))
$response = json_decode($whm->terminatereseller($serviceClass->getUsername(), true));
else
$response = json_decode($whm->removeacct($serviceClass->getUsername(), false));
Expand Down

0 comments on commit 40c3b13

Please sign in to comment.