Advertisement
Guest User

Untitled

a guest
May 14th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.07 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.0.8.0
  8. * @ Author : DeZender
  9. * @ Release on : 25.09.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Ministra\Lib\q8ebe46aec71cfac58101535cac5d7036;
  15.  
  16. final class b2b3e549f2ab456e466c9de1308ec925
  17. {
  18. public static $server_timezone = null;
  19. private static $just_created = false;
  20. private static $allowed_languages = null;
  21. private static $clock_formats = array(
  22. '12h',
  23. '24h'
  24. );
  25. private static $instance = null;
  26. public $id = 0;
  27. public $mac = '';
  28. public $ip = null;
  29. public $hd = 0;
  30. public $lang = null;
  31. public $city_id = null;
  32. public $openweathermap_city_id = null;
  33. public $timezone = null;
  34. public $timezone_diff = 0;
  35. public $additional_services_on = 0;
  36. private $user_agent = '';
  37. private $access_token = null;
  38. private $is_moderator = null;
  39. private $reseller_id = null;
  40. private $use_ip_ranges = null;
  41. private $params = array( );
  42. private $db = null;
  43. private $locale = null;
  44. private $country_id = null;
  45. private $openweathermap_country_id = null;
  46. private $stb_lang = null;
  47. private $valid_hash_version = false;
  48. private static $allowed_stb_types = array(
  49. 'MAG200',
  50. 'MAG245',
  51. 'MAG245D',
  52. 'MAG250',
  53. 'MAG254',
  54. 'MAG255',
  55. 'MAG256',
  56. 'MAG257',
  57. 'MAG260',
  58. 'MAG270',
  59. 'MAG275',
  60. 'MAG322',
  61. 'MAG322w1',
  62. 'MAG323',
  63. 'MAG324',
  64. 'MAG324C',
  65. 'MAG324w2',
  66. 'MAG325',
  67. 'MAG349',
  68. 'MAG350',
  69. 'MAG351',
  70. 'MAG352',
  71. 'MAG420',
  72. 'MAG420w1',
  73. 'MAG422',
  74. 'MAG422А',
  75. 'MAG422Аw1',
  76. 'MAG424',
  77. 'MAG424w3',
  78. 'MAG424А',
  79. 'MAG424Аw3',
  80. 'MAG425',
  81. 'MAG425А',
  82. 'MAG500A',
  83. 'MAG520',
  84. 'MAG524',
  85. 'AuraHD',
  86. 'AuraHD0',
  87. 'AuraHD1',
  88. 'AuraHD2',
  89. 'AuraHD3',
  90. 'AuraHD4',
  91. 'AuraHD8',
  92. 'AuraHD9',
  93. 'WR320',
  94. 'IM2100',
  95. 'IM2100w1',
  96. 'IM2100V',
  97. 'IM2100VI',
  98. 'IM2101',
  99. 'IM2101V',
  100. 'IM2101VI',
  101. 'IM2101VO',
  102. 'IM2101w2',
  103. 'IM2102',
  104. 'IM4410',
  105. 'IM4410w3',
  106. 'IM4411',
  107. 'IM4411w1',
  108. 'IM4412',
  109. 'IM4414',
  110. 'IM4414w1',
  111. 'IP_STB_HD',
  112. 'IM4410WV',
  113. 'IM4411WV'
  114. );
  115. private static $allowed_stb_types_for_local_recording = array(
  116. 'MAG245',
  117. 'MAG245D',
  118. 'MAG250',
  119. 'MAG254',
  120. 'MAG255',
  121. 'MAG256',
  122. 'MAG257',
  123. 'MAG260',
  124. 'MAG270',
  125. 'MAG275',
  126. 'MAG322',
  127. 'MAG322w1',
  128. 'MAG323',
  129. 'MAG324',
  130. 'MAG324C',
  131. 'MAG324w2',
  132. 'MAG325',
  133. 'MAG349',
  134. 'MAG350',
  135. 'MAG351',
  136. 'MAG352',
  137. 'MAG420',
  138. 'MAG420w1',
  139. 'MAG422',
  140. 'MAG422А',
  141. 'MAG422Аw1',
  142. 'MAG424',
  143. 'MAG424w3',
  144. 'MAG424А',
  145. 'MAG424Аw3',
  146. 'MAG425',
  147. 'MAG425А',
  148. 'MAG500A',
  149. 'MAG520',
  150. 'MAG524',
  151. 'AuraHD',
  152. 'AuraHD0',
  153. 'AuraHD1',
  154. 'AuraHD2',
  155. 'AuraHD3',
  156. 'AuraHD4',
  157. 'AuraHD8',
  158. 'AuraHD9',
  159. 'WR320',
  160. 'IM2100',
  161. 'IM2100w1',
  162. 'IM2100V',
  163. 'IM2100VI',
  164. 'IM2101',
  165. 'IM2101V',
  166. 'IM2101VI',
  167. 'IM2101VO',
  168. 'IM2101w2',
  169. 'IM2102',
  170. 'IM4410',
  171. 'IM4410w3',
  172. 'IM4411',
  173. 'IM4411w1',
  174. 'IM4412',
  175. 'IP_STB_HD',
  176. 'IM4410WV',
  177. 'IM4411WV'
  178. );
  179.  
  180. private function __construct()
  181. {
  182. (new ec9289da96f6793c2624b1d9863b1255( new cb07bd4908d20db2235b3c50e3e899f1\V565cc9924a889af5ba20a68da93dabe5( ) ))->L52cf2594aa696ddcb8fb2604db4de8d2( );
  183. E04f8b147eecdf6106fbb6458de6c5c28\h59ac2ccb1e491bfa8faad9f2a9612686::ca57d665fee5c1beb1bf657cab144726( )->s38dbc10a719b2f857697b3f823c5c9e6( 'Ministra\\Lib\\q8ebe46aec71cfac58101535cac5d7036\\x9f25b57f69b2703fe7272e8dc9f29904\\E9d9c89a9c2dc394e12f1a6f3c83d0349' )->check( '_POST', '_REQUEST', '_COOKIE' );
  184. $H74a6c98e1e2b2677622a9901e92b4dbf = $this->o7f05bd3d3dcff8c54f20946b4e2a4314( );
  185. $this->user_agent = ((empty( $_SERVER['HTTP_USER_AGENT'] ) ? '' : $_SERVER['HTTP_USER_AGENT']));
  186.  
  187. if (!(empty( $_SERVER['HTTP_X_USER_AGENT'] ))) {
  188. $this->user_agent .= '; ' . $_SERVER['HTTP_X_USER_AGENT'];
  189. }
  190.  
  191. $this->u0ae898abb684daf8d851d64dc418dced( );
  192.  
  193. if (!(empty( $H74a6c98e1e2b2677622a9901e92b4dbf )) && $this->u619e578d79c4394d2816c3412893fc5d( $H74a6c98e1e2b2677622a9901e92b4dbf )) {
  194. if (!(empty( $_REQUEST['mac'] ))) {
  195. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Request has mac' );
  196. $this->mac = @htmlspecialchars( trim( urldecode( $_REQUEST['mac'] ) ) );
  197. }
  198. else if (!(empty( $_COOKIE['mac'] ))) {
  199. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Cookie has mac' );
  200. $this->mac = @htmlspecialchars( trim( urldecode( $_COOKIE['mac'] ) ) );
  201. }
  202. else {
  203. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Device identification failed' );
  204. echo 'Identification failed';
  205. exit( );
  206. }
  207.  
  208. if (!(empty( $_COOKIE['debug'] )) || !(empty( $_REQUEST['debug'] ))) {
  209. R382c1b1de4b5f2d6b2e5a0f53cc64edb::$debug = true;
  210. }
  211. }
  212. else if (!(empty( $_COOKIE['mac'] )) && empty( $_COOKIE['mac_emu'] )) {
  213. $this->mac = @htmlspecialchars( trim( urldecode( $_COOKIE['mac'] ) ) );
  214.  
  215. if (!(empty( $_REQUEST['action'] )) && ($_REQUEST['action'] != 'handshake') && ($_REQUEST['action'] != 'get_profile') && ($_REQUEST['action'] != 'get_localization') && ($_REQUEST['action'] != 'do_auth') && !($this->R34d6a03a499410fbe9477af280ed2d66( $this->access_token ))) {
  216. a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'STB authorization failed. MAC: ' . $this->mac . ', token: ' . $this->access_token );
  217. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Failed authorization by mac ' . $this->mac . ', token: ' . $this->access_token );
  218. echo 'Authorization failed.';
  219. exit( );
  220. }
  221.  
  222. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Success authorization by mac' );
  223. }
  224. else {
  225. if ((!(empty( $_SERVER['TARGET'] )) && (($_SERVER['TARGET'] == 'API') || ($_SERVER['TARGET'] == 'ADM'))) || (!(empty( $_REQUEST['type'] )) && ($_REQUEST['type'] == 'stb'))) {
  226. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Empty authorization' );
  227. }
  228. else {
  229. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Missing authorization header' );
  230. $this->mac = '';
  231. echo 'Unauthorized request.';
  232. exit( );
  233. }
  234. }
  235.  
  236. $this->mac = strtoupper( $this->mac );
  237.  
  238. if (!(empty( $_COOKIE['stb_lang'] ))) {
  239. $this->stb_lang = @trim( urldecode( $_COOKIE['stb_lang'] ) );
  240. }
  241.  
  242. if (!(empty( $_COOKIE['timezone'] )) && ($_COOKIE['timezone'] != 'undefined')) {
  243. $this->timezone = @trim( $_COOKIE['timezone'] );
  244. }
  245.  
  246. if (isset( $_SERVER['HTTP_X_REAL_IP'] )) {
  247. $this->ip = @$_SERVER['HTTP_X_REAL_IP'];
  248. }
  249. else {
  250. $this->ip = @$_SERVER['REMOTE_ADDR'];
  251. }
  252.  
  253. $this->db = R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( );
  254.  
  255. try {
  256. $this->C0c13361db1b575d1268833f8a5bb6ae8( );
  257. }
  258. catch (ab244beb3b073af9e5297311461b85aa $k429eb9d3aa0fee58a703847a8c571efb) {
  259. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Error get stb params: ' . $k429eb9d3aa0fee58a703847a8c571efb->getMessage( ) );
  260. echo $k429eb9d3aa0fee58a703847a8c571efb->getMessage( ) . PHP_EOL;
  261. return;
  262. }
  263.  
  264. $s619cb447a6329c100d32368f7fe635b3 = array(
  265. 'handshake',
  266. 'get_profile',
  267. 'get_localization',
  268. 'do_auth',
  269. 'get_events',
  270. 'get_main_info',
  271. 'get_payment_info',
  272. 'get_agreement_info',
  273. 'get_terms_info'
  274. );
  275.  
  276. if (!(empty( $_COOKIE['mac'] )) && (empty( $this->id ) || ($this->params['status'] == 1) || ($this->params['blocked'] == 1)) && !(empty( $_REQUEST['action'] )) && !(in_array( $_REQUEST['action'], $s619cb447a6329c100d32368f7fe635b3 )) && ($_REQUEST['action'] != 'get_modules')) {
  277. a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'Access denied to ' . $_REQUEST['type'] . ':' . $_REQUEST['action'] . ' for MAC: ' . $this->mac );
  278. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Access denied to ' . $_REQUEST['type'] . ':' . $_REQUEST['action'] . ' for MAC: ' . $this->mac );
  279. echo 'Access denied.';
  280. exit( );
  281. }
  282.  
  283. if (empty( $this->id )) {
  284. $this->h564fd0c5767eac040a649d7c4ca5012f( $this->stb_lang );
  285.  
  286. if (!(empty( $_COOKIE['mac'] )) && !(empty( $_REQUEST['action'] )) && !(in_array( $_REQUEST['action'], $s619cb447a6329c100d32368f7fe635b3 ))) {
  287. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'STB not found in the database, authorization failed. MAC: ' . $this->mac . ', token: ' . $this->access_token );
  288. a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'STB not found in the database, authorization failed. MAC: ' . $this->mac . ', token: ' . $this->access_token );
  289. echo 'Authorization failed.';
  290. exit( );
  291. }
  292. }
  293. else if (!(empty( $this->id )) && n5874049a9a642db76cc69dcdf71f763f::getSafe( 'allow_resellers_ip_ranges', false ) && !(empty( $this->reseller_id )) && !(empty( $this->use_ip_ranges )) && !(empty( $this->ip )) && !(\Ministra\Lib\User::getInstance( $this->id )->userCheckIPTimeout( )) && !(empty( $_REQUEST['action'] )) && !(in_array( $_REQUEST['action'], $s619cb447a6329c100d32368f7fe635b3 ))) {
  294. $a8cbeda9150ad2bee79f7954083fd65c = R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( )->where( array( 'id' => $this->reseller_id ) )->get( 'reseller' )->first( 'name' );
  295.  
  296. if (!(headers_sent( ))) {
  297. header( $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403 );
  298. }
  299.  
  300. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'STB ip out of resellers ip-range, authorization failed. IP: ' . $this->ip . ', reseller: ' . $a8cbeda9150ad2bee79f7954083fd65c );
  301. a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'STB ip out of resellers ip-range, authorization failed. IP: ' . $this->ip . ', reseller: ' . $a8cbeda9150ad2bee79f7954083fd65c );
  302. echo _( 'You can not connect to the service in this network.' );
  303. exit( );
  304. }
  305. }
  306.  
  307. private function o7f05bd3d3dcff8c54f20946b4e2a4314()
  308. {
  309. if (!(empty( $_REQUEST['debug_key'] ))) {
  310. return $_REQUEST['debug_key'];
  311. }
  312.  
  313. if (!(empty( $_COOKIE['debug_key'] ))) {
  314. return $_COOKIE['debug_key'];
  315. }
  316. }
  317.  
  318. private function u0ae898abb684daf8d851d64dc418dced()
  319. {
  320. if (function_exists( 'getallheaders' )) {
  321. $O6ec8e14f6f02799f753ead966ab4075f = getallheaders( );
  322. }
  323. else {
  324. $O6ec8e14f6f02799f753ead966ab4075f = $this->x1a767966b8fdc5e520f4599d4c233c8e( );
  325. }
  326.  
  327. if (!($O6ec8e14f6f02799f753ead966ab4075f)) {
  328. return;
  329. }
  330.  
  331. $ca2ccd8585eff3087ff1a4a22a56c936 = ((!(empty( $O6ec8e14f6f02799f753ead966ab4075f['Authorization'] )) ? $O6ec8e14f6f02799f753ead966ab4075f['Authorization'] : null));
  332. if ($ca2ccd8585eff3087ff1a4a22a56c936 && preg_match( '/Bearer\\s+(.*)$/i', $ca2ccd8585eff3087ff1a4a22a56c936, $i5336fea81223e5e72f8f33033a8cf790 )) {
  333. $this->access_token = trim( $i5336fea81223e5e72f8f33033a8cf790[1] );
  334. }
  335. }
  336.  
  337. private function x1a767966b8fdc5e520f4599d4c233c8e()
  338. {
  339. $O6ec8e14f6f02799f753ead966ab4075f = array( );
  340.  
  341. foreach ($_SERVER as $v40a23d66887e08718106c34ac382768f => $c52abdd50c58d406e3248bbb0db3bfd7) {
  342. if (substr( $v40a23d66887e08718106c34ac382768f, 0, 5 ) == 'HTTP_') {
  343. $O6ec8e14f6f02799f753ead966ab4075f[str_replace( ' ', '-', ucwords( strtolower( str_replace( '_', ' ', substr( $v40a23d66887e08718106c34ac382768f, 5 ) ) ) ) )] = $c52abdd50c58d406e3248bbb0db3bfd7;
  344. }
  345. }
  346.  
  347. return $O6ec8e14f6f02799f753ead966ab4075f;
  348. }
  349.  
  350. private function u619e578d79c4394d2816c3412893fc5d($eb0153849adccd049cc2551f5280f59f)
  351. {
  352. return (bool) R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( )->from( 'administrators' )->where( array(
  353. 'debug_key' => $eb0153849adccd049cc2551f5280f59f,
  354. 'login' => 'admin'
  355. ) )->get( )->first( );
  356. }
  357.  
  358. private function R34d6a03a499410fbe9477af280ed2d66($t66ddd405ea81a08c14c8c9848b37710e, $E88bb23e69ae328b4ffd7221b7f758ac3 = NULL)
  359. {
  360. if (empty( $t66ddd405ea81a08c14c8c9848b37710e )) {
  361. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Access token does not valid' );
  362. return false;
  363. }
  364.  
  365. if (!($E88bb23e69ae328b4ffd7221b7f758ac3)) {
  366. $E88bb23e69ae328b4ffd7221b7f758ac3 = $this->mac;
  367. }
  368.  
  369. $r2a3f7616f8ecaa53274f71a01276eb9a = R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( )->from( 'users' )->where( array( 'mac' => $E88bb23e69ae328b4ffd7221b7f758ac3 ) )->get( )->first( );
  370.  
  371. if (empty( $r2a3f7616f8ecaa53274f71a01276eb9a )) {
  372. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Auth user is empty' );
  373. return false;
  374. }
  375.  
  376. a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Successfully set user access token: ' . $r2a3f7616f8ecaa53274f71a01276eb9a['access_token'] );
  377. return $r2a3f7616f8ecaa53274f71a01276eb9a['access_token'] == $t66ddd405ea81a08c14c8c9848b37710e;
  378. }
  379.  
  380. public function C0c13361db1b575d1268833f8a5bb6ae8()
  381. {
  382. if (!(empty( $this->mac ))) {
  383. $r2a3f7616f8ecaa53274f71a01276eb9a = $this->db->from( 'users' )->where( array( 'mac' => $this->mac ) )->get( )->first( );
  384. }
  385. else {
  386. if (\Ministra\Lib\User::isInitialized( ) && \Ministra\Lib\User::getInstance( )->getId( )) {
  387. $r2a3f7616f8ecaa53274f71a01276eb9a = $this->db->from( 'users' )->where( array( 'id' => (int) \Ministra\Lib\User::getInstance( )->getId( ) ) )->get( )->first( );
  388. }
  389. }
  390.  
  391. if (!(empty( $r2a3f7616f8ecaa53274f71a01276eb9a ))) {
  392. $this->params = $r2a3f7616f8ecaa53274f71a01276eb9a;
  393. $this->id = $r2a3f7616f8ecaa53274f71a01276eb9a['id'];
  394. $this->hd = $r2a3f7616f8ecaa53274f71a01276eb9a['hd'];
  395. ..........................................................................
  396. ................................................
  397. ......................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement