trinitytvcontrol.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. //TrinityTV userstats control options
  3. if ($_GET['action'] == 'trinitytvcontrol') {
  4. if ($alterconf['TRINITYTV_ENABLED']) {
  5. $trinityClass = new TrinityTv();
  6. if (wf_CheckGet(array('param', 'userlogin'))) {
  7. // Subscribe
  8. if (wf_CheckGet(array('tariffid')) and $_GET['param'] == 'subscribe') {
  9. $subResult = $trinityClass->createSubscribtion($_GET['userlogin'], $_GET['tariffid']);
  10. die($subResult);
  11. }
  12. // Unsubscribe
  13. if ($_GET['param'] == 'unsubscribe') {
  14. $subResult = $trinityClass->deleteSubscribtion($_GET['userlogin']);
  15. die($subResult);
  16. }
  17. // Add device MAC
  18. if (wf_CheckGet(array('mac')) and $_GET['param'] == 'adddevice') {
  19. $subResult = $trinityClass->addDevice($_GET['userlogin'], $_GET['mac']);
  20. die($subResult);
  21. }
  22. // Add device by Code
  23. if (wf_CheckGet(array('code')) and $_GET['param'] == 'adddevice') {
  24. $subResult = $trinityClass->addDeviceByCode($_GET['userlogin'], $_GET['code']);
  25. die($subResult);
  26. }
  27. // Delete device by MAC
  28. if (wf_CheckGet(array('mac')) and $_GET['param'] == 'deldevice') {
  29. $subResult = $trinityClass->deleteDevice($_GET['userlogin'], $_GET['mac']);
  30. die($subResult);
  31. }
  32. // Delete device by ID
  33. if (ubRouting::checkGet(array('devid', 'userlogin')) AND ubRouting::get('param') == 'deldeviceid') {
  34. $subResult = $trinityClass->deleteDeviceByIdProtected(ubRouting::get('devid'), ubRouting::get('userlogin'));
  35. die($subResult);
  36. }
  37. }
  38. if (wf_CheckGet(array('param'))) {
  39. if ($_GET['param'] == 'chargefee') {
  40. $trinityClass->subscriptionFeeProcessing();
  41. die('TRINITYTV_CHARGE_DONE');
  42. }
  43. if ($_GET['param'] == 'resurrect') {
  44. $trinityClass->resurrectAllSubscribers();
  45. die('TRINITYTV_RESURRECT_DONE');
  46. }
  47. }
  48. } else {
  49. die('ERROR: TRINITYTV DISABLED');
  50. }
  51. }