summaryrefslogtreecommitdiff
path: root/config/kernel/auth_check.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/kernel/auth_check.php')
-rwxr-xr-xconfig/kernel/auth_check.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/config/kernel/auth_check.php b/config/kernel/auth_check.php
index d3c2586..18de119 100755
--- a/config/kernel/auth_check.php
+++ b/config/kernel/auth_check.php
@@ -3,7 +3,7 @@
include 'auth_config.php';
if( !empty( $_SESSION['user_role'] ) && $_SESSION['user_role'] > 0 ) {
- http_response_code(200);
+ http_response_code(200);
exit;
}
@@ -11,23 +11,23 @@ if( !empty( $_SESSION['user_role'] ) && $_SESSION['user_role'] > 0 ) {
preg_match( '|/attachments/\d+/(\d+)/|', $_SERVER['REQUEST_URI'], $matches );
if( !empty( $matches[1] ) ) {
- $contentId = (int)$matches[1];
- try {
- $pdo = new PDO( $gBitDbHost, $gBitDbUser, $gBitDbPassword );
- $stmt = $pdo->prepare(
- "SELECT COUNT(*) FROM LIBERTY_CONTENT_ROLE_MAP
- WHERE content_id = ?"
- );
- $stmt->execute( [$contentId] );
- if( $stmt->fetchColumn() == 0 ) {
- http_response_code( 200 );
+ $contentId = (int)$matches[1];
+ try {
+ $pdo = new PDO( $gBitDbHost, $gBitDbUser, $gBitDbPassword );
+ $stmt = $pdo->prepare(
+ "SELECT COUNT(*) FROM LIBERTY_CONTENT_ROLE_MAP
+ WHERE content_id = ?",
+ );
+ $stmt->execute( [$contentId] );
+ if( $stmt->fetchColumn() == 0 ) {
+ http_response_code( 200 );
} else {
http_response_code( 403 );
}
- } catch( PDOException $e ) {
- // db failure - deny access safely
- http_response_code( 403 );
- exit;
- }
- exit;
+ } catch( PDOException $e ) {
+ // db failure - deny access safely
+ http_response_code( 403 );
+ exit;
+ }
+ exit;
} \ No newline at end of file