megogo.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. //Megogo userstats control options
  3. if ($_GET['action'] == 'mgcontrol') {
  4. if ($alterconf['MG_ENABLED']) {
  5. if (wf_CheckGet(array('param', 'tariffid', 'userlogin'))) {
  6. if ($_GET['param'] == 'subscribe') {
  7. $mgIface = new MegogoInterface();
  8. $mgSubResult = $mgIface->createSubscribtion($_GET['userlogin'], $_GET['tariffid']);
  9. die($mgSubResult);
  10. }
  11. if ($_GET['param'] == 'unsubscribe') {
  12. $mgIface = new MegogoInterface();
  13. $mgUnsubResult = $mgIface->scheduleUnsubscribe($_GET['userlogin'], $_GET['tariffid']);
  14. die($mgUnsubResult);
  15. }
  16. }
  17. if (wf_CheckGet(array('param', 'userlogin'))) {
  18. if ($_GET['param'] == 'auth') {
  19. $mgApi = new MegogoApi();
  20. $authUrlData = $mgApi->authCode($_GET['userlogin']);
  21. die($authUrlData);
  22. }
  23. }
  24. } else {
  25. die('ERROR: MEGOGO DISABLED');
  26. }
  27. }
  28. //Megogo schedule processing
  29. if ($_GET['action'] == 'mgqueue') {
  30. if ($alterconf['MG_ENABLED']) {
  31. $mgIface = new MegogoInterface();
  32. $mgQueueProcessingResult = $mgIface->scheduleProcessing();
  33. die($mgQueueProcessingResult);
  34. } else {
  35. die('ERROR: MEGOGO DISABLED');
  36. }
  37. }
  38. //Megogo fee processing (daily/monthly)
  39. if ($_GET['action'] == 'mgprocessing') {
  40. if ($alterconf['MG_ENABLED']) {
  41. $mgIface = new MegogoInterface();
  42. $mgFeeProcessingResult = $mgIface->subscriptionFeeProcessing();
  43. die($mgFeeProcessingResult);
  44. } else {
  45. die('ERROR: MEGOGO DISABLED');
  46. }
  47. }
  48. //Megogo free subscriptions cleanup
  49. if ($_GET['action'] == 'mgfreecleanup') {
  50. if ($alterconf['MG_ENABLED']) {
  51. $mgIface = new MegogoInterface();
  52. $mgFreeCleanupResult = $mgIface->subscriptionFreeCleanup();
  53. die($mgFreeCleanupResult);
  54. } else {
  55. die('ERROR: MEGOGO DISABLED');
  56. }
  57. }