diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 73bfa01c..50e3ad6d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -325,7 +325,7 @@ parameters: path: src/Cli/migration_logic.php - - message: '#^Method AuthRepository\:\:getHMACById\(\) should return array\|null but return statement is missing\.$#' + message: '#^Method XcVm\\Core\\Auth\\AuthRepository\:\:getHMACById\(\) should return array\|null but return statement is missing\.$#' identifier: return.missing count: 1 path: src/Core/Auth/AuthRepository.php diff --git a/src/Cli/Commands/ToolsCommand.php b/src/Cli/Commands/ToolsCommand.php index c755328e..0599576c 100644 --- a/src/Cli/Commands/ToolsCommand.php +++ b/src/Cli/Commands/ToolsCommand.php @@ -1,5 +1,6 @@ @@ -224,7 +226,7 @@ class AuthRepository { global $db; $rStart = round(microtime(true) * 1000); $rReturn = array('create_line' => false, 'create_mag' => false, 'create_enigma' => false, 'stream_ids' => array(), 'series_ids' => array(), 'category_ids' => array(), 'users' => array(), 'direct_reports' => array(), 'all_reports' => array(), 'report_map' => array()); - $rUser = UserRepository::getRegisteredUserById($rUserID); + $rUser = \UserRepository::getRegisteredUserById($rUserID); if (!$rUser) { } else { @@ -257,7 +259,7 @@ class AuthRepository { if (!$rUsers) { } else { - $rReturn['users'] = UserRepository::getSubUsers($rUser['id']); + $rReturn['users'] = \UserRepository::getSubUsers($rUser['id']); foreach ($rReturn['users'] as $rUserID => $rUserData) { if ($rUser['id'] != $rUserData['parent']) { diff --git a/src/Core/Auth/AuthService.php b/src/Core/Auth/AuthService.php index 655f4151..0e8b0ea5 100644 --- a/src/Core/Auth/AuthService.php +++ b/src/Core/Auth/AuthService.php @@ -1,10 +1,12 @@ @@ -15,7 +17,7 @@ use XcVm\Core\Database\QueryHelper; class AuthService { // ────────────────────────────────────────────── - // Из CodeService + // Из \CodeService // ────────────────────────────────────────────── /** @@ -30,7 +32,7 @@ class AuthService { public static function processCode($rData) { global $db; if (isset($rData['edit'])) { - $rArray = AdminHelpers::overwriteData(AuthRepository::getCodeById($rData['edit']), $rData); + $rArray = \AdminHelpers::overwriteData(AuthRepository::getCodeById($rData['edit']), $rData); $rOrigCode = $rArray['code']; } else { $rArray = QueryHelper::verifyPostTable('access_codes', $rData); @@ -113,7 +115,7 @@ class AuthService { public static function processHMAC($rData) { global $db, $rSettings; if (isset($rData['edit'])) { - $rArray = AdminHelpers::overwriteData(AuthRepository::getHMACById($rData['edit']), $rData); + $rArray = \AdminHelpers::overwriteData(AuthRepository::getHMACById($rData['edit']), $rData); } else { $rArray = QueryHelper::verifyPostTable('hmac_keys', $rData); unset($rArray['id']); @@ -135,20 +137,20 @@ class AuthService { if (isset($rData['edit'])) { if ($rData['keygen'] != 'HMAC KEY HIDDEN') { - $db->query('SELECT `id` FROM `hmac_keys` WHERE `key` = ? AND `id` <> ?;', Encryption::encrypt($rData['keygen'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA), $rData['edit']); + $db->query('SELECT `id` FROM `hmac_keys` WHERE `key` = ? AND `id` <> ?;', \Encryption::encrypt($rData['keygen'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA), $rData['edit']); if (0 < $db->num_rows()) { return array('status' => STATUS_EXISTS_HMAC, 'data' => $rData); } } } else { - $db->query('SELECT `id` FROM `hmac_keys` WHERE `key` = ?;', Encryption::encrypt($rData['keygen'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA)); + $db->query('SELECT `id` FROM `hmac_keys` WHERE `key` = ?;', \Encryption::encrypt($rData['keygen'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA)); if (0 < $db->num_rows()) { return array('status' => STATUS_EXISTS_HMAC, 'data' => $rData); } } if ($rData['keygen'] != 'HMAC KEY HIDDEN') { - $rArray['key'] = Encryption::encrypt($rData['keygen'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA); + $rArray['key'] = \Encryption::encrypt($rData['keygen'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA); } $rPrepare = QueryHelper::prepareArray($rArray); @@ -201,7 +203,7 @@ class AuthService { } foreach ($rKeys as $rKey) { - $rSecret = Encryption::decrypt($rKey['key'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA); + $rSecret = \Encryption::decrypt($rKey['key'], $rSettings['live_streaming_pass'], OPENSSL_EXTRA); $rResult = hash_hmac('sha256', (string) $rStreamID . '##' . $rExtension . '##' . $rExpiry . '##' . $rMACIP . '##' . $rIdentifier . '##' . $rMaxConnections, $rSecret); if (md5($rResult) == md5($rHMAC)) { diff --git a/src/Core/Auth/Authenticator.php b/src/Core/Auth/Authenticator.php index e04cdd4f..c21411ab 100644 --- a/src/Core/Auth/Authenticator.php +++ b/src/Core/Auth/Authenticator.php @@ -1,6 +1,8 @@ style="display: none;" >
diff --git a/src/Public/Views/admin/code.php b/src/Public/Views/admin/code.php index 0bee7998..83690a59 100644 --- a/src/Public/Views/admin/code.php +++ b/src/Public/Views/admin/code.php @@ -1,5 +1,6 @@
style="display: none;" > diff --git a/src/Public/Views/admin/codes.php b/src/Public/Views/admin/codes.php index 731cd82b..14decd8a 100644 --- a/src/Public/Views/admin/codes.php +++ b/src/Public/Views/admin/codes.php @@ -1,4 +1,5 @@
style="display: none;" >
diff --git a/src/Public/Views/admin/created_channels.php b/src/Public/Views/admin/created_channels.php index 3eaf06c9..278d2020 100644 --- a/src/Public/Views/admin/created_channels.php +++ b/src/Public/Views/admin/created_channels.php @@ -1,4 +1,5 @@
diff --git a/src/Public/Views/admin/edit_profile.php b/src/Public/Views/admin/edit_profile.php index 3a30efe2..dddb9fea 100644 --- a/src/Public/Views/admin/edit_profile.php +++ b/src/Public/Views/admin/edit_profile.php @@ -1,4 +1,5 @@