index.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. if (cfr('LIVECAMS')) {
  3. //catching keepalive requests
  4. if (ubRouting::checkGet(StreamDog::ROUTE_KEEPALIVE)) {
  5. $streamDog = new StreamDog();
  6. $streamDog->keepAlive(ubRouting::get($streamDog::ROUTE_KEEPALIVE));
  7. die();
  8. }
  9. //or substream keepalive requests
  10. if (ubRouting::checkGet(StreamDog::ROUTE_KEEPSUBALIVE)) {
  11. if (cfr('WALL')) {
  12. if ($ubillingConfig->getAlterParam(LiveCams::OPTION_WALL)) {
  13. $streamDog = new StreamDog();
  14. $streamDog->keepSubAlive(ubRouting::get($streamDog::ROUTE_KEEPSUBALIVE));
  15. die();
  16. }
  17. }
  18. }
  19. $liveCams = new LiveCams();
  20. if (ubRouting::checkGet($liveCams::ROUTE_VIEW)) {
  21. $channelId = ubRouting::get($liveCams::ROUTE_VIEW, 'gigasafe');
  22. $acl = new ACL();
  23. if ($acl->isMyChannel($channelId)) {
  24. $channelName = $liveCams->getCameraComment($channelId);
  25. show_window(__('Live') . ': ' . $channelName, $liveCams->renderLive($channelId));
  26. } else {
  27. show_error(__('Access denied'));
  28. }
  29. } else {
  30. //optional live wall or default list?
  31. if ($ubillingConfig->getAlterParam($liveCams::OPTION_WALL)) {
  32. $titleControls = '';
  33. if (cfr('WALL')) {
  34. if (ubRouting::checkGet($liveCams::ROUTE_DL_PLAYLIST)) {
  35. $liveCams->getLiveCamerasPlayList();
  36. }
  37. $titleControls = $liveCams->getTitleControls();
  38. }
  39. if (ubRouting::checkGet($liveCams::ROUTE_LIVEWALL)) {
  40. if (cfr('WALL')) {
  41. show_window(__('My cameras') . ' ' . $titleControls, $liveCams->renderLiveWall());
  42. } else {
  43. show_error(__('Access denied'));
  44. }
  45. } else {
  46. show_window(__('My cameras') . ' ' . $titleControls, $liveCams->renderList());
  47. }
  48. } else {
  49. //just default live cameras list
  50. show_window(__('My cameras'), $liveCams->renderList());
  51. }
  52. wr_Stats();
  53. }
  54. } else {
  55. show_error(__('Access denied'));
  56. }