Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: srvrorder.php
<?php $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' || $row->ExternalNetworkId == '2') // Create User - Credit { if($password == '') { $msgFromServer = 'Password field is missing'; } if($username == '') { $msgFromServer = 'Username field is missing'; } if($quantity == '') { $msgFromServer = 'Quantity field is missing'; } if(!empty($username) && !empty($quantity) && !empty($password)) { $accountType = $row->ExternalNetworkId == '1' ? '1' : '0'; $apiURL = $row->ServerURL.'CreateUser'; $postData = array( 'APIKEY' => $MY_API_KEY, 'UserName' => $username, 'Quantity' => $quantity, 'UserPassword' => $password, 'AccountType' => $accountType ); /* echo '<pre>'; print_r($postData); echo '</pre>'; echo $apiURL;*/ $data_string = json_encode($postData); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_URL, $apiURL); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $responseData = curl_exec($ch); $responseData = str_replace('"', '', $responseData); curl_close($ch); $arrResponse = explode('|', $responseData); /* echo '<pre>'; print_r($arrResponse); echo '</pre>';*/ if(isset($arrResponse[0])) { if($arrResponse[0] == '0') { //if($arrResponse[1] == "This User isn't registered in our database." || $arrResponse[1] == "This User is already resisted in our database") if(trim($arrResponse[1]) == "This User is already resisted in our database.") { if(serverOrderRefunded($row->LogRequestId) == '0') { $dec_points = refundServerCredits($row->UserId, $row->LogRequestId, addslashes(stripslashes($row->PackageTitle)), $currDtTm, $row->Credits, '0', ''); } $REJECTED = 1; $CODE = $arrResponse[1]; } else { $ifCodeSentToServer = 0; $msgFromServer = $arrResponse[1]; } } else if($arrResponse[0] == '1') { $ifCodeSentToServer = 1; $codeVal = 'User has been created successfully!';//$arrResponse[1]; } } } else { $ifCodeSentToServer = 0; //$msgFromServer = 'Invalid Username or Password or Quantity!'; } } else if($row->ExternalNetworkId == '3') // Transfer Credits { if($username == '') { $msgFromServer = 'Username field is missing'; } if($quantity == '') { $msgFromServer = 'Quantity field is missing'; } if(!empty($username) && !empty($quantity)) { $apiURL = $row->ServerURL.'TransferCredits'; $postData = array( 'APIKEY' => $MY_API_KEY, 'UserName' => $username, 'Quantity' => $quantity ); /* echo '<pre>'; print_r($postData); echo '</pre>'; echo $apiURL;*/ $data_string = json_encode($postData); $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_URL, $apiURL); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $responseData = curl_exec($ch); $responseData = str_replace('"', '', $responseData); curl_close($ch); $arrResponse = explode('|', $responseData); /* echo '<pre>'; print_r($arrResponse); echo '</pre>';*/ if(isset($arrResponse[0])) { if($arrResponse[0] == '0') { //if($arrResponse[1] == "This User isn't registered in our database." || $arrResponse[1] == "This User is already resisted in our database") if(trim($arrResponse[1]) == "This User isn't registered in our database.") { if(serverOrderRefunded($row->LogRequestId) == '0') { $dec_points = refundServerCredits($row->UserId, $row->LogRequestId, addslashes(stripslashes($row->PackageTitle)), $currDtTm, $row->Credits, '0', ''); } $REJECTED = 1; $CODE = $arrResponse[1]; } else { $ifCodeSentToServer = 0; $msgFromServer = $arrResponse[1]; } } else if($arrResponse[0] == '1') { $ifCodeSentToServer = 1; $codeVal = 'Credits have been transferred successfully!';//$arrResponse[1]; } } } else { $ifCodeSentToServer = 0; //$msgFromServer = 'Invalid Username or Quantity!'; } } ?>