Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: srvrorder.php
<?php require_once(APPPATH . 'libraries/cron/octopus/api.php'); $api = new API(); $quantity = ''; $username = ''; $password = ''; foreach($row->CustomFields as $customField) { if($customField->UseAsQuantity == 1) { $quantity = $customField->FieldValue; } if(strpos("username", strtolower($customField->FieldName)) !== FALSE) { $username = $customField->FieldValue; } if (strpos("password", strtolower($customField->FieldName)) !== FALSE) { $password = $customField->FieldValue; } } if($row->ExternalNetworkId == '1') // new user { #$alreadyExists = $api->checkUser($row->username_K4I8, $row->ServerURL); $arrResponse = $api->createUser($username, $quantity, $password, $row->ServerURL); if(isset($arrResponse['status']) && $arrResponse['status'] == '1') { $ifCodeSentToServer = 1; $codeVal = 'New User Created <br />Username: '.$username.'<br />Password: '.$password.'<br />Credits: '.$quantity; }else{ $ifCodeSentToServer = 0; $msgFromServer = $arrResponse['message']; } /* echo '<pre>'; print_r($alreadyExists); echo '</pre>'; if($api->apiError() != '' || false) { $ifCodeSentToServer = 0; $msgFromServer = $api->apiError(); } else { $arrResponse = $api->createUser($row->username_K4I8, $row->quantity_G7V7, $row->pasward_V6I0, $row->ServerURL); echo '<pre>'; print_r($arrResponse); echo '</pre>'; if(isset($arrResponse['success']) && $arrResponse['success'] == '1') { $ifCodeSentToServer = 1; $codeVal = 'New User Created <br />Username: '.$row->username_K4I8.'<br />Password: '.$row->pasward_V6I0.'<br />Credits: '.$row->quantity_G7V7; } else if(isset($arrResponse['success']) && $arrResponse['success'] == '0') { $ifCodeSentToServer = 0; $msgFromServer = $arrResponse['message']; } else { $ifCodeSentToServer = 0; $msgFromServer = 'No response from the server!'; } } */ } else if($row->ExternalNetworkId == '2')// existing user { #$alreadyExists = $api->checkUser($row->username_K4I8, $row->ServerURL); $arrResponse = $api->updateUser($username, $quantity, $row->ServerURL); if(isset($arrResponse['status']) && $arrResponse['status'] == '1') { $ifCodeSentToServer = 1; $codeVal = 'User: '.$username.' refilled by '.$quantity.' Credits'; }else{ $ifCodeSentToServer = 0; $msgFromServer = $arrResponse['message']; } /* if($api->apiError() != '') { $ifCodeSentToServer = 0; $msgFromServer = $api->apiError(); } else { // UPDATE USER $arrResponse = $api->updateUser($row->username_K4I8, $row->quantity_G7V7, $row->ServerURL); if(isset($arrResponse['success']) && $arrResponse['success'] == '1') { $ifCodeSentToServer = 1; $codeVal = 'User: '.$row->username_K4I8.' refilled by '.$row->quantity_G7V7.' Credits'; } else if(isset($arrResponse['success']) && $arrResponse['success'] == '0') { $ifCodeSentToServer = 0; $msgFromServer = $arrResponse['message']; } else { $ifCodeSentToServer = 0; $msgFromServer = 'No response from the server!'; } } */ } ?>