visorchans.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. //visor channels backend
  3. if (ubRouting::get('action') == 'visorchans') {
  4. if ($alterconf['VISOR_ENABLED']) {
  5. if (ubRouting::checkGet(array('param', 'userid'))) {
  6. if ($alterconf['WOLFRECORDER_ENABLED'] or $alterconf['TRASSIRMGR_ENABLED']) {
  7. $chanCall = ubRouting::get('param');
  8. $visor = new UbillingVisor();
  9. $maxQual = (ubRouting::checkGet('fullsize')) ? true : false;
  10. header('Content-Type: application/json');
  11. switch ($chanCall) {
  12. case 'preview':
  13. die($visor->getUserChannelsPreviewJson(ubRouting::get('userid', 'int'), $maxQual));
  14. break;
  15. case 'authdata':
  16. die($visor->getUserDvrAuthData(ubRouting::get('userid', 'int')));
  17. break;
  18. default:
  19. die(json_encode(array()));
  20. break;
  21. }
  22. } else {
  23. //no another NVR supported yet
  24. die(json_encode(array()));
  25. }
  26. } else {
  27. die('ERROR: NO PARAM OR USERID');
  28. }
  29. } else {
  30. die('ERROR: VISOR DISABLED');
  31. }
  32. }