goose.php 1.2 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. if (ubRouting::get('action') == 'goose') {
  3. if ($alterconf['GOOSE_RESISTANCE']) {
  4. $userLogin = ubRouting::get('username');
  5. if (ubRouting::checkGet('username') or ubRouting::checkGet('paymentid')) {
  6. $userLogin = ubRouting::get('username', 'login');
  7. $userPaymentId = (ubRouting::checkGet('paymentid')) ? ubRouting::get('paymentid') : '';
  8. $incomeAmount = (ubRouting::checkGet('amount')) ? ubRouting::get('amount') : 0;
  9. $explictStratId = (ubRouting::checkGet('stratid')) ? ubRouting::get('stratid') : 0;
  10. $runtime = (ubRouting::checkGet('runtime')) ? ubRouting::get('runtime') : '';
  11. $gr = new GRes();
  12. $gr->setUserLogin($userLogin);
  13. if (!empty($userPaymentId)) {
  14. $gr->setPaymentId($userPaymentId);
  15. }
  16. $gr->setAmount($incomeAmount);
  17. $gr->setRuntime($runtime);
  18. $strategyData = $gr->getStrategyData($explictStratId);
  19. header('Content-Type: application/json');
  20. die(json_encode($strategyData));
  21. } else {
  22. die('ERROR:NO_USERNAME_AND_PAYMENTID_PARAM');
  23. }
  24. } else {
  25. die('ERROR:GOOSE_RESISTANCE_DISABLED');
  26. }
  27. }