Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Ministra\Lib\q8ebe46aec71cfac58101535cac5d7036;
- final class b2b3e549f2ab456e466c9de1308ec925
- {
- public static $server_timezone = null;
- private static $just_created = false;
- private static $allowed_languages = null;
- private static $clock_formats = array(
- '12h',
- '24h'
- );
- private static $instance = null;
- public $id = 0;
- public $mac = '';
- public $ip = null;
- public $hd = 0;
- public $lang = null;
- public $city_id = null;
- public $openweathermap_city_id = null;
- public $timezone = null;
- public $timezone_diff = 0;
- public $additional_services_on = 0;
- private $user_agent = '';
- private $access_token = null;
- private $is_moderator = null;
- private $reseller_id = null;
- private $use_ip_ranges = null;
- private $params = array( );
- private $db = null;
- private $locale = null;
- private $country_id = null;
- private $openweathermap_country_id = null;
- private $stb_lang = null;
- private $valid_hash_version = false;
- private static $allowed_stb_types = array(
- 'MAG200',
- 'MAG245',
- 'MAG245D',
- 'MAG250',
- 'MAG254',
- 'MAG255',
- 'MAG256',
- 'MAG257',
- 'MAG260',
- 'MAG270',
- 'MAG275',
- 'MAG322',
- 'MAG322w1',
- 'MAG323',
- 'MAG324',
- 'MAG324C',
- 'MAG324w2',
- 'MAG325',
- 'MAG349',
- 'MAG350',
- 'MAG351',
- 'MAG352',
- 'MAG420',
- 'MAG420w1',
- 'MAG422',
- 'MAG422А',
- 'MAG422Аw1',
- 'MAG424',
- 'MAG424w3',
- 'MAG424А',
- 'MAG424Аw3',
- 'MAG425',
- 'MAG425А',
- 'MAG500A',
- 'MAG520',
- 'MAG524',
- 'AuraHD',
- 'AuraHD0',
- 'AuraHD1',
- 'AuraHD2',
- 'AuraHD3',
- 'AuraHD4',
- 'AuraHD8',
- 'AuraHD9',
- 'WR320',
- 'IM2100',
- 'IM2100w1',
- 'IM2100V',
- 'IM2100VI',
- 'IM2101',
- 'IM2101V',
- 'IM2101VI',
- 'IM2101VO',
- 'IM2101w2',
- 'IM2102',
- 'IM4410',
- 'IM4410w3',
- 'IM4411',
- 'IM4411w1',
- 'IM4412',
- 'IM4414',
- 'IM4414w1',
- 'IP_STB_HD',
- 'IM4410WV',
- 'IM4411WV'
- );
- private static $allowed_stb_types_for_local_recording = array(
- 'MAG245',
- 'MAG245D',
- 'MAG250',
- 'MAG254',
- 'MAG255',
- 'MAG256',
- 'MAG257',
- 'MAG260',
- 'MAG270',
- 'MAG275',
- 'MAG322',
- 'MAG322w1',
- 'MAG323',
- 'MAG324',
- 'MAG324C',
- 'MAG324w2',
- 'MAG325',
- 'MAG349',
- 'MAG350',
- 'MAG351',
- 'MAG352',
- 'MAG420',
- 'MAG420w1',
- 'MAG422',
- 'MAG422А',
- 'MAG422Аw1',
- 'MAG424',
- 'MAG424w3',
- 'MAG424А',
- 'MAG424Аw3',
- 'MAG425',
- 'MAG425А',
- 'MAG500A',
- 'MAG520',
- 'MAG524',
- 'AuraHD',
- 'AuraHD0',
- 'AuraHD1',
- 'AuraHD2',
- 'AuraHD3',
- 'AuraHD4',
- 'AuraHD8',
- 'AuraHD9',
- 'WR320',
- 'IM2100',
- 'IM2100w1',
- 'IM2100V',
- 'IM2100VI',
- 'IM2101',
- 'IM2101V',
- 'IM2101VI',
- 'IM2101VO',
- 'IM2101w2',
- 'IM2102',
- 'IM4410',
- 'IM4410w3',
- 'IM4411',
- 'IM4411w1',
- 'IM4412',
- 'IP_STB_HD',
- 'IM4410WV',
- 'IM4411WV'
- );
- private function __construct()
- {
- (new ec9289da96f6793c2624b1d9863b1255( new cb07bd4908d20db2235b3c50e3e899f1\V565cc9924a889af5ba20a68da93dabe5( ) ))->L52cf2594aa696ddcb8fb2604db4de8d2( );
- E04f8b147eecdf6106fbb6458de6c5c28\h59ac2ccb1e491bfa8faad9f2a9612686::ca57d665fee5c1beb1bf657cab144726( )->s38dbc10a719b2f857697b3f823c5c9e6( 'Ministra\\Lib\\q8ebe46aec71cfac58101535cac5d7036\\x9f25b57f69b2703fe7272e8dc9f29904\\E9d9c89a9c2dc394e12f1a6f3c83d0349' )->check( '_POST', '_REQUEST', '_COOKIE' );
- $H74a6c98e1e2b2677622a9901e92b4dbf = $this->o7f05bd3d3dcff8c54f20946b4e2a4314( );
- $this->user_agent = ((empty( $_SERVER['HTTP_USER_AGENT'] ) ? '' : $_SERVER['HTTP_USER_AGENT']));
- if (!(empty( $_SERVER['HTTP_X_USER_AGENT'] ))) {
- $this->user_agent .= '; ' . $_SERVER['HTTP_X_USER_AGENT'];
- }
- $this->u0ae898abb684daf8d851d64dc418dced( );
- if (!(empty( $H74a6c98e1e2b2677622a9901e92b4dbf )) && $this->u619e578d79c4394d2816c3412893fc5d( $H74a6c98e1e2b2677622a9901e92b4dbf )) {
- if (!(empty( $_REQUEST['mac'] ))) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Request has mac' );
- $this->mac = @htmlspecialchars( trim( urldecode( $_REQUEST['mac'] ) ) );
- }
- else if (!(empty( $_COOKIE['mac'] ))) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Cookie has mac' );
- $this->mac = @htmlspecialchars( trim( urldecode( $_COOKIE['mac'] ) ) );
- }
- else {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Device identification failed' );
- echo 'Identification failed';
- exit( );
- }
- if (!(empty( $_COOKIE['debug'] )) || !(empty( $_REQUEST['debug'] ))) {
- R382c1b1de4b5f2d6b2e5a0f53cc64edb::$debug = true;
- }
- }
- else if (!(empty( $_COOKIE['mac'] )) && empty( $_COOKIE['mac_emu'] )) {
- $this->mac = @htmlspecialchars( trim( urldecode( $_COOKIE['mac'] ) ) );
- if (!(empty( $_REQUEST['action'] )) && ($_REQUEST['action'] != 'handshake') && ($_REQUEST['action'] != 'get_profile') && ($_REQUEST['action'] != 'get_localization') && ($_REQUEST['action'] != 'do_auth') && !($this->R34d6a03a499410fbe9477af280ed2d66( $this->access_token ))) {
- a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'STB authorization failed. MAC: ' . $this->mac . ', token: ' . $this->access_token );
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Failed authorization by mac ' . $this->mac . ', token: ' . $this->access_token );
- echo 'Authorization failed.';
- exit( );
- }
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Success authorization by mac' );
- }
- else {
- if ((!(empty( $_SERVER['TARGET'] )) && (($_SERVER['TARGET'] == 'API') || ($_SERVER['TARGET'] == 'ADM'))) || (!(empty( $_REQUEST['type'] )) && ($_REQUEST['type'] == 'stb'))) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Empty authorization' );
- }
- else {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Missing authorization header' );
- $this->mac = '';
- echo 'Unauthorized request.';
- exit( );
- }
- }
- $this->mac = strtoupper( $this->mac );
- if (!(empty( $_COOKIE['stb_lang'] ))) {
- $this->stb_lang = @trim( urldecode( $_COOKIE['stb_lang'] ) );
- }
- if (!(empty( $_COOKIE['timezone'] )) && ($_COOKIE['timezone'] != 'undefined')) {
- $this->timezone = @trim( $_COOKIE['timezone'] );
- }
- if (isset( $_SERVER['HTTP_X_REAL_IP'] )) {
- $this->ip = @$_SERVER['HTTP_X_REAL_IP'];
- }
- else {
- $this->ip = @$_SERVER['REMOTE_ADDR'];
- }
- $this->db = R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( );
- try {
- $this->C0c13361db1b575d1268833f8a5bb6ae8( );
- }
- catch (ab244beb3b073af9e5297311461b85aa $k429eb9d3aa0fee58a703847a8c571efb) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Error get stb params: ' . $k429eb9d3aa0fee58a703847a8c571efb->getMessage( ) );
- echo $k429eb9d3aa0fee58a703847a8c571efb->getMessage( ) . PHP_EOL;
- return;
- }
- $s619cb447a6329c100d32368f7fe635b3 = array(
- 'handshake',
- 'get_profile',
- 'get_localization',
- 'do_auth',
- 'get_events',
- 'get_main_info',
- 'get_payment_info',
- 'get_agreement_info',
- 'get_terms_info'
- );
- 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')) {
- a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'Access denied to ' . $_REQUEST['type'] . ':' . $_REQUEST['action'] . ' for MAC: ' . $this->mac );
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Access denied to ' . $_REQUEST['type'] . ':' . $_REQUEST['action'] . ' for MAC: ' . $this->mac );
- echo 'Access denied.';
- exit( );
- }
- if (empty( $this->id )) {
- $this->h564fd0c5767eac040a649d7c4ca5012f( $this->stb_lang );
- if (!(empty( $_COOKIE['mac'] )) && !(empty( $_REQUEST['action'] )) && !(in_array( $_REQUEST['action'], $s619cb447a6329c100d32368f7fe635b3 ))) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'STB not found in the database, authorization failed. MAC: ' . $this->mac . ', token: ' . $this->access_token );
- a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'STB not found in the database, authorization failed. MAC: ' . $this->mac . ', token: ' . $this->access_token );
- echo 'Authorization failed.';
- exit( );
- }
- }
- 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 ))) {
- $a8cbeda9150ad2bee79f7954083fd65c = R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( )->where( array( 'id' => $this->reseller_id ) )->get( 'reseller' )->first( 'name' );
- if (!(headers_sent( ))) {
- header( $_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403 );
- }
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'STB ip out of resellers ip-range, authorization failed. IP: ' . $this->ip . ', reseller: ' . $a8cbeda9150ad2bee79f7954083fd65c );
- a5c410b2391b4e3ca9383c2a61510ea2\u3f319428ecd78550007a3f5139970693::c4f1cb0ebf47f4a6c6bc018f47d7b181( 'STB ip out of resellers ip-range, authorization failed. IP: ' . $this->ip . ', reseller: ' . $a8cbeda9150ad2bee79f7954083fd65c );
- echo _( 'You can not connect to the service in this network.' );
- exit( );
- }
- }
- private function o7f05bd3d3dcff8c54f20946b4e2a4314()
- {
- if (!(empty( $_REQUEST['debug_key'] ))) {
- return $_REQUEST['debug_key'];
- }
- if (!(empty( $_COOKIE['debug_key'] ))) {
- return $_COOKIE['debug_key'];
- }
- }
- private function u0ae898abb684daf8d851d64dc418dced()
- {
- if (function_exists( 'getallheaders' )) {
- $O6ec8e14f6f02799f753ead966ab4075f = getallheaders( );
- }
- else {
- $O6ec8e14f6f02799f753ead966ab4075f = $this->x1a767966b8fdc5e520f4599d4c233c8e( );
- }
- if (!($O6ec8e14f6f02799f753ead966ab4075f)) {
- return;
- }
- $ca2ccd8585eff3087ff1a4a22a56c936 = ((!(empty( $O6ec8e14f6f02799f753ead966ab4075f['Authorization'] )) ? $O6ec8e14f6f02799f753ead966ab4075f['Authorization'] : null));
- if ($ca2ccd8585eff3087ff1a4a22a56c936 && preg_match( '/Bearer\\s+(.*)$/i', $ca2ccd8585eff3087ff1a4a22a56c936, $i5336fea81223e5e72f8f33033a8cf790 )) {
- $this->access_token = trim( $i5336fea81223e5e72f8f33033a8cf790[1] );
- }
- }
- private function x1a767966b8fdc5e520f4599d4c233c8e()
- {
- $O6ec8e14f6f02799f753ead966ab4075f = array( );
- foreach ($_SERVER as $v40a23d66887e08718106c34ac382768f => $c52abdd50c58d406e3248bbb0db3bfd7) {
- if (substr( $v40a23d66887e08718106c34ac382768f, 0, 5 ) == 'HTTP_') {
- $O6ec8e14f6f02799f753ead966ab4075f[str_replace( ' ', '-', ucwords( strtolower( str_replace( '_', ' ', substr( $v40a23d66887e08718106c34ac382768f, 5 ) ) ) ) )] = $c52abdd50c58d406e3248bbb0db3bfd7;
- }
- }
- return $O6ec8e14f6f02799f753ead966ab4075f;
- }
- private function u619e578d79c4394d2816c3412893fc5d($eb0153849adccd049cc2551f5280f59f)
- {
- return (bool) R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( )->from( 'administrators' )->where( array(
- 'debug_key' => $eb0153849adccd049cc2551f5280f59f,
- 'login' => 'admin'
- ) )->get( )->first( );
- }
- private function R34d6a03a499410fbe9477af280ed2d66($t66ddd405ea81a08c14c8c9848b37710e, $E88bb23e69ae328b4ffd7221b7f758ac3 = NULL)
- {
- if (empty( $t66ddd405ea81a08c14c8c9848b37710e )) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Access token does not valid' );
- return false;
- }
- if (!($E88bb23e69ae328b4ffd7221b7f758ac3)) {
- $E88bb23e69ae328b4ffd7221b7f758ac3 = $this->mac;
- }
- $r2a3f7616f8ecaa53274f71a01276eb9a = R382c1b1de4b5f2d6b2e5a0f53cc64edb::getInstance( )->from( 'users' )->where( array( 'mac' => $E88bb23e69ae328b4ffd7221b7f758ac3 ) )->get( )->first( );
- if (empty( $r2a3f7616f8ecaa53274f71a01276eb9a )) {
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Auth user is empty' );
- return false;
- }
- a5c410b2391b4e3ca9383c2a61510ea2\Y4a415b637b86323ac78d83e01a599839::p29a8df665390197d201a9fbdba5fb622( 'Successfully set user access token: ' . $r2a3f7616f8ecaa53274f71a01276eb9a['access_token'] );
- return $r2a3f7616f8ecaa53274f71a01276eb9a['access_token'] == $t66ddd405ea81a08c14c8c9848b37710e;
- }
- public function C0c13361db1b575d1268833f8a5bb6ae8()
- {
- if (!(empty( $this->mac ))) {
- $r2a3f7616f8ecaa53274f71a01276eb9a = $this->db->from( 'users' )->where( array( 'mac' => $this->mac ) )->get( )->first( );
- }
- else {
- if (\Ministra\Lib\User::isInitialized( ) && \Ministra\Lib\User::getInstance( )->getId( )) {
- $r2a3f7616f8ecaa53274f71a01276eb9a = $this->db->from( 'users' )->where( array( 'id' => (int) \Ministra\Lib\User::getInstance( )->getId( ) ) )->get( )->first( );
- }
- }
- if (!(empty( $r2a3f7616f8ecaa53274f71a01276eb9a ))) {
- $this->params = $r2a3f7616f8ecaa53274f71a01276eb9a;
- $this->id = $r2a3f7616f8ecaa53274f71a01276eb9a['id'];
- $this->hd = $r2a3f7616f8ecaa53274f71a01276eb9a['hd'];
- ..........................................................................
- ................................................
- ......................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement