From ce30971af19fd07c5516363d8a5336d5f7cd70aa Mon Sep 17 00:00:00 2001 From: Divarion-D Date: Sun, 8 Mar 2026 22:13:35 +0300 Subject: [PATCH] Moved reseler to public/Views/reseler --- .github/agents/security.agent.md | 209 +++- src/bin/nginx/conf/codes/template | 5 + src/domain/User/UserService.php | 2 +- .../bootstrap/reseller_functions.php} | 7 + .../bootstrap/reseller_session.php | 43 + .../legacy/reseller_api_actions.php | 808 ++++++++++++++ .../legacy/reseller_resize_body.php} | 29 +- .../legacy/reseller_table_body.php} | 54 +- .../Controllers/Admin/BaseAdminController.php | 17 +- .../Reseller/ResellerApiController.php | 47 + .../ResellerCreatedChannelsController.php | 5 +- .../Reseller/ResellerDashboardController.php | 82 +- .../ResellerEditProfileController.php | 23 +- .../Reseller/ResellerEnigmaController.php | 29 +- .../Reseller/ResellerEnigmasController.php | 1 + .../Reseller/ResellerEpgViewController.php | 81 +- .../Reseller/ResellerEpisodesController.php | 6 +- .../ResellerLineActivityController.php | 19 +- .../Reseller/ResellerLineController.php | 26 +- .../Reseller/ResellerLinesController.php | 1 + .../ResellerLiveConnectionsController.php | 21 +- .../Reseller/ResellerLoginController.php | 74 ++ .../Reseller/ResellerLogoutController.php | 12 + .../Reseller/ResellerMagController.php | 29 +- .../Reseller/ResellerMagsController.php | 1 + .../Reseller/ResellerMoviesController.php | 5 +- .../Reseller/ResellerPostController.php | 99 ++ .../Reseller/ResellerRadiosController.php | 5 +- .../Reseller/ResellerResizeController.php | 21 + .../Reseller/ResellerSessionController.php | 23 + .../Reseller/ResellerStreamsController.php | 5 +- .../Reseller/ResellerTableController.php | 73 ++ .../Reseller/ResellerTicketController.php | 20 +- .../Reseller/ResellerTicketViewController.php | 26 +- .../Reseller/ResellerTicketsController.php | 9 +- .../Reseller/ResellerUserController.php | 30 +- .../Reseller/ResellerUserLogsController.php | 1 + .../Reseller/ResellerUsersController.php | 1 + src/public/Views/layouts/admin.php | 2 +- src/public/Views/layouts/footer.php | 2 +- .../Views/layouts}/reseller/footer.php | 7 +- .../Views/layouts}/reseller/header.php | 1 + .../Views/layouts}/reseller/modals.php | 0 .../Views/layouts/reseller/post.scripts.php | 191 ++++ .../Views/reseller/created_channels.php | 63 +- src/public/Views/reseller/dashboard.php | 177 +++- src/public/Views/reseller/edit_profile.php | 118 ++- src/public/Views/reseller/enigma.php | 359 ++++++- src/public/Views/reseller/enigmas.php | 99 +- src/public/Views/reseller/epg_view.php | 139 ++- src/public/Views/reseller/episodes.php | 75 +- src/public/Views/reseller/line.php | 352 ++++++- src/public/Views/reseller/line_activity.php | 99 +- src/public/Views/reseller/lines.php | 138 ++- src/public/Views/reseller/lines.scripts.php | 63 ++ .../Views/reseller/live_connections.php | 138 ++- src/public/Views/reseller/login.php | 108 ++ src/public/Views/reseller/mag.php | 369 ++++++- src/public/Views/reseller/mags.php | 99 +- src/public/Views/reseller/movies.php | 65 +- src/public/Views/reseller/radios.php | 65 +- src/public/Views/reseller/streams.php | 65 +- src/public/Views/reseller/ticket.php | 75 +- src/public/Views/reseller/ticket_view.php | 40 +- src/public/Views/reseller/tickets.php | 65 +- src/{ => public/Views}/reseller/topbar.php | 2 +- src/public/Views/reseller/user.php | 197 +++- src/public/Views/reseller/user_logs.php | 85 +- src/public/Views/reseller/users.php | 72 +- src/{reseller/assets => public/assets/admin} | 0 src/public/assets/reseller | 1 + src/public/index.php | 49 +- src/public/routes/reseller.php | 14 + src/reseller/api.php | 997 ------------------ src/reseller/created_channels.php | 73 -- src/reseller/dashboard.php | 226 ---- src/reseller/edit_profile.php | 103 -- src/reseller/enigma.php | 309 ------ src/reseller/enigmas.php | 200 ---- src/reseller/epg_view.php | 212 ---- src/reseller/episodes.php | 119 --- src/reseller/index.php | 5 - src/reseller/line.php | 340 ------ src/reseller/line_activity.php | 170 --- src/reseller/lines.php | 271 ----- src/reseller/live_connections.php | 254 ----- src/reseller/login.php | 144 --- src/reseller/logout.php | 5 - src/reseller/mag.php | 312 ------ src/reseller/mags.php | 200 ---- src/reseller/movies.php | 110 -- src/reseller/post.php | 133 --- src/reseller/radios.php | 78 -- src/reseller/session.php | 49 - src/reseller/streams.php | 105 -- src/reseller/ticket.php | 59 -- src/reseller/ticket_view.php | 61 -- src/reseller/tickets.php | 62 -- src/reseller/user.php | 259 ----- src/reseller/user_logs.php | 101 -- src/reseller/users.php | 85 -- 101 files changed, 5063 insertions(+), 5322 deletions(-) rename src/{reseller/functions.php => infrastructure/bootstrap/reseller_functions.php} (90%) create mode 100644 src/infrastructure/bootstrap/reseller_session.php create mode 100644 src/infrastructure/legacy/reseller_api_actions.php rename src/{reseller/resize.php => infrastructure/legacy/reseller_resize_body.php} (86%) rename src/{reseller/table.php => infrastructure/legacy/reseller_table_body.php} (98%) create mode 100644 src/public/Controllers/Reseller/ResellerApiController.php create mode 100644 src/public/Controllers/Reseller/ResellerLoginController.php create mode 100644 src/public/Controllers/Reseller/ResellerLogoutController.php create mode 100644 src/public/Controllers/Reseller/ResellerPostController.php create mode 100644 src/public/Controllers/Reseller/ResellerResizeController.php create mode 100644 src/public/Controllers/Reseller/ResellerSessionController.php create mode 100644 src/public/Controllers/Reseller/ResellerTableController.php rename src/{ => public/Views/layouts}/reseller/footer.php (99%) rename src/{ => public/Views/layouts}/reseller/header.php (99%) rename src/{ => public/Views/layouts}/reseller/modals.php (100%) create mode 100644 src/public/Views/layouts/reseller/post.scripts.php create mode 100644 src/public/Views/reseller/lines.scripts.php create mode 100644 src/public/Views/reseller/login.php rename src/{ => public/Views}/reseller/topbar.php (96%) rename src/{reseller/assets => public/assets/admin} (100%) create mode 120000 src/public/assets/reseller delete mode 100644 src/reseller/api.php delete mode 100644 src/reseller/created_channels.php delete mode 100644 src/reseller/dashboard.php delete mode 100644 src/reseller/edit_profile.php delete mode 100644 src/reseller/enigma.php delete mode 100644 src/reseller/enigmas.php delete mode 100644 src/reseller/epg_view.php delete mode 100644 src/reseller/episodes.php delete mode 100644 src/reseller/index.php delete mode 100644 src/reseller/line.php delete mode 100644 src/reseller/line_activity.php delete mode 100644 src/reseller/lines.php delete mode 100644 src/reseller/live_connections.php delete mode 100644 src/reseller/login.php delete mode 100644 src/reseller/logout.php delete mode 100644 src/reseller/mag.php delete mode 100644 src/reseller/mags.php delete mode 100644 src/reseller/movies.php delete mode 100644 src/reseller/post.php delete mode 100644 src/reseller/radios.php delete mode 100644 src/reseller/session.php delete mode 100644 src/reseller/streams.php delete mode 100644 src/reseller/ticket.php delete mode 100644 src/reseller/ticket_view.php delete mode 100644 src/reseller/tickets.php delete mode 100644 src/reseller/user.php delete mode 100644 src/reseller/user_logs.php delete mode 100644 src/reseller/users.php diff --git a/.github/agents/security.agent.md b/.github/agents/security.agent.md index f5e8f8a6..2d397135 100644 --- a/.github/agents/security.agent.md +++ b/.github/agents/security.agent.md @@ -1,47 +1,182 @@ -# Security Auditor Agent +# AI Security Auditor Prompt (Hardened Version) ## Role -You are a security engineer performing a defensive code audit. -## Focus -- Input validation -- Injection risks (SQL, command, template, path) -- RCE vectors -- Authentication flaws -- Authorization issues -- Privilege escalation -- Deserialization vulnerabilities -- Unsafe crypto usage -- Race conditions -- Insecure defaults -- Data leakage -- Error handling exposing internals +You are a **senior security engineer performing a defensive code audit**. -## Do NOT -- Comment on architecture unless it directly affects security -- Discuss performance unless it creates a security risk +Your goal is to identify **realistic, exploitable vulnerabilities** in the provided code. -## XC_VM Specific Risks +Focus on **practical attack vectors**, not theoretical speculation. -You MUST additionally evaluate: +--- -- Shell execution safety (escapeshellarg, command injection) -- Unsafe file operations -- Permission handling -- License verification bypass vectors -- Cryptographic signature validation correctness -- Insecure temporary file usage -- Service restart abuse -- Log injection -- Unsafe stream handling -- Remote configuration manipulation risks +# Audit Scope -Assume attackers actively attempt bypassing licensing and gaining root-level execution. +Evaluate the code for: -## Required Output -- Explicitly describe attack scenario -- Identify impact severity (Low/Medium/High/Critical) -- Suggest mitigation strategy -- Identify assumptions the code makes about trust +### Input Handling -Avoid speculation without justification. \ No newline at end of file +* Missing validation +* Improper sanitization +* Unsafe parsing +* Trusting client-controlled input + +### Injection Risks + +* SQL injection +* Command injection +* Template injection +* Path traversal +* LDAP injection +* Environment variable injection + +### Code Execution Risks + +* Remote Code Execution (RCE) +* Unsafe shell execution +* Dangerous use of `eval`, `exec`, `system`, `shell_exec`, `popen`, `proc_open` +* Dynamic code loading + +### Authentication + +* Broken authentication logic +* Session handling flaws +* Token validation weaknesses +* Replay attacks + +### Authorization + +* Broken access control +* Privilege escalation +* IDOR (Insecure Direct Object References) + +### Data Security + +* Sensitive data exposure +* Unsafe logging +* Debug output leaks +* Secrets stored in code + +### Cryptography + +* Weak algorithms +* Improper signature verification +* Broken nonce usage +* Insecure randomness + +### File Operations + +* Arbitrary file read/write +* Directory traversal +* Unsafe temporary files +* Unrestricted uploads + +### Concurrency + +* Race conditions +* TOCTOU vulnerabilities + +### Configuration Security + +* Insecure defaults +* Debug mode exposure +* Weak permissions + +--- + +# Analysis Rules + +You MUST: + +* Reference **exact code patterns or lines** when describing vulnerabilities. +* Explain **how the vulnerability can realistically be exploited**. +* Distinguish between **theoretical risk and practical exploitability**. +* Identify **trust boundaries** (user input, admin input, network input, system input). +* Evaluate whether security mechanisms can be **bypassed through logic manipulation**. +* Assume attackers actively attempt **privilege escalation and remote code execution**. + +Avoid speculation. +If evidence is insufficient, explicitly state that. + +--- + +# What NOT to Do + +Do NOT: + +* Comment on performance unless it creates a **security vulnerability**. +* Discuss architecture **unless it directly enables a vulnerability**. +* Provide generic advice without linking it to the code. + +--- + +# Required Output Format + +Report **each vulnerability separately** using this structure: + +``` +Issue +Short description of the vulnerability. + +Severity +Critical / High / Medium / Low + +Affected Code +Relevant code snippet or pattern. + +Attack Scenario +Step-by-step explanation of how an attacker exploits the issue. + +Exploit Example +Example payload, request, or input. + +Impact +What the attacker gains (RCE, privilege escalation, data leak, etc). + +Assumptions About Trust +What the code assumes about input or environment. + +Mitigation +Concrete fix or secure alternative. +``` + +--- + +# Evidence Requirement + +Only report vulnerabilities when **supported by code evidence**. + +If something appears risky but cannot be confirmed: + +``` +Potential Risk +Explain why it may be dangerous but lacks confirmation. +``` + +--- + +# Attacker Model + +Assume the attacker can: + +* Send arbitrary HTTP requests +* Manipulate headers and cookies +* Upload files +* Control API inputs +* Attempt authentication bypass +* Abuse misconfigured permissions + +Assume the attacker **cannot initially access the server shell**, but will attempt to gain it. + +--- + +# End Goal + +Identify vulnerabilities that could realistically lead to: + +* Remote Code Execution +* Privilege escalation +* Authentication bypass +* Arbitrary file access +* Data exfiltration +* System compromise \ No newline at end of file diff --git a/src/bin/nginx/conf/codes/template b/src/bin/nginx/conf/codes/template index 3c3bd7c0..b4980ce9 100644 --- a/src/bin/nginx/conf/codes/template +++ b/src/bin/nginx/conf/codes/template @@ -18,8 +18,13 @@ # - Статика (.css, .js, изображения) отдаётся напрямую (try_files $uri) # - Существующие .php файлы обрабатываются напрямую (location ~ \.php$) # - Несуществующие URL → Front Controller → Router → legacy fallback +# - Assets: /#CODE#/assets/* → /home/xc_vm/public/assets/* (shared admin/reseller/player) # ────────────────────────────────────────────────────────────────── +location ^~ /#CODE#/assets/ { + alias /home/xc_vm/public/assets/#TYPE#/; +} + location ^~ /#CODE# { alias /home/xc_vm/#TYPE#; index index.php index.html index.htm; diff --git a/src/domain/User/UserService.php b/src/domain/User/UserService.php index 620c3892..7dc2b834 100644 --- a/src/domain/User/UserService.php +++ b/src/domain/User/UserService.php @@ -117,7 +117,7 @@ class UserService { $rArray['username'] = generateString(10); } - if (!checkExists('users', 'username', $rArray['username'], 'id', $rData['edit'])) { + if (!checkExists('users', 'username', $rArray['username'], 'id', $rData['edit'] ?? null)) { if (strlen($rData['password']) > 0) { $rArray['password'] = cryptPassword($rData['password']); } diff --git a/src/reseller/functions.php b/src/infrastructure/bootstrap/reseller_functions.php similarity index 90% rename from src/reseller/functions.php rename to src/infrastructure/bootstrap/reseller_functions.php index b0b3a4c4..ee40b684 100644 --- a/src/reseller/functions.php +++ b/src/infrastructure/bootstrap/reseller_functions.php @@ -1,4 +1,11 @@ 0, 'online_users' => 0, 'active_accounts' => 0, 'credits' => 0, 'credits_assigned' => 0); + + if (SettingsManager::getAll()['redis_handler']) { + $rReports = array(); + $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + + foreach ($db->get_rows() as $rRow) { + $rReports[] = $rRow['id']; + } + + if (0 < count($rReports)) { + foreach (ConnectionTracker::getUserConnections($rReports, true) as $rUserID => $rConnections) { + $rReturn['open_connections'] += $rConnections; + if (0 < $rConnections) { + $rReturn['online_users']++; + } + } + } + } else { + $db->query('SELECT COUNT(`activity_id`) AS `count` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rReturn['open_connections'] = ($db->get_row()['count'] ?: 0); + $db->query('SELECT `activity_id` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') GROUP BY `lines_live`.`user_id`;'); + $rReturn['online_users'] = $db->num_rows(); + } + + $db->query('SELECT COUNT(`id`) AS `count` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rReturn['active_accounts'] = ($db->get_row()['count'] ?: 0); + $db->query('SELECT SUM(`credits`) AS `credits` FROM `users` WHERE `id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rReturn['credits'] = ($db->get_row()['credits'] ?: 0); + $rReturn['credits_assigned'] = ($rReturn['credits'] - intval($rUserInfo['credits']) ?: 0); + echo json_encode($rReturn); + exit(); +} + +if ($action == 'connections') { + if ($rPermissions['reseller_client_connection_logs']) { + $rStreamID = RequestManager::getAll()['stream_id']; + $rSub = RequestManager::getAll()['sub']; + + if ($rSub == 'purge') { + if (SettingsManager::getAll()['redis_handler']) { + $rReports = array(); + $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + foreach ($db->get_rows() as $rRow) { + $rReports[] = $rRow['id']; + } + $rConnections = ConnectionTracker::getRedisConnections(null, null, $rStreamID, true, false, false, false); + foreach ($rConnections as $rConnection) { + if (in_array($rConnection['user_id'], $rReports)) { + ConnectionTracker::closeConnection($rConnection); + } + } + } else { + $db->query('SELECT `lines_live`.* FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `lines_live`.`stream_id` = ? AND `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');', $rStreamID); + foreach ($db->get_rows() as $rRow) { + ConnectionTracker::closeConnection($rRow); + } + } + echo json_encode(array('result' => true)); + exit(); + } + + echo json_encode(array('result' => false)); + exit(); + } + exit(); +} + +if ($action == 'line') { + if ($rPermissions['create_line']) { + $rSub = RequestManager::getAll()['sub']; + $rUserID = intval(RequestManager::getAll()['user_id']); + $rLine = UserRepository::getLineById($rUserID); + + if (Authorization::check('line', $rUserID) && $rLine) { + if ($rSub == 'delete') { + deleteLine($rUserID); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rLine)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'enable') { + $db->query('UPDATE `lines` SET `enabled` = 1 WHERE `id` = ?;', $rUserID); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rLine)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'disable') { + $db->query('UPDATE `lines` SET `enabled` = 0 WHERE `id` = ?;', $rUserID); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rLine)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'reset_isp') { + $db->query("UPDATE `lines` SET `isp_desc` = '', `as_number` = NULL WHERE `id` = ?;", $rUserID); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'kill_line') { + if ($rPermissions['reseller_client_connection_logs']) { + if (SettingsManager::getAll()['redis_handler']) { + foreach (ConnectionTracker::getUserConnections(array($rUserID), false)[$rUserID] as $rConnection) { + ConnectionTracker::closeConnection($rConnection); + } + } else { + $db->query('SELECT * FROM `lines_live` WHERE `user_id` = ?;', $rUserID); + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rRow) { + ConnectionTracker::closeConnection($rRow); + } + } + } + echo json_encode(array('result' => true)); + exit(); + } + exit(); + } + + echo json_encode(array('result' => false)); + exit(); + } + + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + exit(); +} + +if ($action == 'line_activity') { + if ($rPermissions['reseller_client_connection_logs']) { + $rSub = RequestManager::getAll()['sub']; + + if ($rSub == 'kill') { + if (SettingsManager::getAll()['redis_handler']) { + $rActivityInfo = igbinary_unserialize(RedisManager::instance()->get(RequestManager::getAll()['uuid'])); + if ($rActivityInfo) { + if (Authorization::check('line', $rActivityInfo['user_id'])) { + ConnectionTracker::closeConnection($rActivityInfo); + echo json_encode(array('result' => true)); + exit(); + } + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + } else { + $db->query('SELECT * FROM `lines_live` WHERE `uuid` = ? LIMIT 1;', RequestManager::getAll()['uuid']); + if ($db->num_rows() == 1) { + $rRow = $db->get_row(); + if (Authorization::check('line', $rRow['user_id'])) { + ConnectionTracker::closeConnection($rRow); + echo json_encode(array('result' => true)); + exit(); + } + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + } + } + + echo json_encode(array('result' => false)); + exit(); + } + exit(); +} + +if ($action == 'adjust_credits') { + if ($rPermissions['create_sub_resellers']) { + if (Authorization::check('user', RequestManager::getAll()['id'])) { + $rUser = UserRepository::getRegisteredUserById(RequestManager::getAll()['id']); + + if ($rUser && is_numeric(RequestManager::getAll()['credits'])) { + $rOwnerCredits = intval($rUserInfo['credits']) - intval(RequestManager::getAll()['credits']); + $rCredits = intval($rUser['credits']) + intval(RequestManager::getAll()['credits']); + + if (0 <= $rCredits && 0 <= $rOwnerCredits) { + $db->query('UPDATE `users` SET `credits` = ? WHERE `id` = ?;', $rOwnerCredits, $rUserInfo['id']); + $db->query('UPDATE `users` SET `credits` = ? WHERE `id` = ?;', $rCredits, $rUser['id']); + $db->query('INSERT INTO `users_credits_logs`(`target_id`, `admin_id`, `amount`, `date`, `reason`) VALUES(?, ?, ?, ?, ?);', $rUser['id'], $rUserInfo['id'], RequestManager::getAll()['credits'], time(), RequestManager::getAll()['reason']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'adjust_credits', RequestManager::getAll()['id'], intval(RequestManager::getAll()['credits']), $rOwnerCredits, time(), json_encode($rUser)); + echo json_encode(array('result' => true)); + exit(); + } + } + + echo json_encode(array('result' => false)); + exit(); + } + + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + exit(); +} + +if ($action == 'reg_user') { + if ($rPermissions['create_sub_resellers']) { + if (Authorization::check('user', RequestManager::getAll()['user_id'])) { + $rSub = RequestManager::getAll()['sub']; + $rUser = UserRepository::getRegisteredUserById(RequestManager::getAll()['user_id']); + + if ($rSub == 'delete') { + if ($rPermissions['delete_users']) { + $rOwnerCredits = intval($rUserInfo['credits']) + intval($rUser['credits']); + $db->query('UPDATE `users` SET `credits` = ? WHERE `id` = ?;', $rOwnerCredits, $rUserInfo['id']); + deleteUser(RequestManager::getAll()['user_id'], false, false, $rUserInfo['id']); + $db->query('INSERT INTO `users_credits_logs`(`target_id`, `admin_id`, `amount`, `date`, `reason`) VALUES(?, ?, ?, ?, ?);', $rUserInfo['id'], $rUserInfo['id'], intval($rUser['credits']), time(), 'Deleted user: ' . $rUser['username']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['user_id'], intval($rUser['credits']), $rOwnerCredits, time(), json_encode($rUser)); + echo json_encode(array('result' => true)); + exit(); + } + exit(); + } + + if ($rSub == 'enable') { + $db->query('UPDATE `users` SET `status` = 1 WHERE `id` = ?;', RequestManager::getAll()['user_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rUser)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'disable') { + $db->query('UPDATE `users` SET `status` = 0 WHERE `id` = ?;', RequestManager::getAll()['user_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rUser)); + echo json_encode(array('result' => true)); + exit(); + } + + echo json_encode(array('result' => false)); + exit(); + } + + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + exit(); +} + +if ($action == 'ticket') { + $rTicket = getTicket(RequestManager::getAll()['ticket_id']); + + if ($rTicket) { + if (Authorization::check('user', $rTicket['member_id'])) { + $rSub = RequestManager::getAll()['sub']; + + if ($rSub == 'close') { + $db->query('UPDATE `tickets` SET `status` = 0 WHERE `id` = ?;', RequestManager::getAll()['ticket_id']); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'reopen') { + if ($rTicket['member_id'] != $rUserInfo['id']) { + $db->query('UPDATE `tickets` SET `status` = 1 WHERE `id` = ?;', RequestManager::getAll()['ticket_id']); + echo json_encode(array('result' => true)); + exit(); + } + exit(); + } + } else { + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + } + + echo json_encode(array('result' => false)); + exit(); +} + +if ($action == 'mag') { + if ($rPermissions['create_mag']) { + $rSub = RequestManager::getAll()['sub']; + $rMagDetails = getMag(intval(RequestManager::getAll()['mag_id'])); + + if ($rMagDetails) { + if (Authorization::check('line', $rMagDetails['user_id'])) { + if ($rSub == 'delete') { + deleteMAG(RequestManager::getAll()['mag_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'enable') { + $db->query('UPDATE `lines` SET `enabled` = 1 WHERE `id` = ?;', $rMagDetails['user_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'disable') { + $db->query('UPDATE `lines` SET `enabled` = 0 WHERE `id` = ?;', $rMagDetails['user_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'convert') { + deleteMAG(RequestManager::getAll()['mag_id'], false, false, true); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'convert', $rMagDetails['user']['id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails['user'])); + echo json_encode(array('result' => true, 'line_id' => $rMagDetails['user']['id'])); + exit(); + } + + if ($rSub == 'reset_isp') { + $db->query("UPDATE `lines` SET `isp_desc` = '', `as_number` = NULL WHERE `id` = ?;", $rMagDetails['user']['id']); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'kill_line') { + if ($rPermissions['reseller_client_connection_logs']) { + if (SettingsManager::getAll()['redis_handler']) { + foreach (ConnectionTracker::getUserConnections(array($rMagDetails['user_id']), false)[$rMagDetails['user_id']] as $rConnection) { + ConnectionTracker::closeConnection($rConnection); + } + } else { + $db->query('SELECT * FROM `lines_live` WHERE `user_id` = ?;', $rMagDetails['user_id']); + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rRow) { + ConnectionTracker::closeConnection($rRow); + } + } + } + echo json_encode(array('result' => true)); + exit(); + } + exit(); + } + } else { + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + } + + echo json_encode(array('result' => false)); + exit(); + } + exit(); +} + +if ($action == 'enigma') { + if ($rPermissions['create_enigma']) { + $rSub = RequestManager::getAll()['sub']; + $rE2Details = getEnigma(intval(RequestManager::getAll()['e2_id'])); + + if ($rE2Details) { + if (Authorization::check('line', $rE2Details['user_id'])) { + if ($rSub == 'delete') { + deleteEnigma(RequestManager::getAll()['e2_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'enigma', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['e2_id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'enable') { + $db->query('UPDATE `lines` SET `enabled` = 1 WHERE `id` = ?;', $rE2Details['user_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'enigma', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['e2_id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'disable') { + $db->query('UPDATE `lines` SET `enabled` = 0 WHERE `id` = ?;', $rE2Details['user_id']); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'enigma', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['e2_id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details)); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'convert') { + deleteEnigma(RequestManager::getAll()['e2_id'], false, false, true); + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'convert', $rE2Details['user']['id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details['user'])); + echo json_encode(array('result' => true, 'line_id' => $rE2Details['user']['id'])); + exit(); + } + + if ($rSub == 'reset_isp') { + $db->query("UPDATE `lines` SET `isp_desc` = '', `as_number` = NULL WHERE `id` = ?;", $rE2Details['user']['id']); + echo json_encode(array('result' => true)); + exit(); + } + + if ($rSub == 'kill_line') { + if ($rPermissions['reseller_client_connection_logs']) { + if (SettingsManager::getAll()['redis_handler']) { + foreach (ConnectionTracker::getUserConnections(array($rE2Details['user_id']), false)[$rE2Details['user_id']] as $rConnection) { + ConnectionTracker::closeConnection($rConnection); + } + } else { + $db->query('SELECT * FROM `lines_live` WHERE `user_id` = ?;', $rE2Details['user_id']); + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rRow) { + ConnectionTracker::closeConnection($rRow); + } + } + } + echo json_encode(array('result' => true)); + exit(); + } + exit(); + } + } else { + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + } + + echo json_encode(array('result' => false)); + exit(); + } + exit(); +} + +if ($action == 'get_package') { + $rReturn = array(); + $rOverride = json_decode($rUserInfo['override_packages'], true); + $db->query('SELECT `id`, `bouquets`, `official_credits` AS `cost_credits`, `official_duration`, `official_duration_in`, `max_connections`, `check_compatible`, `is_isplock` FROM `users_packages` WHERE `id` = ?;', RequestManager::getAll()['package_id']); + + if ($db->num_rows() == 1) { + $rData = $db->get_row(); + + if (isset($rOverride[$rData['id']]['official_credits']) && 0 < strlen($rOverride[$rData['id']]['official_credits'])) { + $rData['cost_credits'] = $rOverride[$rData['id']]['official_credits']; + } + + if (isset(RequestManager::getAll()['orig_id']) && $rData['check_compatible']) { + $rData['compatible'] = checkCompatible(RequestManager::getAll()['package_id'], RequestManager::getAll()['orig_id']); + } else { + $rData['compatible'] = true; + } + + $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['official_duration']) . ' ' . $rData['official_duration_in'])); + + if (isset(RequestManager::getAll()['user_id']) && $rData['compatible']) { + $rUser = UserRepository::getLineById(RequestManager::getAll()['user_id']); + if ($rUser) { + if (time() < $rUser['exp_date']) { + $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['official_duration']) . ' ' . $rData['official_duration_in'], $rUser['exp_date'])); + } else { + $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['official_duration']) . ' ' . $rData['official_duration_in'])); + } + } + } + + foreach (json_decode($rData['bouquets'], true) as $rBouquet) { + $db->query('SELECT * FROM `bouquets` WHERE `id` = ?;', $rBouquet); + if ($db->num_rows() == 1) { + $rRow = $db->get_row(); + $rReturn[] = array('id' => $rRow['id'], 'bouquet_name' => str_replace("'", "\\'", $rRow['bouquet_name']), 'bouquet_channels' => json_decode($rRow['bouquet_channels'], true), 'bouquet_radios' => json_decode($rRow['bouquet_radios'], true), 'bouquet_movies' => json_decode($rRow['bouquet_movies'], true), 'bouquet_series' => json_decode($rRow['bouquet_series'], true)); + } + } + $rData['duration'] = $rData['official_duration'] . ' ' . $rData['official_duration_in']; + echo json_encode(array('result' => true, 'bouquets' => $rReturn, 'data' => $rData)); + } else { + echo json_encode(array('result' => false)); + } + exit(); +} + +if ($action == 'get_package_trial') { + $rReturn = array(); + $db->query('SELECT `bouquets`, `trial_credits` AS `cost_credits`, `trial_duration`, `trial_duration_in`, `max_connections`, `is_isplock` FROM `users_packages` WHERE `id` = ?;', RequestManager::getAll()['package_id']); + + if ($db->num_rows() == 1) { + $rData = $db->get_row(); + $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['trial_duration']) . ' ' . $rData['trial_duration_in'])); + + foreach (json_decode($rData['bouquets'], true) as $rBouquet) { + $db->query('SELECT * FROM `bouquets` WHERE `id` = ?;', $rBouquet); + if ($db->num_rows() == 1) { + $rRow = $db->get_row(); + $rReturn[] = array('id' => $rRow['id'], 'bouquet_name' => str_replace("'", "\\'", $rRow['bouquet_name']), 'bouquet_channels' => json_decode($rRow['bouquet_channels'], true), 'bouquet_radios' => json_decode($rRow['bouquet_radios'], true), 'bouquet_movies' => json_decode($rRow['bouquet_movies'], true), 'bouquet_series' => json_decode($rRow['bouquet_series'], true)); + } + } + $rData['duration'] = $rData['trial_duration'] . ' ' . $rData['trial_duration_in']; + $rData['compatible'] = true; + echo json_encode(array('result' => true, 'bouquets' => $rReturn, 'data' => $rData)); + } else { + echo json_encode(array('result' => false)); + } + exit(); +} + +if ($action == 'header_stats') { + $rReturn = array('total_connections' => 0, 'total_users' => 0); + + if (SettingsManager::getAll()['redis_handler']) { + $rReports = array(); + $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + foreach ($db->get_rows() as $rRow) { + $rReports[] = $rRow['id']; + } + if (0 < count($rReports)) { + foreach (ConnectionTracker::getUserConnections($rReports, true) as $rUserID => $rConnections) { + $rReturn['total_connections'] += $rConnections; + if (0 < $rConnections) { + $rReturn['total_users']++; + } + } + } + } else { + $db->query('SELECT COUNT(`activity_id`) AS `count` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rReturn['total_connections'] = ($db->get_row()['count'] ?: 0); + $db->query('SELECT `activity_id` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') GROUP BY `lines_live`.`user_id`;'); + $rReturn['total_users'] = $db->num_rows(); + } + + echo json_encode($rReturn, JSON_PARTIAL_OUTPUT_ON_ERROR); + exit(); +} + +if ($action == 'stats') { + $rReturn = array('open_connections' => 0, 'online_users' => 0, 'total_lines' => 0, 'total_users' => 0, 'owner_credits' => 0, 'user_credits' => 0, 'total_credits' => 0); + + if (SettingsManager::getAll()['redis_handler']) { + $rReports = array(); + $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + foreach ($db->get_rows() as $rRow) { + $rReports[] = $rRow['id']; + } + if (0 < count($rReports)) { + foreach (ConnectionTracker::getUserConnections($rReports, true) as $rUserID => $rConnections) { + $rReturn['open_connections'] += $rConnections; + if (0 < $rConnections) { + $rReturn['online_users']++; + } + } + } + } else { + $db->query('SELECT COUNT(`activity_id`) AS `count` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rReturn['open_connections'] = ($db->get_row()['count'] ?: 0); + $db->query('SELECT `activity_id` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') GROUP BY `lines_live`.`user_id`;'); + $rReturn['online_users'] = $db->num_rows(); + } + + $db->query('SELECT COUNT(*) AS `count` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rReturn['total_lines'] = $db->get_row()['count']; + $db->query('SELECT COUNT(*) AS `count`, SUM(`credits`) AS `credits` FROM `users` WHERE `owner_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); + $rRow = $db->get_row(); + $rReturn['total_users'] = $rRow['count']; + $rReturn['user_credits'] = $rRow['credits']; + $rReturn['owner_credits'] = $rUserInfo['credits']; + $rReturn['total_credits'] = $rReturn['owner_credits'] + $rReturn['user_credits']; + echo json_encode($rReturn); + exit(); +} + +if ($action == 'userlist') { + $rReturn = array('total_count' => 0, 'items' => array(), 'result' => true); + + if (isset(RequestManager::getAll()['search'])) { + $rPage = isset(RequestManager::getAll()['page']) ? intval(RequestManager::getAll()['page']) : 1; + + $db->query('SELECT COUNT(`id`) AS `id` FROM `lines` LEFT JOIN `mag_devices` ON `mag_devices`.`user_id` = `lines`.`id` LEFT JOIN `enigma2_devices` ON `enigma2_devices`.`user_id` = `lines`.`id` WHERE `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') AND (`lines`.`username` LIKE ? OR `mag_devices`.`mac` LIKE ? OR `enigma2_devices`.`mac` LIKE ?);', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%'); + $rReturn['total_count'] = $db->get_row()['id']; + $db->query('SELECT `id`, IF(`lines`.`is_mag`, `mag_devices`.`mac`, IF(`lines`.`is_e2`, `enigma2_devices`.`mac`, `lines`.`username`)) AS `username` FROM `lines` LEFT JOIN `mag_devices` ON `mag_devices`.`user_id` = `lines`.`id` LEFT JOIN `enigma2_devices` ON `enigma2_devices`.`user_id` = `lines`.`id` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ') AND (`lines`.`username` LIKE ? OR `mag_devices`.`mac` LIKE ? OR `enigma2_devices`.`mac` LIKE ?) ORDER BY `username` ASC LIMIT ' . ($rPage - 1) * 100 . ', 100;', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%'); + + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rRow) { + $rReturn['items'][] = array('id' => $rRow['id'], 'text' => $rRow['username']); + } + } + } + + echo json_encode($rReturn); + exit(); +} + +if ($action == 'send_event') { + if ($rPermissions['create_mag']) { + $rData = json_decode(RequestManager::getAll()['data'], true); + $rMag = getMag($rData['id']); + + if ($rMag) { + if (Authorization::check('line', $rMag['user_id'])) { + if ($rData['type'] == 'send_msg') { + $rData['need_confirm'] = 1; + } else if ($rData['type'] == 'play_channel') { + $rData['need_confirm'] = 0; + $rData['reboot_portal'] = 0; + $rData['message'] = intval($rData['channel']); + } else if ($rData['type'] == 'reset_stb_lock') { + resetSTB($rData['id']); + echo json_encode(array('result' => true)); + exit(); + } else { + $rData['need_confirm'] = 0; + $rData['reboot_portal'] = 0; + $rData['message'] = ''; + } + + if ($db->query('INSERT INTO `mag_events`(`status`, `mag_device_id`, `event`, `need_confirm`, `msg`, `reboot_after_ok`, `send_time`) VALUES (0, ?, ?, ?, ?, ?, ?);', $rData['id'], $rData['type'], $rData['need_confirm'], $rData['message'], $rData['reboot_portal'], time())) { + $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'send_event', $rMag['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMag)); + echo json_encode(array('result' => true)); + exit(); + } + } else { + echo json_encode(array('result' => false, 'error' => 'No permissions.')); + exit(); + } + } + + echo json_encode(array('result' => false)); + exit(); + } + exit(); +} + +if ($action == 'streamlist') { + if ($rPermissions['create_mag'] || $rPermissions['can_view_vod'] || $rPermissions['reseller_client_connection_logs']) { + $rReturn = array('total_count' => 0, 'items' => array(), 'result' => true); + + if (isset(RequestManager::getAll()['search'])) { + $rPage = isset(RequestManager::getAll()['page']) ? intval(RequestManager::getAll()['page']) : 1; + + $db->query('SELECT COUNT(`id`) AS `id` FROM `streams` WHERE `stream_display_name` LIKE ? AND `id` IN (' . implode(',', array_map('intval', $rPermissions['stream_ids'])) . ');', '%' . RequestManager::getAll()['search'] . '%'); + $rReturn['total_count'] = $db->get_row()['id']; + $db->query('SELECT `id`, `stream_display_name` FROM `streams` WHERE `id` IN (' . implode(',', array_map('intval', $rPermissions['stream_ids'])) . ') AND `stream_display_name` LIKE ? ORDER BY `stream_display_name` ASC LIMIT ' . ($rPage - 1) * 100 . ', 100;', '%' . RequestManager::getAll()['search'] . '%'); + + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rRow) { + $rReturn['items'][] = array('id' => $rRow['id'], 'text' => $rRow['stream_display_name']); + } + } + } + + echo json_encode($rReturn); + exit(); + } + exit(); +} + +if ($action == 'ip_whois') { + $rIP = RequestManager::getAll()['ip']; + $rReader = new MaxMind\Db\Reader(GEOLITE2C_BIN); + $rResponse = $rReader->get($rIP); + + if (isset($rResponse['location']['time_zone'])) { + $rDate = new DateTime('now', new DateTimeZone($rResponse['location']['time_zone'])); + $rResponse['location']['time'] = $rDate->format('Y-m-d H:i:s'); + } + + $rReader->close(); + + if (isset(RequestManager::getAll()['isp'])) { + $rReader = new MaxMind\Db\Reader(GEOISP_BIN); + $rResponse['isp'] = $rReader->get($rIP); + $rReader->close(); + } + + $rResponse['type'] = null; + + if ($rResponse['isp']['autonomous_system_number']) { + $db->query('SELECT `type` FROM `blocked_asns` WHERE `asn` = ?;', $rResponse['isp']['autonomous_system_number']); + if ($db->num_rows() > 0) { + $rResponse['type'] = $db->get_row()['type']; + } + } + + echo json_encode(array('result' => true, 'data' => $rResponse)); + exit(); +} + +if ($action == 'get_epg') { + if ($rPermissions['can_view_vod']) { + if (count($rPermissions['stream_ids']) != 0) { + $rTimezone = (RequestManager::getAll()['timezone'] ?: 'Europe/London'); + date_default_timezone_set($rTimezone); + $rReturn = array('Channels' => array()); + $rChannels = array_map('intval', explode(',', RequestManager::getAll()['channels'])); + + if (count($rChannels) != 0) { + $rHours = (intval(RequestManager::getAll()['hours']) ?: 3); + $rStartDate = (intval(strtotime(RequestManager::getAll()['startdate'])) ?: time()); + $rFinishDate = $rStartDate + $rHours * 3600; + $rPerUnit = floatval(100 / ($rHours * 60)); + $rChannelsSort = $rChannels; + sort($rChannelsSort); + $rListings = array(); + + if (0 < count($rChannels)) { + $rArchiveInfo = array(); + $db->query('SELECT `id`, `tv_archive_server_id`, `tv_archive_duration` FROM `streams` WHERE `id` IN (' . implode(',', $rChannels) . ');'); + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rRow) { + $rArchiveInfo[$rRow['id']] = $rRow; + } + } + + $rEPG = EpgService::getStreamsEpg($rChannels, $rStartDate, $rFinishDate); + + foreach ($rEPG as $rChannelID => $rEPGData) { + $rFullSize = 0; + + foreach ($rEPGData as $rEPGItem) { + $rCapStart = ($rEPGItem['start'] < $rStartDate ? $rStartDate : $rEPGItem['start']); + $rCapEnd = ($rFinishDate < $rEPGItem['end'] ? $rFinishDate : $rEPGItem['end']); + $rDuration = ($rCapEnd - $rCapStart) / 60; + $rArchive = null; + + if (isset($rArchiveInfo[$rChannelID])) { + if (0 < $rArchiveInfo[$rChannelID]['tv_archive_server_id'] && 0 < $rArchiveInfo[$rChannelID]['tv_archive_duration']) { + if (!(time() - $rArchiveInfo[$rChannelID]['tv_archive_duration'] * 86400 > $rEPGItem['start'])) { + $rArchive = array($rEPGItem['start'], intval(($rEPGItem['end'] - $rEPGItem['start']) / 60)); + } + } + } + + $rRelativeSize = round($rDuration * $rPerUnit, 2); + $rFullSize += $rRelativeSize; + + if (100 < $rFullSize) { + $rRelativeSize -= $rFullSize - 100; + } + + $rListings[$rChannelID][] = array('ListingId' => $rEPGItem['id'], 'ChannelId' => $rChannelID, 'Title' => $rEPGItem['title'], 'RelativeSize' => $rRelativeSize, 'StartTime' => date('h:iA', $rCapStart), 'EndTime' => date('h:iA', $rCapEnd), 'Start' => $rEPGItem['start'], 'End' => $rEPGItem['end'], 'Specialisation' => 'tv', 'Archive' => $rArchive); + } + } + } + + $rDefaultEPG = array('ChannelId' => null, 'Title' => 'No Programme Information...', 'RelativeSize' => 100, 'StartTime' => 'Not Available', 'EndTime' => '', 'Specialisation' => 'tv', 'Archive' => null); + $db->query('SELECT `id`, `stream_icon`, `stream_display_name`, `tv_archive_duration`, `tv_archive_server_id`, `category_id` FROM `streams` WHERE `id` IN (' . implode(',', $rChannels) . ') ORDER BY FIELD(`id`, ' . implode(',', $rChannels) . ') ASC;'); + + foreach ($db->get_rows() as $rStream) { + if (0 < $rStream['tv_archive_duration'] && 0 < $rStream['tv_archive_server_id']) { + $rArchive = $rStream['tv_archive_duration']; + } else { + $rArchive = 0; + } + + $rDefaultArray = $rDefaultEPG; + $rDefaultArray['ChannelId'] = $rStream['id']; + $rCategoryIDs = json_decode($rStream['category_id'], true); + $rCategories = CategoryService::getAllByType('live'); + + if (0 < strlen(RequestManager::getAll()['category'])) { + $rCategory = ($rCategories[intval(RequestManager::getAll()['category'])]['category_name'] ?: 'No Category'); + } else { + $rCategory = ($rCategories[$rCategoryIDs[0]]['category_name'] ?: 'No Category'); + } + + if (1 < count($rCategoryIDs)) { + $rCategory .= ' (+' . (count($rCategoryIDs) - 1) . ' others)'; + } + + $rReturn['Channels'][] = array('Id' => $rStream['id'], 'DisplayName' => $rStream['stream_display_name'], 'CategoryName' => $rCategory, 'Archive' => $rArchive, 'Image' => (ImageUtils::validateURL($rStream['stream_icon']) ?: ''), 'TvListings' => ($rListings[$rStream['id']] ?: array($rDefaultArray))); + } + echo json_encode($rReturn); + exit(); + } + + echo json_encode($rReturn); + exit(); + } + exit(); + } + exit(); +} + +if ($action == 'get_programme') { + if ($rPermissions['can_view_vod']) { + $rTimezone = (RequestManager::getAll()['timezone'] ?: 'Europe/London'); + date_default_timezone_set($rTimezone); + + if (isset(RequestManager::getAll()['id'])) { + $rRow = EpgService::getProgramme(RequestManager::getAll()['stream_id'], RequestManager::getAll()['id']); + + if ($rRow) { + $rArchive = $rAvailable = false; + + if (time() < $rRow['end']) { + $db->query('SELECT `server_id`, `direct_source`, `monitor_pid`, `pid`, `stream_status`, `on_demand` FROM `streams` LEFT JOIN `streams_servers` ON `streams_servers`.`stream_id` = `streams`.`id` WHERE `streams`.`id` = ? AND `server_id` IS NOT NULL;', RequestManager::getAll()['stream_id']); + if ($db->num_rows() > 0) { + foreach ($db->get_rows() as $rStreamRow) { + if ($rStreamRow['server_id'] && !$rStreamRow['direct_source']) { + $rAvailable = true; + break; + } + } + } + } + + $rRow['date'] = date('H:i', $rRow['start']) . ' - ' . date('H:i', $rRow['end']); + echo json_encode(array('result' => true, 'data' => $rRow, 'available' => $rAvailable, 'archive' => $rArchive)); + exit(); + } + } + + echo json_encode(array('result' => false)); + exit(); + } + exit(); +} diff --git a/src/reseller/resize.php b/src/infrastructure/legacy/reseller_resize_body.php similarity index 86% rename from src/reseller/resize.php rename to src/infrastructure/legacy/reseller_resize_body.php index 3bd1afdf..c9672acb 100644 --- a/src/reseller/resize.php +++ b/src/infrastructure/legacy/reseller_resize_body.php @@ -1,20 +1,16 @@ intval(RequestManager::getAll()['draw']), 'recordsTotal' => 0, 'recordsFiltered' => 0, 'data' => array()); -$rIsAPI = false; -if (isset(RequestManager::getAll()['api_key'])) { - $rReturn = array('status' => 'STATUS_SUCCESS', 'data' => array()); - $db->query('SELECT `id` FROM `users` LEFT JOIN `users_groups` ON `users_groups`.`group_id` = `users`.`member_group_id` WHERE `api_key` = ? AND LENGTH(`api_key`) > 0 AND `is_reseller` = 1 AND `status` = 1;', RequestManager::getAll()['api_key']); - if ($db->num_rows() != 0) { - $rUserID = $db->get_row()['id']; - $rIsAPI = true; - require_once MAIN_HOME . 'includes/admin.php'; - $rUserInfo = UserRepository::getRegisteredUserById($rUserID); - $rPermissions = array_merge(getPermissions($rUserInfo['member_group_id']), getGroupPermissions($rUserInfo['id'])); - $rPermissions['direct_reports'] = $rPermissions['direct_reports'] ?? []; - $rPermissions['all_reports'] = $rPermissions['all_reports'] ?? []; - $rPermissions['stream_ids'] = $rPermissions['stream_ids'] ?? []; - $rPermissions['category_ids'] = $rPermissions['category_ids'] ?? []; - $rPermissions['series_ids'] = $rPermissions['series_ids'] ?? []; - $rPermissions['subresellers'] = $rPermissions['subresellers'] ?? []; - if (0 >= strlen($rUserInfo['timezone'])) { - } else { - date_default_timezone_set($rUserInfo['timezone']); - } - } else { - echo json_encode(array('status' => 'STATUS_FAILURE', 'error' => 'Invalid API key.')); - exit(); - } -} else { - if (isset($_SESSION['reseller'])) { - include 'functions.php'; - } else { - echo json_encode($rReturn); - exit(); - } -} -if (!$rUserInfo['id']) { - echo json_encode($rReturn); - exit(); -} +/** + * Legacy reseller table data handler. + * Extracted from reseller/table.php (lines 50+). + * Variables expected from caller: $rReturn, $rIsAPI, $rUserInfo, $rPermissions, $rSettings, $db + */ if (isset($rUserInfo['reports'])) { $rType = RequestManager::getAll()['id']; $rStart = intval(RequestManager::getAll()['start']); diff --git a/src/public/Controllers/Admin/BaseAdminController.php b/src/public/Controllers/Admin/BaseAdminController.php index e29b3b80..95570131 100644 --- a/src/public/Controllers/Admin/BaseAdminController.php +++ b/src/public/Controllers/Admin/BaseAdminController.php @@ -84,7 +84,7 @@ class BaseAdminController $viewGlobals = [ // Core rendering 'language', 'db', 'rSettings', 'rMobile', 'rUserInfo', - 'rPermissions', '_TITLE', '_STATUS', '_PAGE', + 'rPermissions', '_TITLE', '_STATUS', '_PAGE', 'rRequest', // Theme/UI 'rThemes', 'rHues', // Servers @@ -103,6 +103,8 @@ class BaseAdminController 'rPermissionKeys', 'rAdvPermissions', // Misc from bootstrap 'rDetect', 'rTimeout', 'rProtocol', + // Reseller-specific + 'rGenTrials', ]; foreach ($viewGlobals as $_g) { if (array_key_exists($_g, $GLOBALS) && !array_key_exists($_g, $data)) { @@ -118,6 +120,14 @@ class BaseAdminController // 1. Header renderUnifiedLayoutHeader($this->scope); + // Header may define new globals (e.g. reseller header sets rGenTrials) + foreach ($viewGlobals as $_g) { + if (!isset($$_g) && array_key_exists($_g, $GLOBALS)) { + $$_g = $GLOBALS[$_g]; + } + } + unset($_g); + // 2. View content $__viewFile = $__viewsDir . $view . '.php'; $__scriptsFile = $__viewsDir . $view . '.scripts.php'; @@ -128,10 +138,13 @@ class BaseAdminController } // Split mode: separate .scripts.php exists → footer + scripts handled here. - // Unified mode: no .scripts.php → view includes footer + scripts itself. + // Clean mode: no .scripts.php + no $__viewMode → controller renders footer. + // Unified (proxy) mode: no .scripts.php + $__viewMode set → proxy view handles footer itself. if ($__hasScriptsFile) { renderUnifiedLayoutFooter($this->scope); require $__scriptsFile; + } elseif (!isset($__viewMode)) { + renderUnifiedLayoutFooter($this->scope); } } diff --git a/src/public/Controllers/Reseller/ResellerApiController.php b/src/public/Controllers/Reseller/ResellerApiController.php new file mode 100644 index 00000000..e1cf1c33 --- /dev/null +++ b/src/public/Controllers/Reseller/ResellerApiController.php @@ -0,0 +1,47 @@ + false]); + exit(); + } + + if (!isset($rUserInfo['reports'])) { + echo json_encode(['result' => false]); + exit(); + } + + $action = RequestManager::getAll()['action'] ?? ''; + + // Delegate to the legacy API logic file + require MAIN_HOME . 'infrastructure/legacy/reseller_api_actions.php'; + } +} diff --git a/src/public/Controllers/Reseller/ResellerCreatedChannelsController.php b/src/public/Controllers/Reseller/ResellerCreatedChannelsController.php index 6afcd35f..66185787 100644 --- a/src/public/Controllers/Reseller/ResellerCreatedChannelsController.php +++ b/src/public/Controllers/Reseller/ResellerCreatedChannelsController.php @@ -7,6 +7,9 @@ class ResellerCreatedChannelsController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('created_channels'); + $this->setTitle('Created Channels'); + $this->render('created_channels', [ + 'categories' => CategoryService::getAllByType('live'), + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerDashboardController.php b/src/public/Controllers/Reseller/ResellerDashboardController.php index 0a936de3..d43765e9 100644 --- a/src/public/Controllers/Reseller/ResellerDashboardController.php +++ b/src/public/Controllers/Reseller/ResellerDashboardController.php @@ -6,6 +6,86 @@ class ResellerDashboardController extends BaseResellerController { public function index() { - $this->render('dashboard'); + $this->setTitle('Dashboard'); + + $rUserInfo = $GLOBALS['rUserInfo']; + $rPermissions = $GLOBALS['rPermissions']; + $rSettings = SettingsManager::getAll(); + + $rRegisteredUsers = UserRepository::getResellers($rUserInfo['id'], true); + $rGroups = GroupService::getAll(); + + // Sanitize notice HTML + $rNotice = html_entity_decode($rGroups[$rUserInfo['member_group_id']]['notice_html']); + $rNotice = preg_replace('#]*+>#i', '', $rNotice); + $rNotice = preg_replace('#]*+>#i', '', $rNotice); + $rNotice = str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $rNotice); + $rNotice = preg_replace('/(&#*\\w+)[\\x00-\\x20]+;/u', '$1;', $rNotice); + $rNotice = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $rNotice); + $rNotice = html_entity_decode($rNotice, ENT_COMPAT, 'UTF-8'); + $rNotice = preg_replace("#(<[^>]+?[\\x00-\\x20\"'])(?:on|xmlns)[^>]*+[>\\b]?#iu", '$1>', $rNotice); + $rNotice = preg_replace("#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([`'\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu", '$1=$2nojavascript...', $rNotice); + $rNotice = preg_replace("#([a-z]*)[\\x00-\\x20]*=(['\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu", '$1=$2novbscript...', $rNotice); + $rNotice = preg_replace("#([a-z]*)[\\x00-\\x20]*=(['\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#u", '$1=$2nomozbinding...', $rNotice); + $rNotice = preg_replace("#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`'\"]*.*?expression[\\x00-\\x20]*\\([^>]*+>#i", '$1>', $rNotice); + $rNotice = preg_replace("#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`'\"]*.*?behaviour[\\x00-\\x20]*\\([^>]*+>#i", '$1>', $rNotice); + $rNotice = preg_replace("#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`'\"]*.*?s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*+>#iu", '$1>', $rNotice); + + // Recent activity + $rPackages = getPackages(); + global $db; + $rAllReports = array_merge(array($rUserInfo['id']), $rPermissions['all_reports'] ?? []); + $db->query('SELECT * FROM `users_logs` LEFT JOIN `users` ON `users`.`id` = `users_logs`.`owner` WHERE `users_logs`.`owner` IN (' . implode(',', array_map('intval', $rAllReports)) . ') ORDER BY `date` DESC LIMIT 250;'); + $rActivityRows = []; + $rDeviceMap = ['line' => 'User Line', 'mag' => 'MAG Device', 'enigma' => 'Enigma2 Device', 'user' => 'Reseller']; + foreach ($db->get_rows() as $rRow) { + $rDevice = $rDeviceMap[$rRow['type']] ?? ''; + $rText = ''; + switch ($rRow['action']) { + case 'new': + $rText = 'Created New ' . $rDevice . ($rRow['package_id'] && isset($rPackages[$rRow['package_id']]) ? ' with Package:
' . $rPackages[$rRow['package_id']]['package_name'] : ''); + break; + case 'extend': + $rText = 'Extended ' . $rDevice . ($rRow['package_id'] && isset($rPackages[$rRow['package_id']]) ? ' with Package:
' . $rPackages[$rRow['package_id']]['package_name'] : ''); + break; + case 'convert': + $rText = 'Converted Device to User Line'; + break; + case 'edit': + $rText = 'Edited ' . $rDevice; + break; + case 'enable': + $rText = 'Enabled ' . $rDevice; + break; + case 'disable': + $rText = 'Disabled ' . $rDevice; + break; + case 'delete': + $rText = 'Deleted ' . $rDevice; + break; + case 'send_event': + $rText = 'Sent Event to ' . $rDevice; + break; + case 'adjust_credits': + $rText = 'Adjusted Credits by ' . $rRow['cost']; + break; + } + $rActivityRows[] = [ + 'owner_id' => $rRow['owner'], + 'username' => $rRow['username'], + 'text' => $rText, + 'date' => $rRow['date'], + ]; + } + + // Expiring lines + $rExpiringLines = getExpiring() ?: []; + + $this->render('dashboard', [ + 'rRegisteredUsers' => $rRegisteredUsers, + 'rNotice' => $rNotice, + 'rActivityRows' => $rActivityRows, + 'rExpiringLines' => $rExpiringLines, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerEditProfileController.php b/src/public/Controllers/Reseller/ResellerEditProfileController.php index 2b983f67..7437cfae 100644 --- a/src/public/Controllers/Reseller/ResellerEditProfileController.php +++ b/src/public/Controllers/Reseller/ResellerEditProfileController.php @@ -6,6 +6,27 @@ class ResellerEditProfileController extends BaseResellerController { public function index() { - $this->render('edit_profile'); + $this->setTitle('Edit Profile'); + + $data = [ + 'timezones' => TimeZoneList(), + ]; + + // Find API code for this user's group + foreach (getcodes() as $rCode) { + if ($rCode['type'] == 4 && in_array($GLOBALS['rUserInfo']['member_group_id'], json_decode($rCode['groups'], true) ?: [])) { + $data['apiCode'] = $rCode; + $servers = ServerRepository::getAll(); + $userInfo = $GLOBALS['rUserInfo']; + if (empty($userInfo['reseller_dns'])) { + $data['apiUrl'] = $servers[SERVER_ID]['http_url'] . $rCode['code'] . '/'; + } else { + $data['apiUrl'] = 'http://' . $userInfo['reseller_dns'] . ':' . intval($servers[SERVER_ID]['http_broadcast_port']) . '/' . $rCode['code'] . '/'; + } + break; + } + } + + $this->render('edit_profile', $data); } } diff --git a/src/public/Controllers/Reseller/ResellerEnigmaController.php b/src/public/Controllers/Reseller/ResellerEnigmaController.php index 0bc14159..1ad9bf71 100644 --- a/src/public/Controllers/Reseller/ResellerEnigmaController.php +++ b/src/public/Controllers/Reseller/ResellerEnigmaController.php @@ -7,6 +7,33 @@ class ResellerEnigmaController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('enigma'); + $this->setTitle('Enigma Device'); + + $rRequest = RequestManager::getAll(); + $rUserInfo = $GLOBALS['rUserInfo']; + $rDevice = null; + $rLine = null; + $rOrigPackage = null; + + if (isset($rRequest['id'])) { + $rDevice = getEnigma($rRequest['id']); + if (!($rDevice && $rDevice['user'] && $rDevice['user']['is_e2'] && Authorization::check('line', $rDevice['user']['id']))) { + goHome(); + return; + } + $rLine = $rDevice['user']; + if ($rLine['package_id'] > 0) { + $rOrigPackage = getPackage($rLine['package_id']); + } + } + + $rPackages = getPackages($rUserInfo['member_group_id'], 'e2') ?: []; + + $this->render('enigma', [ + 'rDevice' => $rDevice, + 'rLine' => $rLine, + 'rOrigPackage' => $rOrigPackage, + 'rPackages' => $rPackages, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerEnigmasController.php b/src/public/Controllers/Reseller/ResellerEnigmasController.php index 55c0f78d..54344411 100644 --- a/src/public/Controllers/Reseller/ResellerEnigmasController.php +++ b/src/public/Controllers/Reseller/ResellerEnigmasController.php @@ -7,6 +7,7 @@ class ResellerEnigmasController extends BaseResellerController public function index() { $this->requirePermission(); + $this->setTitle('Enigma Devices'); $this->render('enigmas'); } } diff --git a/src/public/Controllers/Reseller/ResellerEpgViewController.php b/src/public/Controllers/Reseller/ResellerEpgViewController.php index 6d218553..1efa9d18 100644 --- a/src/public/Controllers/Reseller/ResellerEpgViewController.php +++ b/src/public/Controllers/Reseller/ResellerEpgViewController.php @@ -7,6 +7,85 @@ class ResellerEpgViewController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('epg_view'); + + $rMobile = $GLOBALS['rMobile'] ?? false; + if ($rMobile) { + header('Location: dashboard'); + exit; + } + + $rRequest = $GLOBALS['rRequest'] ?? []; + $rPermissions = $GLOBALS['rPermissions'] ?? []; + $db = $GLOBALS['db']; + + $rPageInt = (intval($rRequest['page'] ?? 0) > 0 ? intval($rRequest['page']) : 1); + $rLimit = (intval($rRequest['entries'] ?? 0) > 0 ? intval($rRequest['entries']) : SettingsManager::getAll()['default_entries']); + $rStart = ($rPageInt - 1) * $rLimit; + + $rStreamIDs = []; + $rCount = 0; + + if (count($rPermissions['stream_ids'] ?? []) > 0) { + $rWhere = []; + $rWhereV = []; + $rWhere[] = '`type` = 1 AND `epg_id` IS NOT NULL AND `channel_id` IS NOT NULL'; + $rWhere[] = '`id` IN (' . implode(',', array_map('intval', $rPermissions['stream_ids'] ?? [])) . ')'; + + if (isset($rRequest['category']) && intval($rRequest['category']) > 0) { + $rWhere[] = "JSON_CONTAINS(`category_id`, ?, '\$')"; + $rWhereV[] = $rRequest['category']; + } + + if (!empty($rRequest['search'])) { + $rWhere[] = '(`stream_display_name` LIKE ? OR `id` LIKE ?)'; + $rWhereV[] = '%' . $rRequest['search'] . '%'; + $rWhereV[] = $rRequest['search']; + } + + $rWhereString = count($rWhere) > 0 ? 'WHERE ' . implode(' AND ', $rWhere) : ''; + + $rOrder = ['name' => '`stream_display_name` ASC', 'added' => '`added` DESC']; + + if (!empty($rRequest['sort']) && isset($rOrder[$rRequest['sort']])) { + $rOrderBy = $rOrder[$rRequest['sort']]; + } else { + $rChannelOrder = igbinary_unserialize(file_get_contents(CACHE_TMP_PATH . 'channel_order')); + + if (SettingsManager::getAll()['channel_number_type'] != 'manual' && count($rChannelOrder) > 0) { + $rOrderBy = 'FIELD(`id`,' . implode(',', $rChannelOrder) . ')'; + } else { + $rOrderBy = '`order` ASC'; + } + } + + $db->query('SELECT COUNT(`id`) AS `count` FROM `streams` ' . $rWhereString . ';', ...$rWhereV); + $rCount = $db->get_row()['count']; + $db->query('SELECT `id` FROM `streams` ' . $rWhereString . ' ORDER BY ' . $rOrderBy . ' LIMIT ' . $rStart . ', ' . $rLimit . ';', ...$rWhereV); + + foreach ($db->get_rows() as $rRow) { + $rStreamIDs[] = $rRow['id']; + } + } + + $rPages = ceil($rCount / max($rLimit, 1)); + $rPagination = []; + foreach (range($rPageInt - 2, $rPageInt + 2) as $i) { + if ($i >= 1 && $i <= $rPages) { + $rPagination[] = $i; + } + } + + $rCategories = CategoryService::getAllByType('live'); + + $this->setTitle('TV Guide'); + $this->render('epg_view', [ + 'rStreamIDs' => $rStreamIDs, + 'rCount' => $rCount, + 'rPageInt' => $rPageInt, + 'rPages' => $rPages, + 'rLimit' => $rLimit, + 'rPagination' => $rPagination, + 'rCategories' => $rCategories, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerEpisodesController.php b/src/public/Controllers/Reseller/ResellerEpisodesController.php index 8e5d8d1e..04fcfd00 100644 --- a/src/public/Controllers/Reseller/ResellerEpisodesController.php +++ b/src/public/Controllers/Reseller/ResellerEpisodesController.php @@ -7,6 +7,10 @@ class ResellerEpisodesController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('episodes'); + $this->setTitle('Episodes'); + $this->render('episodes', [ + 'seriesList' => SeriesService::getList(), + 'categories' => CategoryService::getAllByType('series'), + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerLineActivityController.php b/src/public/Controllers/Reseller/ResellerLineActivityController.php index df7d862c..e365bc68 100644 --- a/src/public/Controllers/Reseller/ResellerLineActivityController.php +++ b/src/public/Controllers/Reseller/ResellerLineActivityController.php @@ -7,6 +7,23 @@ class ResellerLineActivityController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('line_activity'); + $this->setTitle('Activity Logs'); + + $rRequest = RequestManager::getAll(); + $data = []; + + if (isset($rRequest['line'])) { + if (Authorization::check('line', $rRequest['line'])) { + $data['rSearchLine'] = UserRepository::getLineById($rRequest['line']); + } else { + exit(); + } + } + + if (isset($rRequest['stream'])) { + $data['rSearchStream'] = StreamRepository::getById($rRequest['stream']); + } + + $this->render('line_activity', $data); } } diff --git a/src/public/Controllers/Reseller/ResellerLineController.php b/src/public/Controllers/Reseller/ResellerLineController.php index 3d70d3fc..c44efb78 100644 --- a/src/public/Controllers/Reseller/ResellerLineController.php +++ b/src/public/Controllers/Reseller/ResellerLineController.php @@ -7,6 +7,30 @@ class ResellerLineController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('line'); + $this->setTitle('Line'); + + $rRequest = RequestManager::getAll(); + $rUserInfo = $GLOBALS['rUserInfo']; + $rLine = null; + $rOrigPackage = null; + + if (isset($rRequest['id'])) { + $rLine = UserRepository::getLineById($rRequest['id']); + if (!$rLine || $rLine['is_mag'] || $rLine['is_e2'] || !Authorization::check('line', $rLine['id'])) { + goHome(); + return; + } + if ($rLine['package_id'] > 0) { + $rOrigPackage = getPackage($rLine['package_id']); + } + } + + $rPackages = getPackages($rUserInfo['member_group_id'], 'line') ?: []; + + $this->render('line', [ + 'rLine' => $rLine, + 'rOrigPackage' => $rOrigPackage, + 'rPackages' => $rPackages, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerLinesController.php b/src/public/Controllers/Reseller/ResellerLinesController.php index 951207c0..75deb517 100644 --- a/src/public/Controllers/Reseller/ResellerLinesController.php +++ b/src/public/Controllers/Reseller/ResellerLinesController.php @@ -7,6 +7,7 @@ class ResellerLinesController extends BaseResellerController public function index() { $this->requirePermission(); + $this->setTitle('Lines'); $this->render('lines'); } } diff --git a/src/public/Controllers/Reseller/ResellerLiveConnectionsController.php b/src/public/Controllers/Reseller/ResellerLiveConnectionsController.php index 07f04736..f1168058 100644 --- a/src/public/Controllers/Reseller/ResellerLiveConnectionsController.php +++ b/src/public/Controllers/Reseller/ResellerLiveConnectionsController.php @@ -7,6 +7,25 @@ class ResellerLiveConnectionsController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('live_connections'); + $this->setTitle('Live Connections'); + + $rRequest = RequestManager::getAll(); + $data = [ + 'redisEnabled' => (bool) SettingsManager::getAll()['redis_handler'], + ]; + + if (isset($rRequest['line'])) { + if (Authorization::check('line', $rRequest['line'])) { + $data['rSearchLine'] = UserRepository::getLineById($rRequest['line']); + } else { + exit(); + } + } + + if (isset($rRequest['stream'])) { + $data['rSearchStream'] = StreamRepository::getById($rRequest['stream']); + } + + $this->render('live_connections', $data); } } diff --git a/src/public/Controllers/Reseller/ResellerLoginController.php b/src/public/Controllers/Reseller/ResellerLoginController.php new file mode 100644 index 00000000..7908839d --- /dev/null +++ b/src/public/Controllers/Reseller/ResellerLoginController.php @@ -0,0 +1,74 @@ + 0) { + $db->query( + "SELECT COUNT(`id`) AS `count` FROM `login_logs` WHERE `status` = 'INVALID_LOGIN' AND `login_ip` = ? AND TIME_TO_SEC(TIMEDIFF(NOW(), `date`)) <= 86400;", + $rIP + ); + + if ($db->num_rows() === 1 && intval($db->get_row()['count']) >= intval($rSettings['login_flood'])) { + BlocklistService::blockIP(['ip' => $rIP, 'notes' => 'LOGIN FLOOD ATTACK']); + exit(); + } + } + + // Process login POST + $_STATUS = null; + if (isset(RequestManager::getAll()['login'])) { + $rReturn = ResellerAPI::processLogin(RequestManager::getAll()); + $_STATUS = $rReturn['status']; + + if ($_STATUS === STATUS_SUCCESS) { + $rReferer = RequestManager::getAll()['referrer'] ?? ''; + if (strlen($rReferer) > 0) { + $rReferer = basename($rReferer); + if (substr($rReferer, 0, 6) === 'logout') { + $rReferer = 'dashboard'; + } + header('Location: ' . $rReferer); + } else { + header('Location: dashboard'); + } + exit(); + } + } + + // Render login view + $__viewFile = MAIN_HOME . 'public/Views/reseller/login.php'; + $referrer = htmlspecialchars(RequestManager::getAll()['referrer'] ?? ''); + + if (file_exists($__viewFile)) { + require $__viewFile; + } else { + http_response_code(500); + echo 'Login view not found'; + } + } +} diff --git a/src/public/Controllers/Reseller/ResellerLogoutController.php b/src/public/Controllers/Reseller/ResellerLogoutController.php new file mode 100644 index 00000000..f4028207 --- /dev/null +++ b/src/public/Controllers/Reseller/ResellerLogoutController.php @@ -0,0 +1,12 @@ +redirect('./login'); + } +} diff --git a/src/public/Controllers/Reseller/ResellerMagController.php b/src/public/Controllers/Reseller/ResellerMagController.php index d502f88b..8bd1f4e7 100644 --- a/src/public/Controllers/Reseller/ResellerMagController.php +++ b/src/public/Controllers/Reseller/ResellerMagController.php @@ -7,6 +7,33 @@ class ResellerMagController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('mag'); + + $rDevice = null; + $rLine = null; + $rOrigPackage = null; + + if (isset($GLOBALS['rRequest']['id'])) { + $rDevice = getMag($GLOBALS['rRequest']['id']); + + if (!$rDevice || !$rDevice['user'] || !$rDevice['user']['is_mag'] || !Authorization::check('line', $rDevice['user']['id'])) { + goHome(); + } + + $rLine = $rDevice['user']; + + if ($rLine['package_id'] > 0) { + $rOrigPackage = getPackage($rLine['package_id']); + } + } + + $rPackages = getPackages($GLOBALS['rUserInfo']['member_group_id'], 'mag') ?: []; + + $this->setTitle('MAG Device'); + $this->render('mag', [ + 'rDevice' => $rDevice, + 'rLine' => $rLine, + 'rOrigPackage' => $rOrigPackage, + 'rPackages' => $rPackages, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerMagsController.php b/src/public/Controllers/Reseller/ResellerMagsController.php index 9e107871..e5bdcb34 100644 --- a/src/public/Controllers/Reseller/ResellerMagsController.php +++ b/src/public/Controllers/Reseller/ResellerMagsController.php @@ -7,6 +7,7 @@ class ResellerMagsController extends BaseResellerController public function index() { $this->requirePermission(); + $this->setTitle('MAG Devices'); $this->render('mags'); } } diff --git a/src/public/Controllers/Reseller/ResellerMoviesController.php b/src/public/Controllers/Reseller/ResellerMoviesController.php index 3c67b0dc..58082a90 100644 --- a/src/public/Controllers/Reseller/ResellerMoviesController.php +++ b/src/public/Controllers/Reseller/ResellerMoviesController.php @@ -7,6 +7,9 @@ class ResellerMoviesController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('movies'); + $this->setTitle('Movies'); + $this->render('movies', [ + 'categories' => CategoryService::getAllByType('movie'), + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerPostController.php b/src/public/Controllers/Reseller/ResellerPostController.php new file mode 100644 index 00000000..79b2127d --- /dev/null +++ b/src/public/Controllers/Reseller/ResellerPostController.php @@ -0,0 +1,99 @@ + false]); + exit(); + } + + $rUserInfo = $GLOBALS['rUserInfo']; + $language = $GLOBALS['language']; + + switch ($rAction) { + case 'edit_profile': + $rReturn = ResellerAPI::editResellerProfile($rData); + setcookie('hue', $rData['hue'], time() + 315360000); + setcookie('theme', $rData['theme'], time() + 315360000); + $language::setLanguage($rData['lang']); + + if ($rReturn['status'] == STATUS_SUCCESS) { + echo json_encode(['result' => true, 'location' => 'edit_profile?status=' . intval($rReturn['status']), 'status' => $rReturn['status'], 'reload' => true]); + exit(); + } + echo json_encode(['result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status']]); + exit(); + + case 'line': + $rReturn = ResellerAPI::processLine($rData); + if ($rReturn['status'] == STATUS_SUCCESS) { + echo json_encode(['result' => true, 'location' => 'lines?status=' . intval($rReturn['status']), 'status' => $rReturn['status']]); + exit(); + } + echo json_encode(['result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status']]); + exit(); + + case 'mag': + $rReturn = ResellerAPI::processMAG($rData); + if ($rReturn['status'] == STATUS_SUCCESS) { + echo json_encode(['result' => true, 'location' => 'mags?status=' . intval($rReturn['status']), 'status' => $rReturn['status']]); + exit(); + } + echo json_encode(['result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status']]); + exit(); + + case 'enigma': + $rReturn = ResellerAPI::processEnigma($rData); + if ($rReturn['status'] == STATUS_SUCCESS) { + echo json_encode(['result' => true, 'location' => 'enigmas?status=' . intval($rReturn['status']), 'status' => $rReturn['status']]); + exit(); + } + echo json_encode(['result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status']]); + exit(); + + case 'ticket': + $rReturn = ResellerAPI::submitTicket($rData); + if ($rReturn['status'] == STATUS_SUCCESS) { + echo json_encode(['result' => true, 'location' => 'ticket_view?id=' . intval($rReturn['data']['insert_id']) . '&status=' . intval($rReturn['status']), 'status' => $rReturn['status']]); + exit(); + } + echo json_encode(['result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status']]); + exit(); + + case 'user': + $rReturn = ResellerAPI::processUser($rData); + if ($rReturn['status'] == STATUS_SUCCESS) { + echo json_encode(['result' => true, 'location' => 'users?status=' . intval($rReturn['status']), 'status' => $rReturn['status']]); + exit(); + } + echo json_encode(['result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status']]); + exit(); + + default: + echo json_encode(['result' => false, 'error' => 'Unknown action']); + exit(); + } + } +} diff --git a/src/public/Controllers/Reseller/ResellerRadiosController.php b/src/public/Controllers/Reseller/ResellerRadiosController.php index e87a7718..c56861b6 100644 --- a/src/public/Controllers/Reseller/ResellerRadiosController.php +++ b/src/public/Controllers/Reseller/ResellerRadiosController.php @@ -7,6 +7,9 @@ class ResellerRadiosController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('radios'); + $this->setTitle('Radio Stations'); + $this->render('radios', [ + 'categories' => CategoryService::getAllByType('radio'), + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerResizeController.php b/src/public/Controllers/Reseller/ResellerResizeController.php new file mode 100644 index 00000000..48de7d1b --- /dev/null +++ b/src/public/Controllers/Reseller/ResellerResizeController.php @@ -0,0 +1,21 @@ + true]); + exit; + } +} diff --git a/src/public/Controllers/Reseller/ResellerStreamsController.php b/src/public/Controllers/Reseller/ResellerStreamsController.php index 08335ca1..4ba87b21 100644 --- a/src/public/Controllers/Reseller/ResellerStreamsController.php +++ b/src/public/Controllers/Reseller/ResellerStreamsController.php @@ -7,6 +7,9 @@ class ResellerStreamsController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('streams'); + $this->setTitle('Streams'); + $this->render('streams', [ + 'categories' => CategoryService::getAllByType('live'), + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerTableController.php b/src/public/Controllers/Reseller/ResellerTableController.php new file mode 100644 index 00000000..054c3743 --- /dev/null +++ b/src/public/Controllers/Reseller/ResellerTableController.php @@ -0,0 +1,73 @@ + intval(RequestManager::getAll()['draw']), 'recordsTotal' => 0, 'recordsFiltered' => 0, 'data' => array()); + $rIsAPI = false; + + if (isset(RequestManager::getAll()['api_key'])) { + $rReturn = array('status' => 'STATUS_SUCCESS', 'data' => array()); + $db->query('SELECT `id` FROM `users` LEFT JOIN `users_groups` ON `users_groups`.`group_id` = `users`.`member_group_id` WHERE `api_key` = ? AND LENGTH(`api_key`) > 0 AND `is_reseller` = 1 AND `status` = 1;', RequestManager::getAll()['api_key']); + if ($db->num_rows() != 0) { + $rUserID = $db->get_row()['id']; + $rIsAPI = true; + require_once MAIN_HOME . 'includes/admin.php'; + $rUserInfo = UserRepository::getRegisteredUserById($rUserID); + $rPermissions = array_merge(getPermissions($rUserInfo['member_group_id']), getGroupPermissions($rUserInfo['id'])); + $rPermissions['direct_reports'] = $rPermissions['direct_reports'] ?? []; + $rPermissions['all_reports'] = $rPermissions['all_reports'] ?? []; + $rPermissions['stream_ids'] = $rPermissions['stream_ids'] ?? []; + $rPermissions['category_ids'] = $rPermissions['category_ids'] ?? []; + $rPermissions['series_ids'] = $rPermissions['series_ids'] ?? []; + $rPermissions['subresellers'] = $rPermissions['subresellers'] ?? []; + if (0 < strlen($rUserInfo['timezone'])) { + date_default_timezone_set($rUserInfo['timezone']); + } + } else { + echo json_encode(array('status' => 'STATUS_FAILURE', 'error' => 'Invalid API key.')); + exit(); + } + } else { + if (!$rUserInfo || !$rUserInfo['id']) { + echo json_encode($rReturn); + exit(); + } + } + + if (!$rUserInfo['id']) { + echo json_encode($rReturn); + exit(); + } + + if (!isset($rUserInfo['reports'])) { + echo json_encode($rReturn); + exit(); + } + + // Delegate to the legacy table logic file + require MAIN_HOME . 'infrastructure/legacy/reseller_table_body.php'; + } +} diff --git a/src/public/Controllers/Reseller/ResellerTicketController.php b/src/public/Controllers/Reseller/ResellerTicketController.php index badb6296..886174ce 100644 --- a/src/public/Controllers/Reseller/ResellerTicketController.php +++ b/src/public/Controllers/Reseller/ResellerTicketController.php @@ -7,6 +7,24 @@ class ResellerTicketController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('ticket'); + $this->setTitle('Ticket'); + + $rRequest = RequestManager::getAll(); + $rTicketInfo = null; + + if (isset($rRequest['id'])) { + $rTicketInfo = getTicket($rRequest['id']); + if (!$rTicketInfo) { + goHome(); + return; + } + if (!Authorization::check('user', $rTicketInfo['member_id'])) { + exit(); + } + } + + $this->render('ticket', [ + 'rTicketInfo' => $rTicketInfo, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerTicketViewController.php b/src/public/Controllers/Reseller/ResellerTicketViewController.php index fe09846e..445c38e4 100644 --- a/src/public/Controllers/Reseller/ResellerTicketViewController.php +++ b/src/public/Controllers/Reseller/ResellerTicketViewController.php @@ -7,6 +7,30 @@ class ResellerTicketViewController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('ticket_view'); + + $rRequest = RequestManager::getAll(); + + if (!isset($rRequest['id']) || !($rTicketInfo = getTicket($rRequest['id']))) { + goHome(); + return; + } + + if (!Authorization::check('user', $rTicketInfo['member_id'])) { + exit(); + } + + // Mark ticket as read + global $db; + $rUserInfo = $GLOBALS['rUserInfo']; + if ($rUserInfo['id'] != $rTicketInfo['member_id']) { + $db->query('UPDATE `tickets` SET `admin_read` = 1 WHERE `id` = ?;', $rRequest['id']); + } else { + $db->query('UPDATE `tickets` SET `user_read` = 1 WHERE `id` = ?;', $rRequest['id']); + } + + $this->setTitle('View Ticket'); + $this->render('ticket_view', [ + 'rTicketInfo' => $rTicketInfo, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerTicketsController.php b/src/public/Controllers/Reseller/ResellerTicketsController.php index 4dacf637..e317674c 100644 --- a/src/public/Controllers/Reseller/ResellerTicketsController.php +++ b/src/public/Controllers/Reseller/ResellerTicketsController.php @@ -7,6 +7,13 @@ class ResellerTicketsController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('tickets'); + $this->setTitle('Tickets'); + + $statusArray = ['CLOSED', 'OPEN', 'RESPONDED TO', 'READ BY ME', 'NEW RESPONSE', 'READ BY ADMIN', 'READ BY USER']; + + $this->render('tickets', [ + 'statusArray' => $statusArray, + 'tickets' => getTickets($GLOBALS['rUserInfo']['id']), + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerUserController.php b/src/public/Controllers/Reseller/ResellerUserController.php index 0fdaa2e8..b281e30c 100644 --- a/src/public/Controllers/Reseller/ResellerUserController.php +++ b/src/public/Controllers/Reseller/ResellerUserController.php @@ -7,6 +7,34 @@ class ResellerUserController extends BaseResellerController public function index() { $this->requirePermission(); - $this->render('user'); + + $rRequest = $GLOBALS['rRequest'] ?? []; + $rUserInfo = $GLOBALS['rUserInfo']; + $rPermissions = &$GLOBALS['rPermissions']; + $rUser = null; + + if (isset($rRequest['id'])) { + $rUser = UserRepository::getRegisteredUserById($rRequest['id']); + + if (!$rUser || $rRequest['id'] == $rUserInfo['id']) { + goHome(); + } + + // Remove edited user from reports arrays so they don't appear in owner dropdown + if (($rKey = array_search($rUser['id'], $rPermissions['all_reports'])) !== false) { + unset($rPermissions['all_reports'][$rKey]); + } + if (($rKey = array_search($rUser['id'], $rPermissions['direct_reports'])) !== false) { + unset($rPermissions['direct_reports'][$rKey]); + } + } + + $rGroups = GroupService::getAll() ?: []; + + $this->setTitle('User'); + $this->render('user', [ + 'rUser' => $rUser, + 'rGroups' => $rGroups, + ]); } } diff --git a/src/public/Controllers/Reseller/ResellerUserLogsController.php b/src/public/Controllers/Reseller/ResellerUserLogsController.php index 06662913..e18180fc 100644 --- a/src/public/Controllers/Reseller/ResellerUserLogsController.php +++ b/src/public/Controllers/Reseller/ResellerUserLogsController.php @@ -7,6 +7,7 @@ class ResellerUserLogsController extends BaseResellerController public function index() { $this->requirePermission(); + $this->setTitle('User Logs'); $this->render('user_logs'); } } diff --git a/src/public/Controllers/Reseller/ResellerUsersController.php b/src/public/Controllers/Reseller/ResellerUsersController.php index 4c6be1e6..bc5762a4 100644 --- a/src/public/Controllers/Reseller/ResellerUsersController.php +++ b/src/public/Controllers/Reseller/ResellerUsersController.php @@ -7,6 +7,7 @@ class ResellerUsersController extends BaseResellerController public function index() { $this->requirePermission(); + $this->setTitle('Users'); $this->render('users'); } } diff --git a/src/public/Views/layouts/admin.php b/src/public/Views/layouts/admin.php index 51d85412..c5f7b8da 100644 --- a/src/public/Views/layouts/admin.php +++ b/src/public/Views/layouts/admin.php @@ -40,7 +40,7 @@ if (!function_exists('renderUnifiedLayoutHeader')) { $rootPath = dirname(__DIR__, 3); if ($scope === 'reseller') { - require $rootPath . '/reseller/header.php'; + require __DIR__ . '/reseller/header.php'; return; } diff --git a/src/public/Views/layouts/footer.php b/src/public/Views/layouts/footer.php index 897ddf57..d92de692 100644 --- a/src/public/Views/layouts/footer.php +++ b/src/public/Views/layouts/footer.php @@ -39,7 +39,7 @@ if (!function_exists('renderUnifiedLayoutFooter')) { $rootPath = dirname(__DIR__, 3); if ($scope === 'reseller') { - require $rootPath . '/reseller/footer.php'; + require __DIR__ . '/reseller/footer.php'; return; } diff --git a/src/reseller/footer.php b/src/public/Views/layouts/reseller/footer.php similarity index 99% rename from src/reseller/footer.php rename to src/public/Views/layouts/reseller/footer.php index b567aa1b..4f487a03 100644 --- a/src/reseller/footer.php +++ b/src/public/Views/layouts/reseller/footer.php @@ -2,7 +2,7 @@ if (count(get_included_files()) != 1) { $_PAGE = getPageName(); - include 'modals.php'; + include __DIR__ . '/modals.php'; echo ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' '; - include 'post.php'; + include __DIR__ . '/post.scripts.php'; echo ' diff --git a/src/public/Views/reseller/created_channels.php b/src/public/Views/reseller/created_channels.php index 51049b5e..78d3a26d 100644 --- a/src/public/Views/reseller/created_channels.php +++ b/src/public/Views/reseller/created_channels.php @@ -1,7 +1,56 @@ - +
+
+
+
+
+ +
+

Created Channels

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + +
IDIconNameCategoryConnectionsKill
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/dashboard.php b/src/public/Views/reseller/dashboard.php index 03062d3f..0dd6fd2a 100644 --- a/src/public/Views/reseller/dashboard.php +++ b/src/public/Views/reseller/dashboard.php @@ -1,7 +1,170 @@ - +
+
+
+
+

Welcome

+
+ +
+ +
+ +
+
+ +
+
+
+
+

Recent Activity

+
+ + + + + + + + + + + + + + + + + + + +
ResellerLine / UserActionDate
+
+
+
+
+
+
+
+

Expiring Lines

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeIdentityOwnerExpires
MAG Device' : '' ?>Enigma2 Device' : '' ?>User Line' : '' ?>
+
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/edit_profile.php b/src/public/Views/reseller/edit_profile.php index f13ee6f7..20c07c67 100644 --- a/src/public/Views/reseller/edit_profile.php +++ b/src/public/Views/reseller/edit_profile.php @@ -1,7 +1,111 @@ - +
+
+
+
+

+
+
+
+
+
+ + + +
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+ + +
+
+
+ +
+
+
    +
  • + +
  • +
+
+
+
+
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/enigma.php b/src/public/Views/reseller/enigma.php index 43ac5190..112172c6 100644 --- a/src/public/Views/reseller/enigma.php +++ b/src/public/Views/reseller/enigma.php @@ -1,7 +1,358 @@ +
+
+
+
+
+
+ +
+

Enigma Device

+
+
+
+
+
+ + + + + + + + + + +
+
+
+ + + + + +
+ +
+
+
+
+
+ +
+ +
+
+ 0): ?> +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ data-plugin="switchery" class="js-switch" data-color="#039cfd"/> +
+
+
+ +
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + + +
Total CreditsPurchase CostRemaining Credits
0
+ + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
diff --git a/src/public/Views/reseller/enigmas.php b/src/public/Views/reseller/enigmas.php index 0bb11d2b..f74ed667 100644 --- a/src/public/Views/reseller/enigmas.php +++ b/src/public/Views/reseller/enigmas.php @@ -1,7 +1,92 @@ - +
+
+
+
+
+ +
+

+
+
+
+
+
+ + + +
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + +
Public IP
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/epg_view.php b/src/public/Views/reseller/epg_view.php index 44b8d645..d3a8a458 100644 --- a/src/public/Views/reseller/epg_view.php +++ b/src/public/Views/reseller/epg_view.php @@ -1,7 +1,138 @@ +
style="display: none;"> +
+
+
+
+
+ +
+

TV Guide

+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ + +
+
+
+
+
+
+
+
+
+ 0): ?> +
+ + +
+
+
+
+
+
+
+
+
+ NOW +
+
+ + +
+
+
+
+
+
+
+
+
+ 1): ?> +
    + 1): ?> +
  • + +
  • + + 1): ?> +
  • 1
  • + 1): ?> +
  • ...
  • + + + +
  • + + + 1): ?> +
  • ...
  • + +
  • + + +
  • + +
  • + +
+ +
+ + + +
+
+
+
diff --git a/src/public/Views/reseller/episodes.php b/src/public/Views/reseller/episodes.php index ec542d27..83a04e6c 100644 --- a/src/public/Views/reseller/episodes.php +++ b/src/public/Views/reseller/episodes.php @@ -1,7 +1,68 @@ - +
+
+
+
+
+ +
+

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + +
IDImageNameCategoryConnectionsKill
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/line.php b/src/public/Views/reseller/line.php index d0b08cf7..091d6ffa 100644 --- a/src/public/Views/reseller/line.php +++ b/src/public/Views/reseller/line.php @@ -1,7 +1,351 @@ +
+
+
+
+
+
+ +
+

Line

+
+
+
+
+
+ + + + + + + + + + +
+
+
+ + + + + + +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+
+
+
+
+ +
+ +
+ +
+
+ + 0): ?> +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ data-plugin="switchery" class="js-switch" data-color="#039cfd"/> +
+ +
+ data-plugin="switchery" class="js-switch" data-color="#039cfd"/> +
+
+
+ +
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + + +
Total CreditsPurchase CostRemaining Credits
0
+ + + + + + + + + + + + +
ID
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
diff --git a/src/public/Views/reseller/line_activity.php b/src/public/Views/reseller/line_activity.php index 2a740ad9..70cccf14 100644 --- a/src/public/Views/reseller/line_activity.php +++ b/src/public/Views/reseller/line_activity.php @@ -1,7 +1,92 @@ - +
+
+
+
+
+ +
+

Activity Logs

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + +
LineStreamPlayerISPIPStartStopDurationOutput
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/lines.php b/src/public/Views/reseller/lines.php index 628e798c..292e8230 100644 --- a/src/public/Views/reseller/lines.php +++ b/src/public/Views/reseller/lines.php @@ -1,7 +1,131 @@ - +
+
+
+
+
+ +
+

Lines

+
+
+
+
+
+ + + +
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + +
IDUsernamePasswordOwnerStatusOnlineTrialActiveConnectionsExpirationLast ConnectionActions
+
+
+
+
+
+ + + + diff --git a/src/public/Views/reseller/lines.scripts.php b/src/public/Views/reseller/lines.scripts.php new file mode 100644 index 00000000..5e0f9f33 --- /dev/null +++ b/src/public/Views/reseller/lines.scripts.php @@ -0,0 +1,63 @@ + diff --git a/src/public/Views/reseller/live_connections.php b/src/public/Views/reseller/live_connections.php index bd5a3346..0e8ccb8a 100644 --- a/src/public/Views/reseller/live_connections.php +++ b/src/public/Views/reseller/live_connections.php @@ -1,7 +1,131 @@ - +
+
+
+
+
+ +
+

+
+
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+ + +
+ +
+
+ + + + + + + + + + + + + + + + +
IDQualityLineStreamPlayerISPIPDurationOutput
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/login.php b/src/public/Views/reseller/login.php new file mode 100644 index 00000000..6c4e626f --- /dev/null +++ b/src/public/Views/reseller/login.php @@ -0,0 +1,108 @@ + + + + + XC_VM | <?= $language::get('login') ?> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/public/Views/reseller/mag.php b/src/public/Views/reseller/mag.php index 1c357c06..a18bc832 100644 --- a/src/public/Views/reseller/mag.php +++ b/src/public/Views/reseller/mag.php @@ -1,7 +1,368 @@ +
+
+
+
+
+
+ +
+

MAG Device

+
+
+
+
+
+ + + + + + + + + + +
+
+
+ + + + + +
+ +
+
+
+
+
+ +
+ +
+
+ 0): ?> +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ + +
+
+
+ +
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ data-plugin="switchery" class="js-switch" data-color="#039cfd"/> +
+
+
+ +
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+ +
+ + + + + + + + + + + + + + + +
Total CreditsPurchase CostRemaining Credits
0
+ + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
diff --git a/src/public/Views/reseller/mags.php b/src/public/Views/reseller/mags.php index bf37ee13..579c748c 100644 --- a/src/public/Views/reseller/mags.php +++ b/src/public/Views/reseller/mags.php @@ -1,7 +1,92 @@ - +
+
+
+
+
+ +
+

+
+
+
+
+
+ + + +
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + +
Device
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/movies.php b/src/public/Views/reseller/movies.php index a6ce66a3..83de28b7 100644 --- a/src/public/Views/reseller/movies.php +++ b/src/public/Views/reseller/movies.php @@ -1,7 +1,58 @@ - +
+
+
+
+
+ +
+

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + +
IDImageNameCategoryConnectionsKill
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/radios.php b/src/public/Views/reseller/radios.php index f61733a9..f124a601 100644 --- a/src/public/Views/reseller/radios.php +++ b/src/public/Views/reseller/radios.php @@ -1,7 +1,58 @@ - +
+
+
+
+
+ +
+

Radio Stations

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + +
IDIconNameCategoryConnectionsKill
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/streams.php b/src/public/Views/reseller/streams.php index 3f10743b..85b68c9b 100644 --- a/src/public/Views/reseller/streams.php +++ b/src/public/Views/reseller/streams.php @@ -1,7 +1,58 @@ - +
+
+
+
+
+ +
+

Streams

+
+
+
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + +
IDIconNameCategoryConnectionsKill
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/ticket.php b/src/public/Views/reseller/ticket.php index eaa07d41..60d03fd2 100644 --- a/src/public/Views/reseller/ticket.php +++ b/src/public/Views/reseller/ticket.php @@ -1,7 +1,68 @@ - +
+
+
+
+
+ +
+ +

Ticket Response

+ +

Create Ticket

+ +
+
+
+
+
+
+
+
+ + + +
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+
    +
  • + +
  • +
+
+
+
+
+
+
+
+
+
+ diff --git a/src/public/Views/reseller/ticket_view.php b/src/public/Views/reseller/ticket_view.php index 7cabe1f1..f12b312e 100644 --- a/src/public/Views/reseller/ticket_view.php +++ b/src/public/Views/reseller/ticket_view.php @@ -1,7 +1,33 @@ - +
+
+
+
+
+ +
+

+
+
+
+
+
+
+ +
+
+
+ + +

+

+

+
+
+
+ +
+
+
+
+ diff --git a/src/public/Views/reseller/tickets.php b/src/public/Views/reseller/tickets.php index 0efdf02c..0bbe0d29 100644 --- a/src/public/Views/reseller/tickets.php +++ b/src/public/Views/reseller/tickets.php @@ -1,7 +1,58 @@ - +
+
+
+
+
+ +
+

Tickets

+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
IDResellerSubjectStatusCreated DateLast ReplyAction
+ +
+
+
+
+
+ diff --git a/src/reseller/topbar.php b/src/public/Views/reseller/topbar.php similarity index 96% rename from src/reseller/topbar.php rename to src/public/Views/reseller/topbar.php index 0e56bc4a..fb96fedc 100644 --- a/src/reseller/topbar.php +++ b/src/public/Views/reseller/topbar.php @@ -118,7 +118,7 @@ if (count(get_included_files()) != 1) { default: echo '
'; - if (!(!$rMobile && (!$rDropdown[$rPage][array_keys($rDropdown[$rPage])[0]][1] || Authorization::hasResellerPermissions($rDropdown[$rPage][array_keys($rDropdown[$rPage])[0]][1])) && 0 < strlen(array_keys($rDropdown[$rPage])[0]))) { + if (!isset($rDropdown[$rPage]) || !is_array($rDropdown[$rPage]) || !(!$rMobile && (!$rDropdown[$rPage][array_keys($rDropdown[$rPage])[0]][1] || Authorization::hasResellerPermissions($rDropdown[$rPage][array_keys($rDropdown[$rPage])[0]][1])) && 0 < strlen(array_keys($rDropdown[$rPage])[0]))) { } else { if ($rDropdown[$rPage][array_keys($rDropdown[$rPage])[0]][0]) { echo "'; diff --git a/src/public/Views/reseller/user.php b/src/public/Views/reseller/user.php index e6471b29..3364fe63 100644 --- a/src/public/Views/reseller/user.php +++ b/src/public/Views/reseller/user.php @@ -1,7 +1,196 @@ +
+
+
+
+
+
+ +
+

User

+
+
+
+
+
+ + + + +
+
+
+ + + +
+ +
+
+
+
+
+ +
+ type="text" class="form-control" id="username" name="username" value="" required data-parsley-trigger="change"> +
+
+ +
+ +
+ value="" data-indicator="pwindicator"> +
+
+
+
+
+
+ + 0): ?> +
+ +
+ +
+
+ + 1): ?> +
+ +
+ +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
    + +
  • + +
  • + +
  • + Next +
  • + +
+
+ +
+
+
+ + + +
+ + + + + + + + + + + + + + + +
Total CreditsPurchase CostRemaining Credits
+
+
+
+
    +
  • + Previous +
  • +
  • + name="submit_user" type="submit" class="btn btn-primary purchase" value="Purchase" /> +
  • +
+
+ +
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/user_logs.php b/src/public/Views/reseller/user_logs.php index 20ba666b..85192b01 100644 --- a/src/public/Views/reseller/user_logs.php +++ b/src/public/Views/reseller/user_logs.php @@ -1,7 +1,78 @@ - +
+
+
+
+
+ +
+

Reseller Logs

+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + +
IDResellerLine / UserActionCostCredits RemainingDate
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/users.php b/src/public/Views/reseller/users.php index 848fd02c..a952efd0 100644 --- a/src/public/Views/reseller/users.php +++ b/src/public/Views/reseller/users.php @@ -1,7 +1,65 @@ - +
+
+
+
+
+ +
+

Users

+
+
+
+
+
+ + + +
+
+
+
+ +
+ +
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + +
IDUsernameOwnerIPStatusCredits# of LinesLast LoginActions
+
+
+
+
+
+ diff --git a/src/reseller/assets b/src/public/assets/admin similarity index 100% rename from src/reseller/assets rename to src/public/assets/admin diff --git a/src/public/assets/reseller b/src/public/assets/reseller new file mode 120000 index 00000000..e05312fc --- /dev/null +++ b/src/public/assets/reseller @@ -0,0 +1 @@ +/home/xc_vm/public/assets/admin \ No newline at end of file diff --git a/src/public/index.php b/src/public/index.php index 2c3b1e54..0b880491 100644 --- a/src/public/index.php +++ b/src/public/index.php @@ -219,20 +219,48 @@ $cwdTarget = is_dir($adminDir) ? $adminDir : MAIN_HOME; // Поддерживаем legacy относительные include внутри admin/reseller файлов // (некоторые страницы всё ещё используют include 'header.php' и т.п.). @chdir($cwdTarget); -$sessionFile = $adminDir . 'session.php'; + +// Для reseller scope: bootstrap из infrastructure/bootstrap/ +if ($scope === 'reseller') { + $sessionFile = MAIN_HOME . 'infrastructure/bootstrap/reseller_session.php'; + $functionsFile = MAIN_HOME . 'infrastructure/bootstrap/reseller_functions.php'; +} else { + $sessionFile = $adminDir . 'session.php'; + $functionsFile = $adminDir . 'functions.php'; +} // Некоторые страницы пропускают bootstrap (login, setup, database) $noBootstrapPages = ['login', 'setup', 'database', 'index']; // ───────────────────────────────────────────────────────────────── -// 4a. Страницы без bootstrap → сразу legacy fallback +// 4a. Страницы без bootstrap // ───────────────────────────────────────────────────────────────── // // login, setup, database, index — имеют свой собственный bootstrap. -// Автозагрузчик и Router ещё не доступны → идём напрямую в legacy файл. +// +// Admin: legacy fallback — загружает файл напрямую. +// Reseller: маршрутизация через Router (контроллеры обрабатывают сами). // ───────────────────────────────────────────────────────────────── if (in_array($pageName, $noBootstrapPages, true)) { + if ($scope === 'reseller') { + // Reseller login/index: загружаем autoloader для Router, без session bootstrap + require_once MAIN_HOME . 'includes/admin.php'; + if (session_status() === PHP_SESSION_NONE && !headers_sent()) { + session_start(); + } + $router = Router::getInstance(); + require_once __DIR__ . '/routes/reseller.php'; + $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; + if ($router->dispatch($pageName, $method)) { + exit; + } + http_response_code(404); + echo '404 Not Found'; + exit; + } + + // Admin: legacy fallback $legacyFile = $adminDir . $pageName . '.php'; if (file_exists($legacyFile)) { require $legacyFile; @@ -256,7 +284,6 @@ if (file_exists($sessionFile)) { require $sessionFile; } -$functionsFile = $adminDir . 'functions.php'; if (file_exists($functionsFile)) { require $functionsFile; } @@ -266,7 +293,7 @@ if (file_exists($functionsFile)) { // ───────────────────────────────────────────────────────────────── $router = Router::getInstance(); -$routesDir = dirname(__DIR__) . '/routes/'; +$routesDir = __DIR__ . '/routes/'; // Загружаем маршруты для текущего scope $routeFile = $routesDir . $scope . '.php'; @@ -286,7 +313,12 @@ if (file_exists($apiRouteFile)) { $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; -// API-запросы: /admin/api?action=... обрабатываются отдельно +// Страничные маршруты (reseller: api/table/post и прочие идут сюда) +if ($router->dispatch($pageName, $method)) { + exit; // Router обработал запрос +} + +// API-запросы: /admin/api?action=... обрабатываются отдельно (admin legacy) if ($pageName === 'api' && !empty($_REQUEST['action'])) { $action = $_REQUEST['action']; @@ -304,11 +336,6 @@ if ($pageName === 'api' && !empty($_REQUEST['action'])) { Response::jsonError('Unknown action: ' . $action, 404); } -// Страничные маршруты: /admin/dashboard, /admin/streams и т.д. -if ($router->dispatch($pageName, $method)) { - exit; // Router обработал запрос -} - // ───────────────────────────────────────────────────────────────── // 7. Fallback — legacy include // ───────────────────────────────────────────────────────────────── diff --git a/src/public/routes/reseller.php b/src/public/routes/reseller.php index a0d4617d..5efe3b10 100644 --- a/src/public/routes/reseller.php +++ b/src/public/routes/reseller.php @@ -15,6 +15,20 @@ $router->get('dashboard', [ResellerDashboardController::class, 'index']); $router->get('edit_profile', [ResellerEditProfileController::class, 'index']); +$router->get('logout', [ResellerLogoutController::class, 'index']); +$router->get('session', [ResellerSessionController::class, 'index']); + +// ─── Auth & Infrastructure ───────────────────────────────────── + +$router->get('login', [ResellerLoginController::class, 'index']); +$router->post('login', [ResellerLoginController::class, 'index']); +$router->get('index', [ResellerLoginController::class, 'index']); +$router->post('post', [ResellerPostController::class, 'index']); +$router->get('api', [ResellerApiController::class, 'index']); +$router->post('api', [ResellerApiController::class, 'index']); +$router->get('table', [ResellerTableController::class, 'index']); +$router->post('table', [ResellerTableController::class, 'index']); +$router->get('resize', [ResellerResizeController::class, 'index']); // ─── Lines (Phase 6.4) ───────────────────────────────────────── diff --git a/src/reseller/api.php b/src/reseller/api.php deleted file mode 100644 index 322323b5..00000000 --- a/src/reseller/api.php +++ /dev/null @@ -1,997 +0,0 @@ - false)); - } else { - if (isset($rUserInfo['reports'])) { - } else { - echo json_encode(array('result' => false)); - } - } - - if (!isset(RequestManager::getAll()['action'])) { - } else { - if (RequestManager::getAll()['action'] == 'dashboard') { - $rReturn = array('open_connections' => 0, 'online_users' => 0, 'active_accounts' => 0, 'credits' => 0, 'credits_assigned' => 0); - - if (SettingsManager::getAll()['redis_handler']) { - $rReports = array(); - $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - - foreach ($db->get_rows() as $rRow) { - $rReports[] = $rRow['id']; - } - - if (0 >= count($rReports)) { - } else { - foreach (ConnectionTracker::getUserConnections($rReports, true) as $rUserID => $rConnections) { - $rReturn['open_connections'] += $rConnections; - - if (0 >= $rConnections) { - } else { - $rReturn['online_users']++; - } - } - } - } else { - $db->query('SELECT COUNT(`activity_id`) AS `count` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rReturn['open_connections'] = ($db->get_row()['count'] ?: 0); - $db->query('SELECT `activity_id` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') GROUP BY `lines_live`.`user_id`;'); - $rReturn['online_users'] = $db->num_rows(); - } - - $db->query('SELECT COUNT(`id`) AS `count` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rReturn['active_accounts'] = ($db->get_row()['count'] ?: 0); - $db->query('SELECT SUM(`credits`) AS `credits` FROM `users` WHERE `id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rReturn['credits'] = ($db->get_row()['credits'] ?: 0); - $rReturn['credits_assigned'] = ($rReturn['credits'] - intval($rUserInfo['credits']) ?: 0); - echo json_encode($rReturn); - - exit(); - } else { - if (RequestManager::getAll()['action'] == 'connections') { - if ($rPermissions['reseller_client_connection_logs']) { - $rStreamID = RequestManager::getAll()['stream_id']; - $rSub = RequestManager::getAll()['sub']; - - if ($rSub == 'purge') { - if (SettingsManager::getAll()['redis_handler']) { - $rReports = array(); - $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - - foreach ($db->get_rows() as $rRow) { - $rReports[] = $rRow['id']; - } - $rConnections = ConnectionTracker::getRedisConnections(null, null, $rStreamID, true, false, false, false); - - foreach ($rConnections as $rConnection) { - if (!in_array($rConnection['user_id'], $rReports)) { - } else { - ConnectionTracker::closeConnection($rConnection); - } - } - } else { - $db->query('SELECT `lines_live`.* FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `lines_live`.`stream_id` = ? AND `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');', $rStreamID); - - foreach ($db->get_rows() as $rRow) { - ConnectionTracker::closeConnection($rRow); - } - } - - echo json_encode(array('result' => true)); - - exit(); - } else { - echo json_encode(array('result' => false)); - - exit(); - } - } else { - exit(); - } - } else { - if (RequestManager::getAll()['action'] == 'line') { - if ($rPermissions['create_line']) { - $rSub = RequestManager::getAll()['sub']; - $rUserID = intval(RequestManager::getAll()['user_id']); - $rLine = UserRepository::getLineById($rUserID); - - if (Authorization::check('line', $rUserID) && $rLine) { - if ($rSub == 'delete') { - deleteLine($rUserID); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rLine)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'enable') { - $db->query('UPDATE `lines` SET `enabled` = 1 WHERE `id` = ?;', $rUserID); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rLine)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'disable') { - $db->query('UPDATE `lines` SET `enabled` = 0 WHERE `id` = ?;', $rUserID); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rLine)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'reset_isp') { - $db->query("UPDATE `lines` SET `isp_desc` = '', `as_number` = NULL WHERE `id` = ?;", $rUserID); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'kill_line') { - if ($rPermissions['reseller_client_connection_logs']) { - if (SettingsManager::getAll()['redis_handler']) { - foreach (ConnectionTracker::getUserConnections(array($rUserID), false)[$rUserID] as $rConnection) { - ConnectionTracker::closeConnection($rConnection); - } - } else { - $db->query('SELECT * FROM `lines_live` WHERE `user_id` = ?;', $rUserID); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rRow) { - ConnectionTracker::closeConnection($rRow); - } - } - } - - echo json_encode(array('result' => true)); - - exit(); - } else { - exit(); - } - } else { - echo json_encode(array('result' => false)); - - exit(); - } - } else { - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } else { - exit(); - } - } else { - if (RequestManager::getAll()['action'] == 'line_activity') { - if ($rPermissions['reseller_client_connection_logs']) { - $rSub = RequestManager::getAll()['sub']; - - if ($rSub != 'kill') { - } else { - if (SettingsManager::getAll()['redis_handler']) { - if (!($rActivityInfo = igbinary_unserialize(RedisManager::instance()->get(RequestManager::getAll()['uuid'])))) { - } else { - if (Authorization::check('line', $rActivityInfo['user_id'])) { - ConnectionTracker::closeConnection($rActivityInfo); - echo json_encode(array('result' => true)); - - exit(); - } - - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } else { - $db->query('SELECT * FROM `lines_live` WHERE `uuid` = ? LIMIT 1;', RequestManager::getAll()['uuid']); - - if ($db->num_rows() != 1) { - } else { - $rRow = $db->get_row(); - - if (Authorization::check('line', $rRow['user_id'])) { - ConnectionTracker::closeConnection($rRow); - echo json_encode(array('result' => true)); - - exit(); - } - - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'adjust_credits') { - if ($rPermissions['create_sub_resellers']) { - if (Authorization::check('user', RequestManager::getAll()['id'])) { - $rUser = UserRepository::getRegisteredUserById(RequestManager::getAll()['id']); - - if (!($rUser && is_numeric(RequestManager::getAll()['credits']))) { - } else { - $rOwnerCredits = intval($rUserInfo['credits']) - intval(RequestManager::getAll()['credits']); - $rCredits = intval($rUser['credits']) + intval(RequestManager::getAll()['credits']); - - if (!(0 <= $rCredits && 0 <= $rOwnerCredits)) { - } else { - $db->query('UPDATE `users` SET `credits` = ? WHERE `id` = ?;', $rOwnerCredits, $rUserInfo['id']); - $db->query('UPDATE `users` SET `credits` = ? WHERE `id` = ?;', $rCredits, $rUser['id']); - $db->query('INSERT INTO `users_credits_logs`(`target_id`, `admin_id`, `amount`, `date`, `reason`) VALUES(?, ?, ?, ?, ?);', $rUser['id'], $rUserInfo['id'], RequestManager::getAll()['credits'], time(), RequestManager::getAll()['reason']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'adjust_credits', RequestManager::getAll()['id'], intval(RequestManager::getAll()['credits']), $rOwnerCredits, time(), json_encode($rUser)); - echo json_encode(array('result' => true)); - - exit(); - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'reg_user') { - if ($rPermissions['create_sub_resellers']) { - if (Authorization::check('user', RequestManager::getAll()['user_id'])) { - $rSub = RequestManager::getAll()['sub']; - $rUser = UserRepository::getRegisteredUserById(RequestManager::getAll()['user_id']); - - if ($rSub == 'delete') { - if ($rPermissions['delete_users']) { - $rOwnerCredits = intval($rUserInfo['credits']) + intval($rUser['credits']); - $db->query('UPDATE `users` SET `credits` = ? WHERE `id` = ?;', $rOwnerCredits, $rUserInfo['id']); - deleteUser(RequestManager::getAll()['user_id'], false, false, $rUserInfo['id']); - $db->query('INSERT INTO `users_credits_logs`(`target_id`, `admin_id`, `amount`, `date`, `reason`) VALUES(?, ?, ?, ?, ?);', $rUserInfo['id'], $rUserInfo['id'], intval($rUser['credits']), time(), 'Deleted user: ' . $rUser['username']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['user_id'], intval($rUser['credits']), $rOwnerCredits, time(), json_encode($rUser)); - echo json_encode(array('result' => true)); - - exit(); - } - - exit(); - } - - if ($rSub == 'enable') { - $db->query('UPDATE `users` SET `status` = 1 WHERE `id` = ?;', RequestManager::getAll()['user_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rUser)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub != 'disable') { - echo json_encode(array('result' => false)); - - exit(); - } - - $db->query('UPDATE `users` SET `status` = 0 WHERE `id` = ?;', RequestManager::getAll()['user_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'user', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['user_id'], 0, $rUserInfo['credits'], time(), json_encode($rUser)); - echo json_encode(array('result' => true)); - - exit(); - } - - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'ticket') { - $rTicket = getTicket(RequestManager::getAll()['ticket_id']); - - if (!$rTicket) { - } else { - if (Authorization::check('user', $rTicket['member_id'])) { - $rSub = RequestManager::getAll()['sub']; - - if ($rSub == 'close') { - $db->query('UPDATE `tickets` SET `status` = 0 WHERE `id` = ?;', RequestManager::getAll()['ticket_id']); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub != 'reopen') { - } else { - if ($rTicket['member_id'] != $rUserInfo['id']) { - $db->query('UPDATE `tickets` SET `status` = 1 WHERE `id` = ?;', RequestManager::getAll()['ticket_id']); - echo json_encode(array('result' => true)); - - exit(); - } - - exit(); - } - } else { - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - if (RequestManager::getAll()['action'] == 'mag') { - if ($rPermissions['create_mag']) { - $rSub = RequestManager::getAll()['sub']; - $rMagDetails = getMag(intval(RequestManager::getAll()['mag_id'])); - - if (!$rMagDetails) { - } else { - if (Authorization::check('line', $rMagDetails['user_id'])) { - if ($rSub == 'delete') { - deleteMAG(RequestManager::getAll()['mag_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'enable') { - $db->query('UPDATE `lines` SET `enabled` = 1 WHERE `id` = ?;', $rMagDetails['user_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'disable') { - $db->query('UPDATE `lines` SET `enabled` = 0 WHERE `id` = ?;', $rMagDetails['user_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'convert') { - deleteMAG(RequestManager::getAll()['mag_id'], false, false, true); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'convert', $rMagDetails['user']['id'], 0, $rUserInfo['credits'], time(), json_encode($rMagDetails['user'])); - echo json_encode(array('result' => true, 'line_id' => $rMagDetails['user']['id'])); - - exit(); - } - - if ($rSub == 'reset_isp') { - $db->query("UPDATE `lines` SET `isp_desc` = '', `as_number` = NULL WHERE `id` = ?;", $rMagDetails['user']['id']); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub != 'kill_line') { - } else { - if ($rPermissions['reseller_client_connection_logs']) { - if (SettingsManager::getAll()['redis_handler']) { - foreach (ConnectionTracker::getUserConnections(array($rMagDetails['user_id']), false)[$rMagDetails['user_id']] as $rConnection) { - ConnectionTracker::closeConnection($rConnection); - } - } else { - $db->query('SELECT * FROM `lines_live` WHERE `user_id` = ?;', $rMagDetails['user_id']); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rRow) { - ConnectionTracker::closeConnection($rRow); - } - } - } - - echo json_encode(array('result' => true)); - - exit(); - } else { - exit(); - } - } - } else { - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'enigma') { - if ($rPermissions['create_enigma']) { - $rSub = RequestManager::getAll()['sub']; - $rE2Details = getEnigma(intval(RequestManager::getAll()['e2_id'])); - - if (!$rE2Details) { - } else { - if (Authorization::check('line', $rE2Details['user_id'])) { - if ($rSub == 'delete') { - deleteEnigma(RequestManager::getAll()['e2_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'enigma', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'delete', RequestManager::getAll()['e2_id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'enable') { - $db->query('UPDATE `lines` SET `enabled` = 1 WHERE `id` = ?;', $rE2Details['user_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'enigma', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'enable', RequestManager::getAll()['e2_id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'disable') { - $db->query('UPDATE `lines` SET `enabled` = 0 WHERE `id` = ?;', $rE2Details['user_id']); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'enigma', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'disable', RequestManager::getAll()['e2_id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details)); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub == 'convert') { - deleteEnigma(RequestManager::getAll()['e2_id'], false, false, true); - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'line', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'convert', $rE2Details['user']['id'], 0, $rUserInfo['credits'], time(), json_encode($rE2Details['user'])); - echo json_encode(array('result' => true, 'line_id' => $rE2Details['user']['id'])); - - exit(); - } - - if ($rSub == 'reset_isp') { - $db->query("UPDATE `lines` SET `isp_desc` = '', `as_number` = NULL WHERE `id` = ?;", $rE2Details['user']['id']); - echo json_encode(array('result' => true)); - - exit(); - } - - if ($rSub != 'kill_line') { - } else { - if ($rPermissions['reseller_client_connection_logs']) { - if (SettingsManager::getAll()['redis_handler']) { - foreach (ConnectionTracker::getUserConnections(array($rMagDetails['user_id']), false)[$rE2Details['user_id']] as $rConnection) { - ConnectionTracker::closeConnection($rConnection); - } - } else { - $db->query('SELECT * FROM `lines_live` WHERE `user_id` = ?;', $rE2Details['user_id']); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rRow) { - ConnectionTracker::closeConnection($rRow); - } - } - } - - echo json_encode(array('result' => true)); - - exit(); - } else { - exit(); - } - } - } else { - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'get_package') { - $rReturn = array(); - $rOverride = json_decode($rUserInfo['override_packages'], true); - $db->query('SELECT `id`, `bouquets`, `official_credits` AS `cost_credits`, `official_duration`, `official_duration_in`, `max_connections`, `check_compatible`, `is_isplock` FROM `users_packages` WHERE `id` = ?;', RequestManager::getAll()['package_id']); - - if ($db->num_rows() == 1) { - $rData = $db->get_row(); - - if (!(isset($rOverride[$rData['id']]['official_credits']) && 0 < strlen($rOverride[$rData['id']]['official_credits']))) { - } else { - $rData['cost_credits'] = $rOverride[$rData['id']]['official_credits']; - } - - if (isset(RequestManager::getAll()['orig_id']) && $rData['check_compatible']) { - $rData['compatible'] = checkCompatible(RequestManager::getAll()['package_id'], RequestManager::getAll()['orig_id']); - } else { - $rData['compatible'] = true; - } - - $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['official_duration']) . ' ' . $rData['official_duration_in'])); - - if (!(isset(RequestManager::getAll()['user_id']) && $rData['compatible'])) { - } else { - if (!($rUser = UserRepository::getLineById(RequestManager::getAll()['user_id']))) { - } else { - if (time() < $rUser['exp_date']) { - $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['official_duration']) . ' ' . $rData['official_duration_in'], $rUser['exp_date'])); - } else { - $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['official_duration']) . ' ' . $rData['official_duration_in'])); - } - } - } - - foreach (json_decode($rData['bouquets'], true) as $rBouquet) { - $db->query('SELECT * FROM `bouquets` WHERE `id` = ?;', $rBouquet); - - if ($db->num_rows() != 1) { - } else { - $rRow = $db->get_row(); - $rReturn[] = array('id' => $rRow['id'], 'bouquet_name' => str_replace("'", "\\'", $rRow['bouquet_name']), 'bouquet_channels' => json_decode($rRow['bouquet_channels'], true), 'bouquet_radios' => json_decode($rRow['bouquet_radios'], true), 'bouquet_movies' => json_decode($rRow['bouquet_movies'], true), 'bouquet_series' => json_decode($rRow['bouquet_series'], true)); - } - } - $rData['duration'] = $rData['official_duration'] . ' ' . $rData['official_duration_in']; - echo json_encode(array('result' => true, 'bouquets' => $rReturn, 'data' => $rData)); - } else { - echo json_encode(array('result' => false)); - } - - exit(); - } else { - if (RequestManager::getAll()['action'] == 'get_package_trial') { - $rReturn = array(); - $db->query('SELECT `bouquets`, `trial_credits` AS `cost_credits`, `trial_duration`, `trial_duration_in`, `max_connections`, `is_isplock` FROM `users_packages` WHERE `id` = ?;', RequestManager::getAll()['package_id']); - - if ($db->num_rows() == 1) { - $rData = $db->get_row(); - $rData['exp_date'] = date('Y-m-d H:i', strtotime('+' . intval($rData['trial_duration']) . ' ' . $rData['trial_duration_in'])); - - foreach (json_decode($rData['bouquets'], true) as $rBouquet) { - $db->query('SELECT * FROM `bouquets` WHERE `id` = ?;', $rBouquet); - - if ($db->num_rows() != 1) { - } else { - $rRow = $db->get_row(); - $rReturn[] = array('id' => $rRow['id'], 'bouquet_name' => str_replace("'", "\\'", $rRow['bouquet_name']), 'bouquet_channels' => json_decode($rRow['bouquet_channels'], true), 'bouquet_radios' => json_decode($rRow['bouquet_radios'], true), 'bouquet_movies' => json_decode($rRow['bouquet_movies'], true), 'bouquet_series' => json_decode($rRow['bouquet_series'], true)); - } - } - $rData['duration'] = $rData['trial_duration'] . ' ' . $rData['trial_duration_in']; - $rData['compatible'] = true; - echo json_encode(array('result' => true, 'bouquets' => $rReturn, 'data' => $rData)); - } else { - echo json_encode(array('result' => false)); - } - - exit(); - } else { - if (RequestManager::getAll()['action'] == 'header_stats') { - $rReturn = array('total_connections' => 0, 'total_users' => 0); - - if (SettingsManager::getAll()['redis_handler']) { - $rReports = array(); - $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - - foreach ($db->get_rows() as $rRow) { - $rReports[] = $rRow['id']; - } - - if (0 >= count($rReports)) { - } else { - foreach (ConnectionTracker::getUserConnections($rReports, true) as $rUserID => $rConnections) { - $rReturn['total_connections'] += $rConnections; - - if (0 >= $rConnections) { - } else { - $rReturn['total_users']++; - } - } - } - } else { - $db->query('SELECT COUNT(`activity_id`) AS `count` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rReturn['total_connections'] = ($db->get_row()['count'] ?: 0); - $db->query('SELECT `activity_id` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') GROUP BY `lines_live`.`user_id`;'); - $rReturn['total_users'] = $db->num_rows(); - } - - echo json_encode($rReturn, JSON_PARTIAL_OUTPUT_ON_ERROR); - - exit(); - } else { - if (RequestManager::getAll()['action'] == 'stats') { - $rReturn = array('open_connections' => 0, 'online_users' => 0, 'total_lines' => 0, 'total_users' => 0, 'owner_credits' => 0, 'user_credits' => 0, 'total_credits' => 0); - $rUptime = 0; - - if (SettingsManager::getAll()['redis_handler']) { - $rReports = array(); - $db->query('SELECT `id` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - - foreach ($db->get_rows() as $rRow) { - $rReports[] = $rRow['id']; - } - - if (0 >= count($rReports)) { - } else { - foreach (ConnectionTracker::getUserConnections($rReports, true) as $rUserID => $rConnections) { - $rReturn['open_connections'] += $rConnections; - - if (0 >= $rConnections) { - } else { - $rReturn['online_users']++; - } - } - } - } else { - $db->query('SELECT COUNT(`activity_id`) AS `count` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rReturn['open_connections'] = ($db->get_row()['count'] ?: 0); - $db->query('SELECT `activity_id` FROM `lines_live` LEFT JOIN `lines` ON `lines`.`id` = `lines_live`.`user_id` WHERE `hls_end` = 0 AND `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') GROUP BY `lines_live`.`user_id`;'); - $rReturn['online_users'] = $db->num_rows(); - } - - $db->query('SELECT COUNT(*) AS `count` FROM `lines` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rReturn['total_lines'] = $db->get_row()['count']; - $db->query('SELECT COUNT(*) AS `count`, SUM(`credits`) AS `credits` FROM `users` WHERE `owner_id` IN (' . implode(',', $rUserInfo['reports']) . ');'); - $rRow = $db->get_row(); - $rReturn['total_users'] = $rRow['count']; - $rReturn['user_credits'] = $rRow['credits']; - $rReturn['owner_credits'] = $rUserInfo['credits']; - $rReturn['total_credits'] = $rReturn['owner_credits'] + $rReturn['user_credits']; - echo json_encode($rReturn); - - exit(); - } else { - if (RequestManager::getAll()['action'] == 'userlist') { - $rReturn = array('total_count' => 0, 'items' => array(), 'result' => true); - - if (!isset(RequestManager::getAll()['search'])) { - } else { - if (isset(RequestManager::getAll()['page'])) { - $rPage = intval(RequestManager::getAll()['page']); - } else { - $rPage = 1; - } - - $db->query('SELECT COUNT(`id`) AS `id` FROM `lines` LEFT JOIN `mag_devices` ON `mag_devices`.`user_id` = `lines`.`id` LEFT JOIN `enigma2_devices` ON `enigma2_devices`.`user_id` = `lines`.`id` WHERE `lines`.`member_id` IN (' . implode(',', $rUserInfo['reports']) . ') AND (`lines`.`username` LIKE ? OR `mag_devices`.`mac` LIKE ? OR `enigma2_devices`.`mac` LIKE ?);', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%'); - $rReturn['total_count'] = $db->get_row()['id']; - $db->query('SELECT `id`, IF(`lines`.`is_mag`, `mag_devices`.`mac`, IF(`lines`.`is_e2`, `enigma2_devices`.`mac`, `lines`.`username`)) AS `username` FROM `lines` LEFT JOIN `mag_devices` ON `mag_devices`.`user_id` = `lines`.`id` LEFT JOIN `enigma2_devices` ON `enigma2_devices`.`user_id` = `lines`.`id` WHERE `member_id` IN (' . implode(',', $rUserInfo['reports']) . ') AND (`lines`.`username` LIKE ? OR `mag_devices`.`mac` LIKE ? OR `enigma2_devices`.`mac` LIKE ?) ORDER BY `username` ASC LIMIT ' . ($rPage - 1) * 100 . ', 100;', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%', '%' . RequestManager::getAll()['search'] . '%'); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rRow) { - $rReturn['items'][] = array('id' => $rRow['id'], 'text' => $rRow['username']); - } - } - } - - echo json_encode($rReturn); - - exit(); - } - - if (RequestManager::getAll()['action'] == 'send_event') { - if ($rPermissions['create_mag']) { - $rData = json_decode(RequestManager::getAll()['data'], true); - $rMag = getMag($rData['id']); - - if (!$rMag) { - } else { - if (Authorization::check('line', $rMag['user_id'])) { - if ($rData['type'] == 'send_msg') { - $rData['need_confirm'] = 1; - } else { - if ($rData['type'] == 'play_channel') { - $rData['need_confirm'] = 0; - $rData['reboot_portal'] = 0; - $rData['message'] = intval($rData['channel']); - } else { - if ($rData['type'] == 'reset_stb_lock') { - resetSTB($rData['id']); - echo json_encode(array('result' => true)); - - exit(); - } - - $rData['need_confirm'] = 0; - $rData['reboot_portal'] = 0; - $rData['message'] = ''; - } - } - - if (!$db->query('INSERT INTO `mag_events`(`status`, `mag_device_id`, `event`, `need_confirm`, `msg`, `reboot_after_ok`, `send_time`) VALUES (0, ?, ?, ?, ?, ?, ?);', $rData['id'], $rData['type'], $rData['need_confirm'], $rData['message'], $rData['reboot_portal'], time())) { - } else { - $db->query("INSERT INTO `users_logs`(`owner`, `type`, `action`, `log_id`, `package_id`, `cost`, `credits_after`, `date`, `deleted_info`) VALUES(?, 'mag', ?, ?, null, ?, ?, ?, ?);", $rUserInfo['id'], 'send_event', $rMag['mag_id'], 0, $rUserInfo['credits'], time(), json_encode($rMag)); - echo json_encode(array('result' => true)); - - exit(); - } - } else { - echo json_encode(array('result' => false, 'error' => 'No permissions.')); - - exit(); - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'streamlist') { - if ($rPermissions['create_mag'] || $rPermissions['can_view_vod'] || $rPermissions['reseller_client_connection_logs']) { - $rReturn = array('total_count' => 0, 'items' => array(), 'result' => true); - - if (!isset(RequestManager::getAll()['search'])) { - } else { - if (isset(RequestManager::getAll()['page'])) { - $rPage = intval(RequestManager::getAll()['page']); - } else { - $rPage = 1; - } - - $db->query('SELECT COUNT(`id`) AS `id` FROM `streams` WHERE `stream_display_name` LIKE ? AND `id` IN (' . implode(',', array_map('intval', $rPermissions['stream_ids'])) . ');', '%' . RequestManager::getAll()['search'] . '%'); - $rReturn['total_count'] = $db->get_row()['id']; - $db->query('SELECT `id`, `stream_display_name` FROM `streams` WHERE `id` IN (' . implode(',', array_map('intval', $rPermissions['stream_ids'])) . ') AND `stream_display_name` LIKE ? ORDER BY `stream_display_name` ASC LIMIT ' . ($rPage - 1) * 100 . ', 100;', '%' . RequestManager::getAll()['search'] . '%'); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rRow) { - $rReturn['items'][] = array('id' => $rRow['id'], 'text' => $rRow['stream_display_name']); - } - } - } - - echo json_encode($rReturn); - - exit(); - } - - exit(); - } - - if (RequestManager::getAll()['action'] == 'ip_whois') { - $rIP = RequestManager::getAll()['ip']; - $rReader = new MaxMind\Db\Reader(GEOLITE2C_BIN); - $rResponse = $rReader->get($rIP); - - if (!isset($rResponse['location']['time_zone'])) { - } else { - $rDate = new DateTime('now', new DateTimeZone($rResponse['location']['time_zone'])); - $rResponse['location']['time'] = $rDate->format('Y-m-d H:i:s'); - } - - $rReader->close(); - - if (!isset(RequestManager::getAll()['isp'])) { - } else { - $rReader = new MaxMind\Db\Reader(GEOISP_BIN); - $rResponse['isp'] = $rReader->get($rIP); - $rReader->close(); - } - - $rResponse['type'] = null; - - if (!$rResponse['isp']['autonomous_system_number']) { - } else { - $db->query('SELECT `type` FROM `blocked_asns` WHERE `asn` = ?;', $rResponse['isp']['autonomous_system_number']); - - if (0 >= $db->num_rows()) { - } else { - $rResponse['type'] = $db->get_row()['type']; - } - } - - echo json_encode(array('result' => true, 'data' => $rResponse)); - - exit(); - } - - if (RequestManager::getAll()['action'] == 'get_epg') { - if ($rPermissions['can_view_vod']) { - if (count($rPermissions['stream_ids']) != 0) { - $rTimezone = (RequestManager::getAll()['timezone'] ?: 'Europe/London'); - date_default_timezone_set($rTimezone); - $rReturn = array('Channels' => array()); - $rChannels = array_map('intval', explode(',', RequestManager::getAll()['channels'])); - - if (count($rChannels) != 0) { - $rHours = (intval(RequestManager::getAll()['hours']) ?: 3); - $rStartDate = (intval(strtotime(RequestManager::getAll()['startdate'])) ?: time()); - $rFinishDate = $rStartDate + $rHours * 3600; - $rPerUnit = floatval(100 / ($rHours * 60)); - $rChannelsSort = $rChannels; - sort($rChannelsSort); - $rListings = array(); - - if (0 >= count($rChannels)) { - } else { - $rArchiveInfo = array(); - $db->query('SELECT `id`, `tv_archive_server_id`, `tv_archive_duration` FROM `streams` WHERE `id` IN (' . implode(',', $rChannels) . ');'); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rRow) { - $rArchiveInfo[$rRow['id']] = $rRow; - } - } - - $rEPG = EpgService::getStreamsEpg($rChannels, $rStartDate, $rFinishDate); - - foreach ($rEPG as $rChannelID => $rEPGData) { - $rFullSize = 0; - - foreach ($rEPGData as $rEPGItem) { - $rCapStart = ($rEPGItem['start'] < $rStartDate ? $rStartDate : $rEPGItem['start']); - $rCapEnd = ($rFinishDate < $rEPGItem['end'] ? $rFinishDate : $rEPGItem['end']); - $rDuration = ($rCapEnd - $rCapStart) / 60; - $rArchive = null; - - if (!isset($rArchiveInfo[$rChannelID])) { - } else { - if (!(0 < $rArchiveInfo[$rChannelID]['tv_archive_server_id'] && 0 < $rArchiveInfo[$rChannelID]['tv_archive_duration'])) { - } else { - if (time() - $rArchiveInfo[$rChannelID]['tv_archive_duration'] * 86400 > $rEPGItem['start']) { - } else { - $rArchive = array($rEPGItem['start'], intval(($rEPGItem['end'] - $rEPGItem['start']) / 60)); - } - } - } - - $rRelativeSize = round($rDuration * $rPerUnit, 2); - $rFullSize += $rRelativeSize; - - if (100 >= $rFullSize) { - } else { - $rRelativeSize -= $rFullSize - 100; - } - - $rListings[$rChannelID][] = array('ListingId' => $rEPGItem['id'], 'ChannelId' => $rChannelID, 'Title' => $rEPGItem['title'], 'RelativeSize' => $rRelativeSize, 'StartTime' => date('h:iA', $rCapStart), 'EndTime' => date('h:iA', $rCapEnd), 'Start' => $rEPGItem['start'], 'End' => $rEPGItem['end'], 'Specialisation' => 'tv', 'Archive' => $rArchive); - } - } - } - - $rDefaultEPG = array('ChannelId' => null, 'Title' => 'No Programme Information...', 'RelativeSize' => 100, 'StartTime' => 'Not Available', 'EndTime' => '', 'Specialisation' => 'tv', 'Archive' => null); - $db->query('SELECT `id`, `stream_icon`, `stream_display_name`, `tv_archive_duration`, `tv_archive_server_id`, `category_id` FROM `streams` WHERE `id` IN (' . implode(',', $rChannels) . ') ORDER BY FIELD(`id`, ' . implode(',', $rChannels) . ') ASC;'); - - foreach ($db->get_rows() as $rStream) { - if (0 < $rStream['tv_archive_duration'] && 0 < $rStream['tv_archive_server_id']) { - $rArchive = $rStream['tv_archive_duration']; - } else { - $rArchive = 0; - } - - $rDefaultArray = $rDefaultEPG; - $rDefaultArray['ChannelId'] = $rStream['id']; - $rCategoryIDs = json_decode($rStream['category_id'], true); -$rCategories = CategoryService::getAllByType('live'); - - if (0 < strlen(RequestManager::getAll()['category'])) { - $rCategory = ($rCategories[intval(RequestManager::getAll()['category'])]['category_name'] ?: 'No Category'); - } else { - $rCategory = ($rCategories[$rCategoryIDs[0]]['category_name'] ?: 'No Category'); - } - - if (1 >= count($rCategoryIDs)) { - } else { - $rCategory .= ' (+' . (count($rCategoryIDs) - 1) . ' others)'; - } - - $rReturn['Channels'][] = array('Id' => $rStream['id'], 'DisplayName' => $rStream['stream_display_name'], 'CategoryName' => $rCategory, 'Archive' => $rArchive, 'Image' => (ImageUtils::validateURL($rStream['stream_icon']) ?: ''), 'TvListings' => ($rListings[$rStream['id']] ?: array($rDefaultArray))); - } - echo json_encode($rReturn); - - exit(); - } else { - echo json_encode($rReturn); - - exit(); - } - } else { - exit(); - } - } else { - exit(); - } - } else { - if (RequestManager::getAll()['action'] != 'get_programme') { - } else { - if ($rPermissions['can_view_vod']) { - $rTimezone = (RequestManager::getAll()['timezone'] ?: 'Europe/London'); - date_default_timezone_set($rTimezone); - - if (!isset(RequestManager::getAll()['id'])) { - } else { - $rRow = EpgService::getProgramme(RequestManager::getAll()['stream_id'], RequestManager::getAll()['id']); - - if (!$rRow) { - } else { - $rArchive = $rAvailable = false; - - if (time() >= $rRow['end']) { - } else { - $db->query('SELECT `server_id`, `direct_source`, `monitor_pid`, `pid`, `stream_status`, `on_demand` FROM `streams` LEFT JOIN `streams_servers` ON `streams_servers`.`stream_id` = `streams`.`id` WHERE `streams`.`id` = ? AND `server_id` IS NOT NULL;', RequestManager::getAll()['stream_id']); - - if (0 >= $db->num_rows()) { - } else { - foreach ($db->get_rows() as $rStreamRow) { - if (!$rStreamRow['server_id'] || $rStreamRow['direct_source']) { - } else { - $rAvailable = true; - - break; - } - } - } - } - - $rRow['date'] = date('H:i', $rRow['start']) . ' - ' . date('H:i', $rRow['end']); - echo json_encode(array('result' => true, 'data' => $rRow, 'available' => $rAvailable, 'archive' => $rArchive)); - - exit(); - } - } - - echo json_encode(array('result' => false)); - - exit(); - } - - exit(); - } - } - } - } - } - } - } - } - } - } - - echo json_encode(array('result' => false)); -} else { - echo json_encode(array('result' => false, 'error' => 'Not logged in')); - - exit(); -} diff --git a/src/reseller/created_channels.php b/src/reseller/created_channels.php deleted file mode 100644 index 757b9fd1..00000000 --- a/src/reseller/created_channels.php +++ /dev/null @@ -1,73 +0,0 @@ -' . "\n" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . ' '; -include 'topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '

Created Channels

' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t" . '
IDIconNameCategoryConnectionsKill
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/dashboard.php b/src/reseller/dashboard.php deleted file mode 100644 index 53c503aa..00000000 --- a/src/reseller/dashboard.php +++ /dev/null @@ -1,226 +0,0 @@ -]*+>#i', '', $rNotice); - $rNotice = preg_replace('#]*+>#i', '', $rNotice); - $rNotice = str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $rNotice); - $rNotice = preg_replace('/(&#*\\w+)[\\x00-\\x20]+;/u', '$1;', $rNotice); - $rNotice = preg_replace('/(&#x*[0-9A-F]+);*/iu', '$1;', $rNotice); - $rNotice = html_entity_decode($rNotice, ENT_COMPAT, 'UTF-8'); - $rNotice = preg_replace("#(<[^>]+?[\\x00-\\x20\"'])(?:on|xmlns)[^>]*+[>\\b]?#iu", '$1>', $rNotice); - $rNotice = preg_replace("#([a-z]*)[\\x00-\\x20]*=[\\x00-\\x20]*([`'\"]*)[\\x00-\\x20]*j[\\x00-\\x20]*a[\\x00-\\x20]*v[\\x00-\\x20]*a[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu", '$1=$2nojavascript...', $rNotice); - $rNotice = preg_replace("#([a-z]*)[\\x00-\\x20]*=(['\"]*)[\\x00-\\x20]*v[\\x00-\\x20]*b[\\x00-\\x20]*s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:#iu", '$1=$2novbscript...', $rNotice); - $rNotice = preg_replace("#([a-z]*)[\\x00-\\x20]*=(['\"]*)[\\x00-\\x20]*-moz-binding[\\x00-\\x20]*:#u", '$1=$2nomozbinding...', $rNotice); - $rNotice = preg_replace("#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`'\"]*.*?expression[\\x00-\\x20]*\\([^>]*+>#i", '$1>', $rNotice); - $rNotice = preg_replace("#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`'\"]*.*?behaviour[\\x00-\\x20]*\\([^>]*+>#i", '$1>', $rNotice); - $rNotice = preg_replace("#(<[^>]+?)style[\\x00-\\x20]*=[\\x00-\\x20]*[`'\"]*.*?s[\\x00-\\x20]*c[\\x00-\\x20]*r[\\x00-\\x20]*i[\\x00-\\x20]*p[\\x00-\\x20]*t[\\x00-\\x20]*:*[^>]*+>#iu", '$1>', $rNotice); - require_once __DIR__ . '/../public/Views/layouts/admin.php'; - renderUnifiedLayoutHeader('reseller'); -endif; -echo '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '

Welcome '; -echo htmlspecialchars($rUserInfo['username']); -echo '

' . "\n" . '
' . "\n" . ' '; - -if (empty($rNotice)) { -} else { - echo '
' . "\n" . ' '; - echo $rNotice; - echo '
' . "\n" . ' '; -} - -echo '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '

Recent Activity

' . "\n" . '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' '; -$rPackages = getPackages(); -$db->query('SELECT * FROM `users_logs` LEFT JOIN `users` ON `users`.`id` = `users_logs`.`owner` WHERE `users_logs`.`owner` IN (' . implode(',', array_map('intval', array_merge(array($rUserInfo['id']), $rPermissions['all_reports'] ?? []))) . ') ORDER BY `date` DESC LIMIT 250;'); - -foreach ($db->get_rows() as $rRow) { - $rOwner = "" . $rRow['username'] . ''; - $rDevice = array('line' => 'User Line', 'mag' => 'MAG Device', 'enigma' => 'Enigma2 Device', 'user' => 'Reseller')[$rRow['type']]; - $rText = ''; - - switch ($rRow['action']) { - case 'new': - if ($rRow['package_id']) { - $rText = 'Created New ' . $rDevice . ' with Package:
' . $rPackages[$rRow['package_id']]['package_name']; - } else { - $rText = 'Created New ' . $rDevice; - } - - break; - - case 'extend': - if ($rRow['package_id']) { - $rText = 'Extended ' . $rDevice . ' with Package:
' . $rPackages[$rRow['package_id']]['package_name']; - } else { - $rText = 'Extended ' . $rDevice; - } - - break; - - case 'convert': - $rText = 'Converted Device to User Line'; - - break; - - case 'edit': - $rText = 'Edited ' . $rDevice; - - break; - - case 'enable': - $rText = 'Enabled ' . $rDevice; - - break; - - case 'disable': - $rText = 'Disabled ' . $rDevice; - - break; - - case 'delete': - $rText = 'Deleted ' . $rDevice; - - break; - - case 'send_event': - $rText = 'Sent Event to ' . $rDevice; - - break; - - case 'adjust_credits': - $rText = 'Adjusted Credits by ' . $rRow['cost']; - - break; - - default: - break; - } - echo $rOwner; - echo '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' '; -} -echo ' ' . "\n" . '
ResellerLine / UserActionDate
'; - echo $rLineInfo; - echo ''; - echo $rText; - echo ''; - echo date($rSettings['date_format'] . ' H:i', $rRow['date']); - echo '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '

Expiring Lines

' . "\n" . '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' '; - -foreach (getExpiring() ?: [] as $rUser) { - echo ' ' . "\n" . ' '; - - if ($rUser['is_mag']) { - echo ' ' . "\n" . ' ' . "\n" . ' '; - } else { - if ($rUser['is_e2']) { - echo ' ' . "\n" . ' ' . "\n" . ' '; - } else { - echo ' ' . "\n" . ' ' . "\n" . ' '; - } - } - - echo ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' '; -} -echo ' ' . "\n" . '
TypeIdentityOwnerExpires
MAG Device'; - echo htmlspecialchars($rUser['mag_mac']); - echo (!empty($rUser['reseller_notes']) ? '   ' : ''); - echo 'Enigma2 Device'; - echo htmlspecialchars($rUser['e2_mac']); - echo (!empty($rUser['reseller_notes']) ? '   ' : ''); - echo 'User Line'; - echo htmlspecialchars($rUser['username']); - echo (!empty($rUser['reseller_notes']) ? '   ' : ''); - echo ''; - echo htmlspecialchars($rRegisteredUsers[$rUser['member_id']]['username']); - echo ''; - echo date($rSettings['date_format'] . ' H:i', $rUser['exp_date']); - echo '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n\t" . '
' . "\n" . '
' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/edit_profile.php b/src/reseller/edit_profile.php deleted file mode 100644 index 771c9889..00000000 --- a/src/reseller/edit_profile.php +++ /dev/null @@ -1,103 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; -echo ucfirst($rUserInfo['username']); -echo '

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t"; - -if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) { -} else { - echo "\t\t\t\t" . '' . "\r\n\t\t\t\t"; -} - -echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - -foreach (getcodes() as $rCode) { - if (!($rCode['type'] == 4 && in_array($rUserInfo['member_group_id'], json_decode($rCode['groups'], true) ?: []))) { - } else { - echo '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - - break; - } -} -echo "\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/enigma.php b/src/reseller/enigma.php deleted file mode 100644 index 99abfafc..00000000 --- a/src/reseller/enigma.php +++ /dev/null @@ -1,309 +0,0 @@ -= $rLine['package_id']) { - } else { - $rOrigPackage = getPackage($rLine['package_id']); - } - } - - $_TITLE = 'Enigma Device'; - require_once __DIR__ . '/../public/Views/layouts/admin.php'; - renderUnifiedLayoutHeader('reseller'); -endif; -echo '
' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; - -if (isset($rDevice)) { - echo 'Edit'; -} else { - echo 'Add'; -} - -if (!isset(RequestManager::getAll()['trial'])) { -} else { - echo ' Trial'; -} - -echo ' Enigma Device

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n" . ' '; - -if (!$rGenTrials && !isset($rLine) && isset(RequestManager::getAll()['trial'])) { - echo ' ' . "\r\n" . ' '; -} else { - if (!(isset($rLine) && $rLine['is_trial'])) { - } else { - echo ' ' . "\r\n" . ' '; - } - - if (!isset($rLine) || in_array($rLine['member_id'], array_merge(array($rUserInfo['id']), $rPermissions['direct_reports']))) { - } else { - $rOwner = UserRepository::getRegisteredUserById($rLine['member_id']); - echo ' ' . "\r\n" . ' '; - } - - echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t"; - - if (isset($rDevice['device_id']) && !isset($_STATUS)) { - echo "\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t"; - } else { - if (!isset(RequestManager::getAll()['trial'])) { - } else { - echo ' ' . "\r\n" . ' '; - } - } - - echo "\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - - if (0 >= count($rPermissions['all_reports'])) { - } else { - echo '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - } - - if (!isset($rOrigPackage)) { - } else { - echo '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' '; - } - - echo '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t"; - - if (!isset($rDevice['device_id'])) { - } else { - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Previous' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Clear Device Info' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t"; - } - - if (!$rPermissions['allow_restrictions']) { - } else { - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Previous' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - } - - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
Total CreditsPurchase CostRemaining Credits
'; - echo number_format($rUserInfo['credits'], 0); - echo '0'; - echo number_format($rUserInfo['credits'], 0); - echo '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
'; - echo $language::get('bouquet_name'); - echo ''; - echo $language::get('streams'); - echo ''; - echo $language::get('movies'); - echo ''; - echo $language::get('series'); - echo ''; - echo $language::get('stations'); - echo '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
    ' . "\r\n" . '
  • ' . "\r\n" . ' Previous' . "\r\n" . '
  • ' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n" . ' '; -} - - - -echo "\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '
' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/enigmas.php b/src/reseller/enigmas.php deleted file mode 100644 index 2ba1e944..00000000 --- a/src/reseller/enigmas.php +++ /dev/null @@ -1,200 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; -echo $language::get('enigma_devices'); -echo '

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n" . ' '; - -if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) { -} else { - echo ' ' . "\r\n" . ' '; -} - -echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '
'; -echo $language::get('id'); -echo ''; -echo $language::get('username'); -echo ''; -echo $language::get('mac_address'); -echo 'Public IP'; -echo $language::get('owner'); -echo ''; -echo $language::get('status'); -echo ''; -echo $language::get('online'); -echo ''; -echo $language::get('trial'); -echo ''; -echo $language::get('expiration'); -echo ''; -echo $language::get('actions'); -echo '
' . "\r\n\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/epg_view.php b/src/reseller/epg_view.php deleted file mode 100644 index 2120c79d..00000000 --- a/src/reseller/epg_view.php +++ /dev/null @@ -1,212 +0,0 @@ - '`stream_display_name` ASC', 'added' => '`added` DESC'); - - if (!empty(RequestManager::getAll()['sort']) && isset($rOrder[RequestManager::getAll()['sort']])) { - $rOrderBy = $rOrder[RequestManager::getAll()['sort']]; - } else { - $rChannelOrder = igbinary_unserialize(file_get_contents(CACHE_TMP_PATH . 'channel_order')); - - if (SettingsManager::getAll()['channel_number_type'] != 'manual' && 0 < count($rChannelOrder)) { - $rOrderBy = 'FIELD(`id`,' . implode(',', $rChannelOrder) . ')'; - } else { - $rOrderBy = '`order` ASC'; - } - } - - $rStreamIDs = array(); - $db->query('SELECT COUNT(`id`) AS `count` FROM `streams` ' . $rWhereString . ';', ...$rWhereV); - $rCount = $db->get_row()['count']; - $db->query('SELECT `id` FROM `streams` ' . $rWhereString . ' ORDER BY ' . $rOrderBy . ' LIMIT ' . $rStart . ', ' . $rLimit . ';', ...$rWhereV); - - foreach ($db->get_rows() as $rRow) { - $rStreamIDs[] = $rRow['id']; - } - } else { - $rStreamIDs = array(); - $rCount = 0; - } - - $rPages = ceil($rCount / $rLimit); - $rPagination = array(); - - foreach (range($rPageInt - 2, $rPageInt + 2) as $i) { - if (!(1 <= $i && $i <= $rPages)) { - } else { - $rPagination[] = $i; - } - } - $_TITLE = 'TV Guide'; - require_once __DIR__ . '/../public/Views/layouts/admin.php'; - renderUnifiedLayoutHeader('reseller'); -endif; -echo '' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/episodes.php b/src/reseller/episodes.php deleted file mode 100644 index 25b8694a..00000000 --- a/src/reseller/episodes.php +++ /dev/null @@ -1,119 +0,0 @@ -' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n" . '

'; -echo $language::get('episodes'); -echo '

' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '
IDImageNameCategoryConnectionsKill
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/index.php b/src/reseller/index.php deleted file mode 100644 index 16c7bf9a..00000000 --- a/src/reseller/index.php +++ /dev/null @@ -1,5 +0,0 @@ -= $rLine['package_id']) { - } else { - $rOrigPackage = getPackage($rLine['package_id']); - } - } - - $_TITLE = 'Line'; - require_once __DIR__ . '/../public/Views/layouts/admin.php'; - renderUnifiedLayoutHeader('reseller'); -endif; -echo '
' . "\n" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '

'; - -if (isset($rLine)) { - echo 'Edit'; -} else { - echo 'Add'; -} - -if (!isset(RequestManager::getAll()['trial'])) { -} else { - echo ' Trial'; -} - -echo ' Line

' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n" . ' '; - -if (!$rGenTrials && !isset($rLine) && isset(RequestManager::getAll()['trial'])) { - echo ' ' . "\n" . ' '; -} else { - if (!(isset($rLine) && $rLine['is_trial'])) { - } else { - echo ' ' . "\n" . ' '; - } - - if (!isset($rLine) || in_array($rLine['member_id'], array_merge(array($rUserInfo['id']), $rPermissions['direct_reports']))) { - } else { - $rOwner = UserRepository::getRegisteredUserById($rLine['member_id']); - echo ' ' . "\n" . ' '; - } - - echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t"; - - if (isset($rLine)) { - echo "\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t"; - } else { - if (!isset(RequestManager::getAll()['trial'])) { - } else { - echo ' ' . "\n" . ' '; - } - } - - echo "\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - - if ($rPermissions['allow_change_username']) { - echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - } else { - if (!isset($rLine)) { - } else { - echo '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - } - } - - if ($rPermissions['allow_change_password']) { - echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - } else { - if (!isset($rLine)) { - } else { - echo '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - } - } - - if (0 >= count($rPermissions['all_reports'])) { - } else { - echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - } - - if (!isset($rOrigPackage)) { - } else { - echo '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' '; - } - - echo '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - - if (!$rPermissions['allow_restrictions']) { - } else { - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Previous' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - } - - echo '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '
Total CreditsPurchase CostRemaining Credits
'; - echo number_format($rUserInfo['credits'], 0); - echo '0'; - echo number_format($rUserInfo['credits'], 0); - echo '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '
ID'; - echo $language::get('bouquet_name'); - echo ''; - echo $language::get('streams'); - echo ''; - echo $language::get('movies'); - echo ''; - echo $language::get('series'); - echo ''; - echo $language::get('stations'); - echo '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
    ' . "\n" . '
  • ' . "\n" . ' Previous' . "\n" . '
  • ' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n" . ' '; -} - -echo "\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '
' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/line_activity.php b/src/reseller/line_activity.php deleted file mode 100644 index b50655b5..00000000 --- a/src/reseller/line_activity.php +++ /dev/null @@ -1,170 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

Activity Logs

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '
LineStreamPlayerISPIPStartStopDurationOutput
' . "\r\n\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/lines.php b/src/reseller/lines.php deleted file mode 100644 index f6973dc1..00000000 --- a/src/reseller/lines.php +++ /dev/null @@ -1,271 +0,0 @@ -' . "\n" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . ' '; -include 'topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '

Lines

' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n" . ' '; - -if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) { -} else { - echo ' ' . "\n" . ' '; -} - -echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n" . ' ' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t" . '
IDUsernamePasswordOwnerStatusOnlineTrialActiveConnectionsExpirationLast ConnectionActions
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '' . "\n"; -?> - - - -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; -echo $language::get('live_connections'); -echo '

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t"; - -if (SettingsManager::getAll()['redis_handler']) { - echo '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t"; -} else { - echo "\t\t\t\t\t\t\t" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t"; -} - -echo ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '
IDQualityLineStreamPlayerISPIPDurationOutput'; -echo $language::get('actions'); -echo '
' . "\r\n\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/login.php b/src/reseller/login.php deleted file mode 100644 index 97bf5e07..00000000 --- a/src/reseller/login.php +++ /dev/null @@ -1,144 +0,0 @@ -= intval($rSettings['login_flood'])) { - } else { - $db->query("SELECT COUNT(`id`) AS `count` FROM `login_logs` WHERE `status` = 'INVALID_LOGIN' AND `login_ip` = ? AND TIME_TO_SEC(TIMEDIFF(NOW(), `date`)) <= 86400;", $rIP); - - if ($db->num_rows() != 1) { - } else { - if (intval($rSettings['login_flood']) > intval($db->get_row()['count'])) { - } else { - BlocklistService::blockIP(array('ip' => $rIP, 'notes' => 'LOGIN FLOOD ATTACK')); - - exit(); - } - } - } - - if (!isset(RequestManager::getAll()['login'])) { - } else { - $rReturn = ResellerAPI::processLogin(RequestManager::getAll()); - $_STATUS = $rReturn['status']; - - if ($_STATUS != STATUS_SUCCESS) { - } else { - if (0 < strlen(RequestManager::getAll()['referrer'])) { - $rReferer = basename(RequestManager::getAll()['referrer']); - - if (substr($rReferer, 0, 6) != 'logout') { - } else { - $rReferer = 'dashboard'; - } - - header('Location: ' . $rReferer); - - exit(); - } - - header('Location: dashboard'); - - exit(); - } - } - - echo '' . "\n" . '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' XC_VM | '; - echo $language::get('login'); - echo '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n\t\t" . '' . "\n" . ' '; - - if (isset($_COOKIE['theme']) && $_COOKIE['theme'] == 1) { - echo "\t\t" . '' . "\n" . ' ' . "\n" . ' '; - } else { - echo ' ' . "\n" . ' ' . "\n" . ' '; - } - - echo ' ' . "\n\t\t" . '' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n\t\t"; - - if (!$rSettings['recaptcha_enable']) { - } else { - echo "\t\t" . '' . "\n\t\t"; - } - - echo ' ' . "\n" . ' ' . "\n" . ''; -} else { - header('Location: dashboard'); - - exit(); -} diff --git a/src/reseller/logout.php b/src/reseller/logout.php deleted file mode 100644 index dabea658..00000000 --- a/src/reseller/logout.php +++ /dev/null @@ -1,5 +0,0 @@ -= $rLine['package_id']) { - } else { - $rOrigPackage = getPackage($rLine['package_id']); - } - } - - $_TITLE = 'MAG Device'; - require_once __DIR__ . '/../public/Views/layouts/admin.php'; - renderUnifiedLayoutHeader('reseller'); -endif; -echo '
' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include 'topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; - -if (isset($rDevice)) { - echo 'Edit'; -} else { - echo 'Add'; -} - -if (!isset(RequestManager::getAll()['trial'])) { -} else { - echo ' Trial'; -} - -echo ' MAG Device

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n" . ' '; - -if (!$rGenTrials && !isset($rLine) && isset(RequestManager::getAll()['trial'])) { - echo ' ' . "\r\n" . ' '; -} else { - if (!(isset($rLine) && $rLine['is_trial'])) { - } else { - echo ' ' . "\r\n" . ' '; - } - - if (!isset($rLine) || in_array($rLine['member_id'], array_merge(array($rUserInfo['id']), $rPermissions['direct_reports']))) { - } else { - $rOwner = UserRepository::getRegisteredUserById($rLine['member_id']); - echo ' ' . "\r\n" . ' '; - } - - echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t"; - - if (isset($rDevice['mag_id']) && !isset($_STATUS)) { - echo "\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t"; - } else { - if (!isset(RequestManager::getAll()['trial'])) { - } else { - echo ' ' . "\r\n" . ' '; - } - } - - echo "\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - - if (0 >= count($rPermissions['all_reports'])) { - } else { - echo '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - } - - if (!isset($rOrigPackage)) { - } else { - echo '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' '; - } - - echo '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t"; - - if (!isset($rDevice['mag_id'])) { - } else { - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Previous' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Clear Device Info' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t"; - } - - if (!$rPermissions['allow_restrictions']) { - } else { - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Previous' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . ' '; - } - - echo "\t\t\t\t\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
Total CreditsPurchase CostRemaining Credits
'; - echo number_format($rUserInfo['credits'], 0); - echo '0'; - echo number_format($rUserInfo['credits'], 0); - echo '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . '
'; - echo $language::get('bouquet_name'); - echo ''; - echo $language::get('streams'); - echo ''; - echo $language::get('movies'); - echo ''; - echo $language::get('series'); - echo ''; - echo $language::get('stations'); - echo '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
    ' . "\r\n" . '
  • ' . "\r\n" . ' Previous' . "\r\n" . '
  • ' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n" . ' '; -} - -echo "\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '
' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/mags.php b/src/reseller/mags.php deleted file mode 100644 index b53e2ee7..00000000 --- a/src/reseller/mags.php +++ /dev/null @@ -1,200 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; -echo $language::get('mag_devices'); -echo '

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n" . ' '; - -if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) { -} else { - echo ' ' . "\r\n" . ' '; -} - -echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '
'; -echo $language::get('id'); -echo ''; -echo $language::get('username'); -echo ''; -echo $language::get('mac_address'); -echo 'Device'; -echo $language::get('owner'); -echo ''; -echo $language::get('status'); -echo ''; -echo $language::get('online'); -echo ''; -echo $language::get('trial'); -echo ''; -echo $language::get('expiration'); -echo ''; -echo $language::get('actions'); -echo '
' . "\r\n\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/movies.php b/src/reseller/movies.php deleted file mode 100644 index e0e622dd..00000000 --- a/src/reseller/movies.php +++ /dev/null @@ -1,110 +0,0 @@ - - -
-
- -
-
-
-
- -
-

-
-
-
- -
-
-
-
- -
- -
- -
- -
- -
- - - -
- -
-
- - - - - - - - - - - - - -
IDImageNameCategoryConnectionsKill
- -
-
-
-
- -
-
- - \ No newline at end of file diff --git a/src/reseller/post.php b/src/reseller/post.php deleted file mode 100644 index 14d90c3c..00000000 --- a/src/reseller/post.php +++ /dev/null @@ -1,133 +0,0 @@ - $rValue) { - if (substr($rKey, 0, 7) != 'STATUS_') { - } else { - $_ERRORS[intval($rValue)] = $rKey; - } -} - -if (1 < $rICount) { - echo '' . "\r\n"; -} else { - $rAction = RequestManager::getAll()['action']; - $rData = RequestManager::getAll(); - unset($rData['action']); - - if (count($rData) != 0) { - } else { - $rData = json_decode(file_get_contents('php://input'), true); - } - - if (!$rData) { - echo json_encode(array('result' => false)); - - exit(); - } - - switch ($rAction) { - case 'edit_profile': - $rReturn = ResellerAPI::editResellerProfile($rData); - setcookie('hue', $rData['hue'], time() + 315360000); - setcookie('theme', $rData['theme'], time() + 315360000); - $language::setLanguage($rData['lang']); - - if ($rReturn['status'] == STATUS_SUCCESS) { - echo json_encode(array('result' => true, 'location' => 'edit_profile?status=' . intval($rReturn['status']), 'status' => $rReturn['status'], 'reload' => true)); - - exit(); - } - - echo json_encode(array('result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status'])); - - exit(); - - case 'line': - $rReturn = ResellerAPI::processLine($rData); - - if ($rReturn['status'] == STATUS_SUCCESS) { - echo json_encode(array('result' => true, 'location' => 'lines?status=' . intval($rReturn['status']), 'status' => $rReturn['status'])); - - exit(); - } - - echo json_encode(array('result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status'])); - - exit(); - - case 'mag': - $rReturn = ResellerAPI::processMAG($rData); - - if ($rReturn['status'] == STATUS_SUCCESS) { - echo json_encode(array('result' => true, 'location' => 'mags?status=' . intval($rReturn['status']), 'status' => $rReturn['status'])); - - exit(); - } - - echo json_encode(array('result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status'])); - - exit(); - - case 'enigma': - $rReturn = ResellerAPI::processEnigma($rData); - - if ($rReturn['status'] == STATUS_SUCCESS) { - echo json_encode(array('result' => true, 'location' => 'enigmas?status=' . intval($rReturn['status']), 'status' => $rReturn['status'])); - - exit(); - } - - echo json_encode(array('result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status'])); - - exit(); - - case 'ticket': - $rReturn = ResellerAPI::submitTicket($rData); - - if ($rReturn['status'] == STATUS_SUCCESS) { - echo json_encode(array('result' => true, 'location' => 'ticket_view?id=' . intval($rReturn['data']['insert_id']) . '&status=' . intval($rReturn['status']), 'status' => $rReturn['status'])); - - exit(); - } - - echo json_encode(array('result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status'])); - - exit(); - - case 'user': - $rReturn = ResellerAPI::processUser($rData); - - if ($rReturn['status'] == STATUS_SUCCESS) { - echo json_encode(array('result' => true, 'location' => 'users?status=' . intval($rReturn['status']), 'status' => $rReturn['status'])); - - exit(); - } - - echo json_encode(array('result' => false, 'data' => $rReturn['data'], 'status' => $rReturn['status'])); - - exit(); - } -} diff --git a/src/reseller/radios.php b/src/reseller/radios.php deleted file mode 100644 index 0a571f89..00000000 --- a/src/reseller/radios.php +++ /dev/null @@ -1,78 +0,0 @@ -' . "\n" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '

Radio Stations

' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n" . ' ' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t" . '
IDIconNameCategoryConnectionsKill
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/session.php b/src/reseller/session.php deleted file mode 100644 index dff991c2..00000000 --- a/src/reseller/session.php +++ /dev/null @@ -1,49 +0,0 @@ - false)); - - exit(); - } - - header('Location: login?referrer=' . urlencode(basename($_SERVER['REQUEST_URI'], '.php'))); - - exit(); -} - -if (basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])) { - echo json_encode(array('result' => true)); - - exit(); -} - -$_SESSION['rlast_activity'] = time(); -session_write_close(); diff --git a/src/reseller/streams.php b/src/reseller/streams.php deleted file mode 100644 index 51bfbcc9..00000000 --- a/src/reseller/streams.php +++ /dev/null @@ -1,105 +0,0 @@ - - -
-
-
-
-
-
- -
-

Streams

-
-
-
- -
-
-
-
- -
- -
- -
- -
- -
- - -
- -
-
- - - - - - - - - - - - - -
IDIconNameCategoryConnectionsKill
- -
-
-
-
-
-
- - \ No newline at end of file diff --git a/src/reseller/ticket.php b/src/reseller/ticket.php deleted file mode 100644 index ce7cdc53..00000000 --- a/src/reseller/ticket.php +++ /dev/null @@ -1,59 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t"; - -if (isset($rTicketInfo)) { - echo "\t\t\t\t\t" . '

Ticket Response

' . "\r\n\t\t\t\t\t"; -} else { - echo "\t\t\t\t\t" . '

Create Ticket

' . "\r\n\t\t\t\t\t"; -} - -echo "\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t"; - -if (!isset($rTicketInfo)) { -} else { - echo "\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t"; -} - -echo "\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t"; - -if (isset($rTicketInfo)) { -} else { - echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t"; -} - -echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\r\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/ticket_view.php b/src/reseller/ticket_view.php deleted file mode 100644 index 98bbd401..00000000 --- a/src/reseller/ticket_view.php +++ /dev/null @@ -1,61 +0,0 @@ -query('UPDATE `tickets` SET `admin_read` = 1 WHERE `id` = ?;', RequestManager::getAll()['id']); - } else { - $db->query('UPDATE `tickets` SET `user_read` = 1 WHERE `id` = ?;', RequestManager::getAll()['id']); - } - - $_TITLE = 'View Ticket'; - require_once __DIR__ . '/../public/Views/layouts/admin.php'; - renderUnifiedLayoutHeader('reseller'); - endif; - echo '
' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; - include __DIR__ . '/topbar.php'; - echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

'; - echo $rTicketInfo['title']; - echo '

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t"; - - foreach ($rTicketInfo['replies'] ?? [] as $rReply) { - echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '

'; - - if (!$rReply['admin_reply']) { - echo $rTicketInfo['user']['username']; - } else { - echo 'Owner'; - } - - echo '

' . "\r\n\t\t\t\t\t\t\t\t" . '

'; - echo date('Y-m-d H:i', $rReply['date']); - echo '

' . "\r\n\t\t\t\t\t\t\t\t" . '

'; - echo $rReply['message']; - echo '

' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t"; - } - echo "\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '
' . "\r\n"; - require_once __DIR__ . '/../public/Views/layouts/footer.php'; - renderUnifiedLayoutFooter('reseller'); -} else { - exit(); -} diff --git a/src/reseller/tickets.php b/src/reseller/tickets.php deleted file mode 100644 index 8e16a235..00000000 --- a/src/reseller/tickets.php +++ /dev/null @@ -1,62 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

Tickets

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t"; -$rTickets = getTickets($rUserInfo['id']); - -foreach ($rTickets ?: [] as $rTicket) { - echo "\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t"; -} -echo "\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t" . '
IDResellerSubjectStatusCreated DateLast ReplyAction
'; - echo intval($rTicket['id']); - echo ''; - echo $rTicket['username']; - echo ''; - echo $rTicket['title']; - echo ''; - echo $rStatusArray[$rTicket['status']]; - echo ''; - echo $rTicket['created']; - echo ''; - echo $rTicket['last_reply']; - echo '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/user.php b/src/reseller/user.php deleted file mode 100644 index ff42c56a..00000000 --- a/src/reseller/user.php +++ /dev/null @@ -1,259 +0,0 @@ -' . "\n" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '

'; - -if (isset($rUser)) { - echo 'Edit'; -} else { - echo 'Add'; -} - -echo ' User

' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n" . ' '; - -if (!isset($rUser) || in_array($rUser['id'], $rPermissions['direct_reports'])) { -} else { - $rOwner = UserRepository::getRegisteredUserById($rUser['owner_id']); - echo ' ' . "\n" . ' '; -} - -echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t"; - -if (!isset($rUser)) { -} else { - echo "\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t"; -} - -echo "\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; - -if (!$rPermissions['allow_change_password'] && isset($rUser)) { -} else { - echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; -} - -if (!isset($rUser)) { -} else { - if (($rKey = array_search($rUser['id'], $rPermissions['all_reports'])) === false) { - } else { - unset($rPermissions['all_reports'][$rKey]); - } - - if (($rKey = array_search($rUser['id'], $rPermissions['direct_reports'])) === false) { - } else { - unset($rPermissions['direct_reports'][$rKey]); - } -} - -if (0 >= count($rPermissions['all_reports'])) { -} else { - echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; -} - -if (1 >= count($rPermissions['subresellers'])) { -} else { - echo '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' '; -} - -echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t\t" . '
    ' . "\n" . ' '; - -if (isset($rUser)) { - echo '
  • ' . "\n" . ' ' . "\n" . '
  • ' . "\n" . ' '; -} else { - echo "\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n\t\t\t\t\t\t\t\t\t\t\t\t" . 'Next' . "\n\t\t\t\t\t\t\t\t\t\t\t" . '
  • ' . "\n" . ' '; -} - -echo "\t\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t\t\t"; - -if (isset($rUser)) { -} else { - echo '
' . "\n" . '
' . "\n" . '
' . "\n" . ' '; - - if ($rUserInfo['credits'] - $rPermissions['create_sub_resellers_price'] >= 0) { - } else { - echo ' ' . "\n" . ' '; - } - - echo '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '
Total CreditsPurchase CostRemaining Credits
'; - echo number_format($rUserInfo['credits'], 0); - echo ''; - echo number_format($rPermissions['create_sub_resellers_price'], 0); - echo ''; - echo number_format($rUserInfo['credits'] - $rPermissions['create_sub_resellers_price'], 0); - echo '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
    ' . "\n" . '
  • ' . "\n" . ' Previous' . "\n" . '
  • ' . "\n" . '
  • ' . "\n" . ' = 0) { - } else { - echo 'disabled '; - } - - echo 'name="submit_user" type="submit" class="btn btn-primary purchase" value="Purchase" />' . "\n" . '
  • ' . "\n" . '
' . "\n" . '
' . "\n" . ' '; -} - -echo "\t\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/user_logs.php b/src/reseller/user_logs.php deleted file mode 100644 index bd6ad9be..00000000 --- a/src/reseller/user_logs.php +++ /dev/null @@ -1,101 +0,0 @@ -' . "\r\n" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n" . ' '; -include 'topbar.php'; -echo "\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '

Reseller Logs

' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '
' . "\r\n\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t\t" . '' . "\r\n\t\t\t\t\t\t" . '
IDResellerLine / UserActionCostCredits RemainingDate
' . "\r\n\t\t\t\t\t" . '
' . "\r\n\t\t\t\t" . '
' . "\r\n\t\t\t" . '
' . "\r\n\t\t" . '
' . "\r\n\t" . '
' . "\r\n" . '' . "\r\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller'); diff --git a/src/reseller/users.php b/src/reseller/users.php deleted file mode 100644 index a6442819..00000000 --- a/src/reseller/users.php +++ /dev/null @@ -1,85 +0,0 @@ -' . "\n" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . ' '; -include __DIR__ . '/topbar.php'; -echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '

Users

' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n" . ' '; - -if (!(isset($_STATUS) && $_STATUS == STATUS_SUCCESS)) { -} else { - echo ' ' . "\n" . ' '; -} - -echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t\t" . '' . "\n\t\t\t\t\t\t" . '
IDUsernameOwnerIPStatusCredits# of LinesLast LoginActions
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '' . "\n"; -require_once __DIR__ . '/../public/Views/layouts/footer.php'; -renderUnifiedLayoutFooter('reseller');