Advertisement
Guest User

Untitled

a guest
Sep 25th, 2019
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.44 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.0.9.0
  8. * @ Author : DeZender
  9. * @ Release on : 08.08.2019
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. require_once '/home/xapicode/iptv_xapicode/wwwdir/_system/config/config.main.php';
  15. require_once '/home/xapicode/iptv_xapicode/wwwdir/_system/class/class.pdo.php';
  16. $DBPASS = decrypt(PASSWORD);
  17. $db = new Db(HOST, DATABASE, USER, $DBPASS);
  18. $line_user = $_REQUEST['username'];
  19. $line_password = $_REQUEST['password'];
  20. $stream_id = (isset($_REQUEST['streamid']) ? $_REQUEST['streamid'] : '');
  21. $remote_ip = $_SERVER['REMOTE_ADDR'];
  22. $user_agent = $_SERVER['HTTP_USER_AGENT'];
  23. $query_string = $_SERVER['QUERY_STRING'];
  24. $set_line_array = [$line_user, $line_password];
  25. $set_line = $db->query('SELECT cms_lines.*, mag_devices.*, COUNT(cms_stream_activity.stream_activity_id) AS connected_streams FROM cms_lines LEFT OUTER JOIN cms_stream_activity ON cms_lines.line_id = cms_stream_activity.stream_activity_line_id AND cms_stream_activity.stream_activity_kill = 0 LEFT JOIN mag_devices ON cms_lines.line_id = mag_devices.line_id WHERE line_user = ? AND line_pass = ?', $set_line_array);
  26.  
  27. if ($set_line[0]['line_user'] != NULL) {
  28. switch ($set_line[0]['line_status']) {
  29. case 0:
  30. $status = 'Active';
  31. break;
  32. case 2:
  33. $status = 'Expired';
  34. break;
  35. case 3:
  36. $status = 'Banned';
  37. break;
  38. }
  39.  
  40. $parse_url = parse_url($_SERVER['HTTP_HOST'] . '' . $_SERVER['REQUEST_URI']);
  41. header('Content-Type: application/json');
  42.  
  43. if (!isset($_REQUEST['action'])) {
  44. $authentication = [
  45. 'user_info' => [
  46. 'username' => $set_line[0]['line_user'],
  47. 'password' => $set_line[0]['line_pass'],
  48. 'message' => '',
  49. 'auth' => 1,
  50. 'status' => $status,
  51. 'exp_date' => $set_line[0]['line_expire_date'],
  52. 'is_trial' => '0',
  53. 'active_cons' => (string) $set_line[0]['connected_streams'],
  54. 'created_at' => '',
  55. 'max_connections' => (string) $set_line[0]['line_connection'],
  56. 'allowed_output_formats' => ['m3u8', 'ts']
  57. ],
  58. 'server_info' => ['url' => $parse_url['host'] ? $parse_url['host'] : 'http://' . $_SERVER['HTTP_HOST'], 'port' => (string) $parse_url['port'] ? (string) $parse_url['port'] : '80', 'https_port' => '25463', 'server_protocol' => 'http', 'rtmp_port' => '25462', 'timezone' => 'Europe/Berlin', 'timestamp_now' => time(), 'time_now' => date('Y-m-d H:i:s')]
  59. ];
  60. echo json_encode($authentication);
  61. }
  62. else if ($_REQUEST['action'] == 'get_live_categories') {
  63. $set_category = $db->query('SELECT * FROM cms_stream_category');
  64. $live_categories = [];
  65.  
  66. foreach ($set_category as $get_category) {
  67. $live_categories[] = ['category_id' => $get_category['stream_category_id'], 'category_name' => $get_category['stream_category_name'], 'parent_id' => 0];
  68. }
  69.  
  70. echo json_encode($live_categories);
  71. }
  72. else if ($_REQUEST['action'] == 'get_vod_categories') {
  73. $movies = [];
  74. $movies['movies'] = [];
  75. $line_bouquets = json_decode($set_line[0]['line_bouquet_id'], true);
  76.  
  77. foreach ($line_bouquets as $bouquet_id) {
  78. $set_bouquet_array = [$bouquet_id];
  79. $set_bouquet = $db->query('SELECT bouquet_movies FROM cms_bouquets WHERE bouquet_id = ?', $set_bouquet_array);
  80.  
  81. if ($set_bouquet[0]['bouquet_movies'] != '') {
  82. $bouquet_movies_decode = json_decode($set_bouquet[0]['bouquet_movies'], true);
  83.  
  84. foreach ($bouquet_movies_decode as $key => $value) {
  85. $bouquets_movie_array[] = $value;
  86. }
  87. }
  88. }
  89.  
  90. if (isset($bouquets_movie_array)) {
  91. foreach ($bouquets_movie_array as $movie_id) {
  92. $set_movie_array = [$movie_id];
  93. $set_movie = $db->query('SELECT * FROM cms_movies WHERE movie_id = ?', $set_movie_array);
  94. $movies['movies'][$set_movie[0]['movie_id']] = $set_movie[0];
  95. }
  96.  
  97. $movie_categorie_array = [];
  98.  
  99. foreach ($movies as $key => $movie_value) {
  100. foreach ($movie_value as $movie_categorie_value) {
  101. $movie_categorie_array[] = $movie_categorie_value['movie_category_id'];
  102. }
  103. }
  104.  
  105. $movie_categories = [];
  106.  
  107. foreach (array_unique($movie_categorie_array) as $key => $movie_categorie_id) {
  108. $set_movie_categorie_array = [$movie_categorie_id];
  109. ..................................................................................
  110. ................................................
  111. ..................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement