omcontrol.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. //OmegaTV userstats control options
  3. if ($_GET['action'] == 'omcontrol') {
  4. if ($alterconf['OMEGATV_ENABLED']) {
  5. $omega = new OmegaTV();
  6. if (wf_CheckGet(array('param', 'tariffid', 'userlogin'))) {
  7. if ($_GET['param'] == 'subscribe') {
  8. $omSubResult = $omega->createSubscription($_GET['userlogin'], $_GET['tariffid']);
  9. die($omSubResult);
  10. }
  11. }
  12. if (wf_CheckGet(array('param', 'tariffid', 'userlogin'))) {
  13. if ($_GET['param'] == 'unsubscribe') {
  14. $omUnsubResult = $omega->deleteSubscription($_GET['userlogin'], $_GET['tariffid']);
  15. die($omUnsubResult);
  16. }
  17. }
  18. if (wf_CheckGet(array('param'))) {
  19. if ($_GET['param'] == 'chargefee') {
  20. $omega->chargeAllUsersFee();
  21. die('OMEGATV_CHARGE_DONE');
  22. }
  23. if ($_GET['param'] == 'resurrect') {
  24. $omega->resurrectAllUsers();
  25. die('OMEGATV_RESURRECT_DONE');
  26. }
  27. }
  28. if (wf_CheckGet(array('param', 'userlogin'))) {
  29. if ($_GET['param'] == 'viewurl') {
  30. die($omega->getWebUrlByLogin($_GET['userlogin']));
  31. }
  32. if ($_GET['param'] == 'getcode') {
  33. die($omega->getDeviceCodeByLogin($_GET['userlogin']));
  34. }
  35. if ($_GET['param'] == 'getdevices') {
  36. die($omega->getUserDevicesData($_GET['userlogin']));
  37. }
  38. if ($_GET['param'] == 'getplaylists') {
  39. die($omega->getUserPlaylistsData($_GET['userlogin']));
  40. }
  41. if ($_GET['param'] == 'deletedev') {
  42. if (wf_CheckGet(array('uniq'))) {
  43. die($omega->deleteUserDevice($_GET['userlogin'], $_GET['uniq']));
  44. }
  45. }
  46. if ($_GET['param'] == 'deletepl') {
  47. if (wf_CheckGet(array('uniq'))) {
  48. die($omega->deleteUserPlaylist($_GET['userlogin'], $_GET['uniq']));
  49. }
  50. }
  51. if ($_GET['param'] == 'assignpl') {
  52. die($omega->assignUserPlaylist($_GET['userlogin']));
  53. }
  54. }
  55. } else {
  56. die('ERROR: OMEGATV_DISABLED');
  57. }
  58. }