diff --git a/.github/agents/security.agent.md b/.github/agents/security.agent.md
index f5e8f8a60..2d397135e 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 3c3bd7c05..b4980ce97 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 620c38923..7dc2b834a 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 b0b3a4c4f..ee40b6840 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 3bd1afdf5..c9672acb1 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 e29b3b802..95570131e 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 000000000..e1cf1c337
--- /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 6afcd35f4..66185787f 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 0a936de3b..d43765e9c 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('#*(?:applet|b(?:ase|gsound|link)|embed|frame(?:set)?|i(?:frame|layer)|l(?:ayer|ink)|meta|object|s(?:cript|tyle)|title|xml)[^>]*+>#i', '', $rNotice);
+ $rNotice = preg_replace('#*\\w+:\\w[^>]*+>#i', '', $rNotice);
+ $rNotice = str_replace(array('&', '<', '>'), array('&', '<', '>'), $rNotice);
+ $rNotice = preg_replace('/(*\\w+)[\\x00-\\x20]+;/u', '$1;', $rNotice);
+ $rNotice = preg_replace('/(*[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 2b983f675..7437cfae7 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 0bc14159c..1ad9bf717 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 55c0f78de..54344411f 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 6d2185537..1efa9d189 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 8e5d8d1e6..04fcfd007 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 df7d862cc..e365bc685 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 3d70d3fca..c44efb78f 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 951207c03..75deb517b 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 07f047364..f11680589 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 000000000..7908839d3
--- /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 000000000..f4028207c
--- /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 d502f88b0..8bd1f4e73 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 9e1078712..e5bdcb34f 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 3c67b0dcb..58082a907 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 000000000..79b2127d9
--- /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 e87a77184..c56861b65 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 000000000..48de7d1b7
--- /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 08335ca13..4ba87b218 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 000000000..054c37434
--- /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 badb62967..886174ce9 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 fe09846ec..445c38e4c 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 4dacf6377..e317674c8 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 0fdaa2e84..b281e30c6 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 066629131..e18180fc5 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 4c6be1e65..bc5762a4f 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 51d854129..c5f7b8da5 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 897ddf578..d92de692b 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 b567aa1b8..4f487a03e 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 51049b5e5..78d3a26d9 100644
--- a/src/public/Views/reseller/created_channels.php
+++ b/src/public/Views/reseller/created_channels.php
@@ -1,7 +1,56 @@
-
+
+
+
+
+
+
+
+
Created Channels
+
+
+
+
+
+
+
+
+
+
+
+ ID
+ Icon
+ Name
+ Category
+ Connections
+ Kill
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/dashboard.php b/src/public/Views/reseller/dashboard.php
index 03062d3f4..0dd6fd2a6 100644
--- a/src/public/Views/reseller/dashboard.php
+++ b/src/public/Views/reseller/dashboard.php
@@ -1,7 +1,170 @@
-
+
+
+
+
+
Welcome = htmlspecialchars($rUserInfo['username']) ?>
+
+
+
+ = $rNotice ?>
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/edit_profile.php b/src/public/Views/reseller/edit_profile.php
index f13ee6f77..20c07c677 100644
--- a/src/public/Views/reseller/edit_profile.php
+++ b/src/public/Views/reseller/edit_profile.php
@@ -1,7 +1,111 @@
-
+
+
+
+
+
= htmlspecialchars(ucfirst($rUserInfo['username'])) ?>
+
+
+
+
+
+
+
+ ×
+ = $language::get('profile_success') ?>
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/enigma.php b/src/public/Views/reseller/enigma.php
index 43ac5190f..112172c69 100644
--- a/src/public/Views/reseller/enigma.php
+++ b/src/public/Views/reseller/enigma.php
@@ -1,7 +1,358 @@
+
+
+
+
+
+
+
+
+
= isset($rDevice) ? 'Edit' : 'Add' ?> Enigma Device
+
+
+
+
+
+
+
+ = $rSettings['disable_trial'] ? 'Trials have been disabled by the administrator. Please try again later.' : 'You have used your allowance of trials for this period. Please try again later.' ?>
+
+
+
+
+ This device is on a trial package. Adding a new package will convert it to an official package.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/enigmas.php b/src/public/Views/reseller/enigmas.php
index 0bb11d2b6..f74ed6672 100644
--- a/src/public/Views/reseller/enigmas.php
+++ b/src/public/Views/reseller/enigmas.php
@@ -1,7 +1,92 @@
-
+
+
+
+
+
+
+
+
= $language::get('enigma_devices') ?>
+
+
+
+
+
+
+
+ ×
+ Device has been added / modified.
+
+
+
+
+
+
+
+
+ = $language::get('id') ?>
+ = $language::get('username') ?>
+ = $language::get('mac_address') ?>
+ Public IP
+ = $language::get('owner') ?>
+ = $language::get('status') ?>
+ = $language::get('online') ?>
+ = $language::get('trial') ?>
+ = $language::get('expiration') ?>
+ = $language::get('actions') ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/epg_view.php b/src/public/Views/reseller/epg_view.php
index 44b8d6453..d3a8a458e 100644
--- a/src/public/Views/reseller/epg_view.php
+++ b/src/public/Views/reseller/epg_view.php
@@ -1,7 +1,138 @@
+ style="display: none;">
+
+
+
+
+ 0): ?>
+
+
+
+
+ ×
+
+ No Live Streams or Programmes have been found matching your search terms.
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/episodes.php b/src/public/Views/reseller/episodes.php
index ec542d276..83a04e6c8 100644
--- a/src/public/Views/reseller/episodes.php
+++ b/src/public/Views/reseller/episodes.php
@@ -1,7 +1,68 @@
-
+
+
+
+
+
+
+
+
= $language::get('episodes') ?>
+
+
+
+
+
+
+
+
+
+
+
+ ID
+ Image
+ Name
+ Category
+ Connections
+ Kill
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/line.php b/src/public/Views/reseller/line.php
index d0b08cf7b..091d6ffac 100644
--- a/src/public/Views/reseller/line.php
+++ b/src/public/Views/reseller/line.php
@@ -1,7 +1,351 @@
+
+
+
+
+
+
+
+
+
= isset($rLine) ? 'Edit' : 'Add' ?> Line
+
+
+
+
+
+
+
+ = $rSettings['disable_trial'] ? 'Trials have been disabled by the administrator. Please try again later.' : 'You have used your allowance of trials for this period. Please try again later.' ?>
+
+
+
+
+ This user is on a trial package. Adding a new package will convert it to an official package.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0): ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You do not have enough credits to complete this transaction!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/line_activity.php b/src/public/Views/reseller/line_activity.php
index 2a740ad99..70cccf143 100644
--- a/src/public/Views/reseller/line_activity.php
+++ b/src/public/Views/reseller/line_activity.php
@@ -1,7 +1,92 @@
-
+
+
+
+
+
+
+
+
+
+
+ Line
+ Stream
+ Player
+ ISP
+ IP
+ Start
+ Stop
+ Duration
+ Output
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/lines.php b/src/public/Views/reseller/lines.php
index 628e798c2..292e82300 100644
--- a/src/public/Views/reseller/lines.php
+++ b/src/public/Views/reseller/lines.php
@@ -1,7 +1,131 @@
-
+
+
+
+
+
+
+ ×
+ Line has been added / modified.
+
+
+
+
+
+
+
+
+ ID
+ Username
+ Password
+ Owner
+ Status
+ Online
+ Trial
+ Active
+ Connections
+ Expiration
+ Last Connection
+ Actions
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Select Language / Sprache wählen / Dil Seçin
+
+ 🇩🇪 Deutsch
+ 🇬🇧 English
+ 🇹🇷 Türkçe
+
+
+
+ Preview / Vorschau / Önizleme
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/lines.scripts.php b/src/public/Views/reseller/lines.scripts.php
new file mode 100644
index 000000000..5e0f9f338
--- /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 bd5a33460..0e8ccb8a5 100644
--- a/src/public/Views/reseller/live_connections.php
+++ b/src/public/Views/reseller/live_connections.php
@@ -1,7 +1,131 @@
-
+
+
+
+
+
+
+
+
= $language::get('live_connections') ?>
+
+
+
+
+
+
+
+
+
+
+
+ ID
+ Quality
+ Line
+ Stream
+ Player
+ ISP
+ IP
+ Duration
+ Output
+ = $language::get('actions') ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/login.php b/src/public/Views/reseller/login.php
new file mode 100644
index 000000000..6c4e626f5
--- /dev/null
+++ b/src/public/Views/reseller/login.php
@@ -0,0 +1,108 @@
+
+
+
+
+ XC_VM | = $language::get('login') ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ×
+ = $language::get('login_message_1') ?>
+
+
+
+ ×
+ = $language::get('login_message_2') ?>
+
+
+
+ ×
+ = $language::get('login_message_3') ?>
+
+
+
+ ×
+ = $language::get('login_message_4') ?>
+
+
+
+ ×
+ = $language::get('login_message_5') ?>
+
+
+
+
+
+
+
+ = $language::get('username') ?>
+
+
+
+ = $language::get('password') ?>
+
+
+
+
+
+
+
+
+
+
+ disabled>= $language::get('login') ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/mag.php b/src/public/Views/reseller/mag.php
index 1c357c06e..a18bc832e 100644
--- a/src/public/Views/reseller/mag.php
+++ b/src/public/Views/reseller/mag.php
@@ -1,7 +1,368 @@
+
+
+
+
+
+
+
+
+
= isset($rDevice) ? 'Edit' : 'Add' ?> MAG Device
+
+
+
+
+
+
+
+ = $rSettings['disable_trial'] ? 'Trials have been disabled by the administrator. Please try again later.' : 'You have used your allowance of trials for this period. Please try again later.' ?>
+
+
+
+
+ This device is on a trial package. Adding a new package will convert it to an official package.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0): ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This device is linked to a user, the options for that user will be used.
+
+
+
+
+
+
+
+
+
+
+
+ You do not have enough credits to complete this transaction!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/mags.php b/src/public/Views/reseller/mags.php
index bf37ee135..579c748c6 100644
--- a/src/public/Views/reseller/mags.php
+++ b/src/public/Views/reseller/mags.php
@@ -1,7 +1,92 @@
-
+
+
+
+
+
+
+
+
= $language::get('mag_devices') ?>
+
+
+
+
+
+
+
+ ×
+ Device has been added / modified.
+
+
+
+
+
+
+
+
+ = $language::get('id') ?>
+ = $language::get('username') ?>
+ = $language::get('mac_address') ?>
+ Device
+ = $language::get('owner') ?>
+ = $language::get('status') ?>
+ = $language::get('online') ?>
+ = $language::get('trial') ?>
+ = $language::get('expiration') ?>
+ = $language::get('actions') ?>
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/movies.php b/src/public/Views/reseller/movies.php
index a6ce66a31..83de28b70 100644
--- a/src/public/Views/reseller/movies.php
+++ b/src/public/Views/reseller/movies.php
@@ -1,7 +1,58 @@
-
+
+
+
+
+
+
+
+
= $language::get('movies') ?>
+
+
+
+
+
+
+
+
+
+
+
+ ID
+ Image
+ Name
+ Category
+ Connections
+ Kill
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/radios.php b/src/public/Views/reseller/radios.php
index f61733a9c..f124a601c 100644
--- a/src/public/Views/reseller/radios.php
+++ b/src/public/Views/reseller/radios.php
@@ -1,7 +1,58 @@
-
+
+
+
+
+
+
+
+
+
+
+ ID
+ Icon
+ Name
+ Category
+ Connections
+ Kill
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/streams.php b/src/public/Views/reseller/streams.php
index 3f10743bc..85b68c9b0 100644
--- a/src/public/Views/reseller/streams.php
+++ b/src/public/Views/reseller/streams.php
@@ -1,7 +1,58 @@
-
+
+
+
+
+
+
+
+
+
+
+ ID
+ Icon
+ Name
+ Category
+ Connections
+ Kill
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/ticket.php b/src/public/Views/reseller/ticket.php
index eaa07d41e..60d03fd24 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 7cabe1f1c..f12b312e2 100644
--- a/src/public/Views/reseller/ticket_view.php
+++ b/src/public/Views/reseller/ticket_view.php
@@ -1,7 +1,33 @@
-
+
+
+
+
+
+
+
+
= htmlspecialchars($rTicketInfo['title']) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
= date('Y-m-d H:i', $rReply['date']) ?>
+
= $rReply['message'] ?>
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/tickets.php b/src/public/Views/reseller/tickets.php
index 0efdf02ce..0bbe0d29b 100644
--- a/src/public/Views/reseller/tickets.php
+++ b/src/public/Views/reseller/tickets.php
@@ -1,7 +1,58 @@
-
+
+
+
+
+
+
+
+
+ ID
+ Reseller
+ Subject
+ Status
+ Created Date
+ Last Reply
+ Action
+
+
+
+
+
+ = intval($rTicket['id']) ?>
+ = $rTicket['username'] ?>
+ = $rTicket['title'] ?>
+ = $statusArray[$rTicket['status']] ?>
+ = $rTicket['created'] ?>
+ = $rTicket['last_reply'] ?>
+
+
+
+
+
+
+
+
+
+
+
+
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 0e56bc4a8..fb96fedcb 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 "
" . array_keys($rDropdown[$rPage])[0] . ' ';
diff --git a/src/public/Views/reseller/user.php b/src/public/Views/reseller/user.php
index e6471b291..3364fe633 100644
--- a/src/public/Views/reseller/user.php
+++ b/src/public/Views/reseller/user.php
@@ -1,7 +1,196 @@
+
+
+
+
+
+
+
+
+
= isset($rUser) ? 'Edit' : 'Add' ?> User
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0): ?>
+
+
+ 1): ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You do not have enough credits to complete this transaction!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/user_logs.php b/src/public/Views/reseller/user_logs.php
index 20ba666b6..85192b016 100644
--- a/src/public/Views/reseller/user_logs.php
+++ b/src/public/Views/reseller/user_logs.php
@@ -1,7 +1,78 @@
-
+
+
+
+
+
+
+
+
+
+
+ ID
+ Reseller
+ Line / User
+ Action
+ Cost
+ Credits Remaining
+ Date
+
+
+
+
+
+
+
+
+
+
diff --git a/src/public/Views/reseller/users.php b/src/public/Views/reseller/users.php
index 848fd02ca..a952efd0c 100644
--- a/src/public/Views/reseller/users.php
+++ b/src/public/Views/reseller/users.php
@@ -1,7 +1,65 @@
-
+
+
+
+
+
+
+ ×
+ User has been added / modified.
+
+
+
+
+
+
+
+
+ ID
+ Username
+ Owner
+ IP
+ Status
+ Credits
+ # of Lines
+ Last Login
+ Actions
+
+
+
+
+
+
+
+
+
+
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 000000000..e05312fc3
--- /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 2c3b1e54a..0b8804918 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 a0d4617de..5efe3b102 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 322323b53..000000000
--- 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 757b9fd18..000000000
--- 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\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" . 'ID ' . "\n" . ' Icon ' . "\n\t\t\t\t\t\t\t\t\t" . 'Name ' . "\n" . ' Category ' . "\n\t\t\t\t\t\t\t\t\t" . 'Connections ' . "\n\t\t\t\t\t\t\t\t\t" . 'Kill ' . "\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" . '
' . "\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 53c503aa1..000000000
--- a/src/reseller/dashboard.php
+++ /dev/null
@@ -1,226 +0,0 @@
-]*+>#i', '', $rNotice);
- $rNotice = preg_replace('#*\\w+:\\w[^>]*+>#i', '', $rNotice);
- $rNotice = str_replace(array('&', '<', '>'), array('&', '<', '>'), $rNotice);
- $rNotice = preg_replace('/(*\\w+)[\\x00-\\x20]+;/u', '$1;', $rNotice);
- $rNotice = preg_replace('/(*[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" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ' . "\n" . ' ' . "\n" . ' Reseller ' . "\n" . ' Line / User ' . "\n" . ' Action ' . "\n" . ' Date ' . "\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" . ' ';
- echo $rLineInfo;
- echo ' ' . "\n" . ' ';
- echo $rText;
- echo ' ' . "\n" . ' ';
- echo date($rSettings['date_format'] . ' H:i', $rRow['date']);
- echo ' ' . "\n" . ' ' . "\n" . ' ';
-}
-echo ' ' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\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 771c98891..000000000
--- 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\t" . '' . "\r\n\t\t\t\t\t\t" . '× ' . "\r\n\t\t\t\t\t" . ' ' . "\r\n\t\t\t\t\t";
- echo $language::get('profile_success');
- 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" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . '
' . "\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" . ' ';
-
- 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" . '
' . "\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 99abfafcd..000000000
--- 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" . ' ';
-
- if ($rSettings['disable_trial']) {
- echo 'Trials have been disabled by the administrator. Please try again later.';
- } else {
- echo 'You have used your allowance of trials for this period. Please try again later.';
- }
-
- echo '
' . "\r\n" . ' ';
-} else {
- if (!(isset($rLine) && $rLine['is_trial'])) {
- } else {
- echo '
' . "\r\n" . ' This device is on a trial package. Adding a new package will convert it to an official package.' . "\r\n" . '
' . "\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" . " This device does not belong to you, although you have the right to edit this device you should notify the device's owner
';
- echo $rOwner['username'];
- echo ' when doing so.' . "\r\n" . '
' . "\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" . ' ';
-
- if (0 >= count($rPermissions['all_reports'])) {
- } else {
- echo '
' . "\r\n" . ' ';
- }
-
- if (!isset($rOrigPackage)) {
- } else {
- echo '
' . "\r\n" . ' ';
- }
-
- echo '
' . "\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" . '
' . "\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" . '
' . "\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" . '
' . "\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" . ' This device is linked to a user, the options for that user will be used.' . "\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" . ' You do not have enough credits to complete this transaction!' . "\r\n" . '
' . "\r\n" . '
' . "\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 2ba1e9442..000000000
--- 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" . ' ' . "\r\n" . ' × ' . "\r\n" . ' ' . "\r\n" . ' Device has been added / modified.' . "\r\n" . '
' . "\r\n" . ' ';
-}
-
-echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\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" . '';
-echo $language::get('id');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('username');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('mac_address');
-echo ' ' . "\r\n" . ' Public IP ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('owner');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('status');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('online');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('trial');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('expiration');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('actions');
-echo ' ' . "\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" . '
' . "\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 2120c79dc..000000000
--- 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" . '
' . "\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" . '
TV Guide ' . "\n\t\t\t\t" . '
' . "\n\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" . '
' . "\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" . '
' . "\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" . '';
-echo $language::get('all_categories');
-echo ' ' . "\n\t\t\t\t\t\t\t\t\t\t";
-
-foreach (CategoryService::getAllByType('live') as $rCategory) {
- echo "\t\t\t\t\t\t\t\t\t\t" . '';
- echo $rCategory['category_name'];
- echo ' ' . "\n\t\t\t\t\t\t\t\t\t\t";
-}
-echo "\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\t" . '
Sort ' . "\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";
-
-foreach (array('' => 'Default', 'name' => 'A to Z', 'added' => 'Date Added') as $rSort => $rText) {
- echo "\t\t\t\t\t\t\t\t\t\t" . '';
- echo $rText;
- echo ' ' . "\n\t\t\t\t\t\t\t\t\t\t";
-}
-echo "\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\t" . '
Show ' . "\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";
-
-foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) {
- echo "\t\t\t\t\t\t\t\t\t\t" . '';
- echo $rShow;
- echo ' ' . "\n\t\t\t\t\t\t\t\t\t\t";
-}
-echo "\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\t" . '
' . "\n\t\t\t\t\t\t\t\t\t" . 'Search ' . "\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" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . ' ' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t\t\t";
-
-if (0 < count($rStreamIDs)) {
- echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\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" . '
' . "\n\t\t\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\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" . '
' . "\n\t\t\t\t\t\t\t\t" . '
NOW ' . "\n\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" . '
' . "\n\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\t" . '
' . "\n\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\t";
-
- if (1 >= $rPages) {
- } else {
- echo "\t\t\t\t\t" . '
' . "\n\t\t\t\t\t\t";
-
- if (1 >= $rPageInt) {
- } else {
- echo '' . "\n\t\t\t\t\t\t\t\t" . ' ' . "\n\t\t\t\t\t\t\t" . ' ';
- }
-
- if (1 >= $rPagination[0]) {
- } else {
- echo '1 ';
-
- if (1 >= count($rPagination)) {
- } else {
- echo "... ";
- }
- }
-
- foreach ($rPagination as $i) {
- echo '' . $i . ' ';
- }
-
- if ($rPagination[count($rPagination) - 1] >= $rPages) {
- } else {
- if (1 >= count($rPagination)) {
- } else {
- echo "... ";
- }
-
- echo '' . $rPages . ' ';
- }
-
- if ($rPageInt >= $rPages) {
- } else {
- echo '' . "\n\t\t\t\t\t\t\t\t" . ' ' . "\n\t\t\t\t\t\t\t" . ' ';
- }
-
- echo "\t\t\t\t\t" . ' ' . "\n\t\t\t\t\t";
- }
-
- echo "\t\t\t\t" . '
' . "\n\t\t\t\t";
-} else {
- echo "\t\t\t\t" . '
' . "\n" . ' ' . "\n" . ' × ' . "\n" . ' ' . "\n" . ' No Live Streams or Programmes have been found matching your search terms.' . "\n\t\t\t\t" . '
' . "\n\t\t\t\t";
-}
-
-echo "\t\t\t" . '
' . "\n\t\t" . '
' . "\n" . '
' . "\n" . '
' . "\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 25b8694af..000000000
--- 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" . ' ID ' . "\n\t\t\t\t\t\t\t\t\t" . 'Image ' . "\n\t\t\t\t\t\t\t\t\t" . 'Name ' . "\n" . ' Category ' . "\n\t\t\t\t\t\t\t\t\t" . 'Connections ' . "\n\t\t\t\t\t\t\t\t\t" . 'Kill ' . "\n" . ' ' . "\n" . ' ' . "\n" . ' ' . "\n" . '
' . "\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 16c7bf9a5..000000000
--- 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" . ' ';
-
- if ($rSettings['disable_trial']) {
- echo 'Trials have been disabled by the administrator. Please try again later.';
- } else {
- echo 'You have used your allowance of trials for this period. Please try again later.';
- }
-
- echo '
' . "\n" . ' ';
-} else {
- if (!(isset($rLine) && $rLine['is_trial'])) {
- } else {
- echo '
' . "\n" . ' This user is on a trial package. Adding a new package will convert it to an official package.' . "\n" . '
' . "\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" . ' ';
- } else {
- if (!isset($rLine)) {
- } else {
- echo '
' . "\n" . ' ';
- }
- }
-
- if ($rPermissions['allow_change_password']) {
- echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' ';
- } else {
- if (!isset($rLine)) {
- } else {
- echo '
' . "\n" . ' ';
- }
- }
-
- if (0 >= count($rPermissions['all_reports'])) {
- } else {
- echo "\t\t\t\t\t\t\t\t\t\t\t\t" . '
' . "\n" . ' ';
- }
-
- if (!isset($rOrigPackage)) {
- } else {
- echo '
' . "\n" . ' ';
- }
-
- echo '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\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" . '
' . "\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" . '
' . "\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" . '
' . "\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" . ' You do not have enough credits to complete this transaction!' . "\n" . '
' . "\n" . '
' . "\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 b50655b50..000000000
--- 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\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" . 'Line ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Stream ' . "\r\n" . ' Player ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'ISP ' . "\r\n" . ' IP ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Start ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Stop ' . "\r\n" . ' Duration ' . "\r\n" . ' Output ' . "\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" . '
' . "\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 f6973dc1c..000000000
--- 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" . ' ' . "\n" . ' × ' . "\n" . ' ' . "\n" . ' Line has been added / modified.' . "\n" . '
' . "\n" . ' ';
-}
-
-echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\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" . 'ID ' . "\n\t\t\t\t\t\t\t\t\t" . 'Username ' . "\n\t\t\t\t\t\t\t\t\t" . 'Password ' . "\n\t\t\t\t\t\t\t\t\t" . 'Owner ' . "\n\t\t\t\t\t\t\t\t\t" . 'Status ' . "\n\t\t\t\t\t\t\t\t\t" . 'Online ' . "\n\t\t\t\t\t\t\t\t\t" . 'Trial ' . "\n" . ' Active ' . "\n" . ' Connections ' . "\n\t\t\t\t\t\t\t\t\t" . 'Expiration ' . "\n\t\t\t\t\t\t\t\t\t" . 'Last Connection ' . "\n\t\t\t\t\t\t\t\t\t" . 'Actions ' . "\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" . '
' . "\n\t\t\t\t\t" . '
' . "\n\t\t\t\t" . '
' . "\n\t\t\t" . '
' . "\n\t\t" . '
' . "\n\t" . '
' . "\n" . '' . "\n";
-?>
-
-
-
-
-
-
-
- Select Language / Sprache wählen / Dil Seçin
-
- 🇩🇪 Deutsch
- 🇬🇧 English
- 🇹🇷 Türkçe
-
-
-
- Preview / Vorschau / Önizleme
-
-
-
-
-
-
-
-
-
-
-
-
-' . "\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" . ' ';
-
- if (!isset($rSearchStream)) {
- } else {
- echo ' ';
- echo $rSearchStream['stream_display_name'];
- echo ' ' . "\r\n" . ' ';
- }
-
- echo ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ';
-
- if (!isset($rSearchLine)) {
- } else {
- echo ' ';
- echo $rSearchLine['username'];
- echo ' ' . "\r\n" . ' ';
- }
-
- echo ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' All Users ' . "\r\n" . ' My Lines ' . "\r\n" . ' ' . "\r\n" . ' ';
-
- if (0 >= count($rPermissions['direct_reports'])) {
- } else {
- echo ' ' . "\r\n" . ' ';
-
- foreach ($rPermissions['direct_reports'] as $rUserID) {
- $rRegisteredUser = $rPermissions['users'][$rUserID];
- echo ' ';
- echo $rRegisteredUser['username'];
- echo ' ' . "\r\n" . ' ';
- }
- echo ' ' . "\r\n" . ' ';
- }
-
- if (count($rPermissions['direct_reports']) >= count($rPermissions['all_reports'])) {
- } else {
- echo ' ' . "\r\n" . ' ';
-
- foreach ($rPermissions['all_reports'] as $rUserID) {
- if (in_array($rUserID, $rPermissions['direct_reports'])) {
- } else {
- $rRegisteredUser = $rPermissions['users'][$rUserID];
- echo ' ';
- echo $rRegisteredUser['username'];
- echo ' ' . "\r\n" . ' ';
- }
- }
- echo ' ' . "\r\n" . ' ';
- }
-
- echo ' ' . "\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" . ' ';
-
- if (!isset($rSearchStream)) {
- } else {
- echo ' ';
- echo $rSearchStream['stream_display_name'];
- echo ' ' . "\r\n" . ' ';
- }
-
- echo ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ';
-
- if (!isset($rSearchLine)) {
- } else {
- echo ' ';
- echo $rSearchLine['username'];
- echo ' ' . "\r\n" . ' ';
- }
-
- echo ' ' . "\r\n" . '
' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ' . "\r\n" . ' All Users ' . "\r\n" . ' My Lines ' . "\r\n" . ' ' . "\r\n" . ' ';
-
- if (0 >= count($rPermissions['direct_reports'])) {
- } else {
- echo ' ' . "\r\n" . ' ';
-
- foreach ($rPermissions['direct_reports'] as $rUserID) {
- $rRegisteredUser = $rPermissions['users'][$rUserID];
- echo ' ';
- echo $rRegisteredUser['username'];
- echo ' ' . "\r\n" . ' ';
- }
- echo ' ' . "\r\n" . ' ';
- }
-
- if (count($rPermissions['direct_reports']) >= count($rPermissions['all_reports'])) {
- } else {
- echo ' ' . "\r\n" . ' ';
-
- foreach ($rPermissions['all_reports'] as $rUserID) {
- if (in_array($rUserID, $rPermissions['direct_reports'])) {
- } else {
- $rRegisteredUser = $rPermissions['users'][$rUserID];
- echo ' ';
- echo $rRegisteredUser['username'];
- echo ' ' . "\r\n" . ' ';
- }
- }
- echo ' ' . "\r\n" . ' ';
- }
-
- echo ' ' . "\r\n" . '
' . "\r\n\t\t\t\t\t\t\t";
-}
-
-echo '
';
-echo $language::get('show');
-echo ' ' . "\r\n" . '
' . "\r\n" . ' ' . "\r\n" . ' ';
-
-foreach (array(10, 25, 50, 250, 500, 1000) as $rShow) {
- echo ' ';
- echo $rShow;
- echo ' ' . "\r\n" . ' ';
-}
-echo ' ' . "\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" . ' ID ' . "\r\n" . ' Quality ' . "\r\n" . ' Line ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Stream ' . "\r\n" . ' Player ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'ISP ' . "\r\n" . ' IP ' . "\r\n" . ' Duration ' . "\r\n" . ' Output ' . "\r\n" . ' ';
-echo $language::get('actions');
-echo ' ' . "\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" . '
' . "\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 97bf5e07e..000000000
--- 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" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ';
-
- if (isset($_STATUS) && $_STATUS == STATUS_FAILURE) {
- echo '
' . "\n" . ' × ' . "\n" . ' ';
- echo $language::get('login_message_1');
- echo '
' . "\n" . ' ';
- } else {
- if (isset($_STATUS) && $_STATUS == STATUS_INVALID_CODE) {
- echo '
' . "\n" . ' × ' . "\n" . ' ';
- echo $language::get('login_message_2');
- echo '
' . "\n" . ' ';
- } else {
- if (isset($_STATUS) && $_STATUS == STATUS_NOT_RESELLER) {
- echo '
' . "\n" . ' × ' . "\n" . ' ';
- echo $language::get('login_message_3');
- echo '
' . "\n" . ' ';
- } else {
- if (isset($_STATUS) && $_STATUS == STATUS_DISABLED) {
- echo '
' . "\n" . ' × ' . "\n" . ' ';
- echo $language::get('login_message_4');
- echo '
' . "\n" . ' ';
- } else {
- if (!(isset($_STATUS) && $_STATUS == STATUS_INVALID_CAPTCHA)) {
- } else {
- echo '
' . "\n" . ' × ' . "\n" . ' ';
- echo $language::get('login_message_5');
- echo '
' . "\n" . ' ';
- }
- }
- }
- }
- }
-
- echo '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . '
' . "\n" . ' ';
- echo $language::get('username');
- echo ' ' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\n" . ' ';
- echo $language::get('password');
- echo ' ' . "\n" . ' ' . "\n" . '
' . "\n" . ' ';
-
- if (!$rSettings['recaptcha_enable']) {
- } else {
- echo '
' . "\n" . '
' . "\n" . ' ' . "\n" . ' ';
- }
-
- echo '
' . "\n" . '
' . "\n" . ' ' . "\n" . ' ';
- echo $language::get('login');
- echo ' ' . "\n" . '
' . "\n" . ' ' . "\n" . '
' . "\n" . '
' . "\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 dabea6582..000000000
--- 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" . ' ';
-
- if ($rSettings['disable_trial']) {
- echo 'Trials have been disabled by the administrator. Please try again later.';
- } else {
- echo 'You have used your allowance of trials for this period. Please try again later.';
- }
-
- echo '
' . "\r\n" . ' ';
-} else {
- if (!(isset($rLine) && $rLine['is_trial'])) {
- } else {
- echo '
' . "\r\n" . ' This device is on a trial package. Adding a new package will convert it to an official package.' . "\r\n" . '
' . "\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" . " This device does not belong to you, although you have the right to edit this device you should notify the device's owner
';
- echo $rOwner['username'];
- echo ' when doing so.' . "\r\n" . '
' . "\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" . ' ';
-
- if (0 >= count($rPermissions['all_reports'])) {
- } else {
- echo '
' . "\r\n" . ' ';
- }
-
- if (!isset($rOrigPackage)) {
- } else {
- echo '
' . "\r\n" . ' ';
- }
-
- echo '
' . "\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" . '
' . "\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" . '
' . "\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" . '
' . "\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" . '
' . "\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" . ' This device is linked to a user, the options for that user will be used.' . "\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" . ' You do not have enough credits to complete this transaction!' . "\r\n" . '
' . "\r\n" . '
' . "\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 b53e2ee74..000000000
--- 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" . ' ' . "\r\n" . ' × ' . "\r\n" . ' ' . "\r\n" . ' Device has been added / modified.' . "\r\n" . '
' . "\r\n" . ' ';
-}
-
-echo "\t\t\t\t" . '
' . "\r\n\t\t\t\t\t" . '
' . "\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" . '';
-echo $language::get('id');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('username');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('mac_address');
-echo ' ' . "\r\n" . ' Device ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('owner');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('status');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('online');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('trial');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('expiration');
-echo ' ' . "\r\n\t\t\t\t\t\t\t\t\t" . '';
-echo $language::get('actions');
-echo ' ' . "\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" . '
' . "\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 e0e622dd3..000000000
--- a/src/reseller/movies.php
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ID
- Image
- Name
- Category
- Connections
- Kill
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/reseller/post.php b/src/reseller/post.php
deleted file mode 100644
index 14d90c3cf..000000000
--- 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 0a571f89e..000000000
--- 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\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" . 'ID ' . "\n\t\t\t\t\t\t\t\t\t" . 'Icon ' . "\n\t\t\t\t\t\t\t\t\t" . 'Name ' . "\n" . ' Category ' . "\n\t\t\t\t\t\t\t\t\t" . 'Connections ' . "\n\t\t\t\t\t\t\t\t\t" . 'Kill ' . "\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" . '
' . "\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 dff991c2e..000000000
--- 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 51bfbcc9c..000000000
--- a/src/reseller/streams.php
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ID
- Icon
- Name
- Category
- Connections
- Kill
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/reseller/ticket.php b/src/reseller/ticket.php
deleted file mode 100644
index ce7cdc531..000000000
--- 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";
-}
-
-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" . '
' . "\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" . '
' . "\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 98bbd4013..000000000
--- 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 8e16a235a..000000000
--- 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" . 'ID ' . "\r\n\t\t\t\t\t\t\t\t" . 'Reseller ' . "\r\n\t\t\t\t\t\t\t\t" . 'Subject ' . "\r\n\t\t\t\t\t\t\t\t" . 'Status ' . "\r\n\t\t\t\t\t\t\t\t" . 'Created Date ' . "\r\n\t\t\t\t\t\t\t\t" . 'Last Reply ' . "\r\n\t\t\t\t\t\t\t\t" . 'Action ' . "\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" . '';
- echo intval($rTicket['id']);
- echo ' ' . "\r\n\t\t\t\t\t\t\t\t" . '';
- echo $rTicket['username'];
- echo ' ' . "\r\n\t\t\t\t\t\t\t\t" . '';
- echo $rTicket['title'];
- echo ' ' . "\r\n\t\t\t\t\t\t\t\t" . '';
- echo $rStatusArray[$rTicket['status']];
- echo ' ' . "\r\n\t\t\t\t\t\t\t\t" . '';
- echo $rTicket['created'];
- echo ' ' . "\r\n\t\t\t\t\t\t\t\t" . '';
- echo $rTicket['last_reply'];
- echo ' ' . "\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" . '' . "\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";
-}
-echo "\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/user.php b/src/reseller/user.php
deleted file mode 100644
index ff42c56ac..000000000
--- 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" . " This user does not directly report to you, although you have the right to edit this user you should notify the user's parent
';
- echo $rOwner['username'];
- echo ' when doing so.' . "\n" . '
' . "\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" . ' ';
-
-if (!$rPermissions['allow_change_password'] && isset($rUser)) {
-} else {
- echo "\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" . ' ';
-}
-
-if (1 >= count($rPermissions['subresellers'])) {
-} else {
- echo '
' . "\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" . '
' . "\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" . '
' . "\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" . ' You do not have enough credits to complete this transaction!' . "\n" . '
' . "\n" . ' ';
- }
-
- echo '
' . "\n" . '
' . "\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 bd6ad9be7..000000000
--- 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" . '
' . "\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" . 'ID ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Reseller ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Line / User ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Action ' . "\r\n" . ' Cost ' . "\r\n" . ' Credits Remaining ' . "\r\n\t\t\t\t\t\t\t\t\t" . 'Date ' . "\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" . '
' . "\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 a6442819b..000000000
--- 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" . ' ' . "\n" . ' × ' . "\n" . ' ' . "\n" . ' User has been added / modified.' . "\n" . '
' . "\n" . ' ';
-}
-
-echo "\t\t\t\t" . '
' . "\n\t\t\t\t\t" . '
' . "\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" . 'ID ' . "\n\t\t\t\t\t\t\t\t\t" . 'Username ' . "\n\t\t\t\t\t\t\t\t\t" . 'Owner ' . "\n\t\t\t\t\t\t\t\t\t" . 'IP ' . "\n\t\t\t\t\t\t\t\t\t" . 'Status ' . "\n\t\t\t\t\t\t\t\t\t" . 'Credits ' . "\n\t\t\t\t\t\t\t\t\t" . '# of Lines ' . "\n\t\t\t\t\t\t\t\t\t" . 'Last Login ' . "\n\t\t\t\t\t\t\t\t\t" . 'Actions ' . "\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" . '
' . "\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');