diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-18 14:46:06 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-18 14:46:06 +0100 |
| commit | 69cf45d6df749e45ba62ac485e2ff3262ae0892e (patch) | |
| tree | 1b06e77595873446d415d119fd32e8ff781cac82 | |
| parent | 6b9f35e6531af16ca14761a43c968a78d4a6ef9f (diff) | |
| download | bitweaver-69cf45d6df749e45ba62ac485e2ff3262ae0892e.tar.gz bitweaver-69cf45d6df749e45ba62ac485e2ff3262ae0892e.tar.bz2 bitweaver-69cf45d6df749e45ba62ac485e2ff3262ae0892e.zip | |
Remove site-specific kernel/ from config package
kernel/auth_check.php and auth_config.php are per-server configuration
managed via webstack — not part of the generic deployable config package.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rwxr-xr-x | config/kernel/auth_check.php | 32 | ||||
| -rwxr-xr-x | config/kernel/auth_config.php | 6 |
2 files changed, 0 insertions, 38 deletions
diff --git a/config/kernel/auth_check.php b/config/kernel/auth_check.php deleted file mode 100755 index 15b7ebc..0000000 --- a/config/kernel/auth_check.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php -// Minimal session check - no framework bootstrap -include 'auth_config.php'; - -preg_match( '|/attachments/\d+/(\d+)/|', $_SERVER['REQUEST_URI'], $matches ); - -if( !empty( $matches[1] ) ) { - $contentId = (int)$matches[1]; - try { - $pdo = new PDO( $gBitDbHost, $gBitDbUser, $gBitDbPassword ); - - // get the role restriction for this content, if any - $stmt = $pdo->prepare( "SELECT ROLE_ID FROM LIBERTY_CONTENT_ROLE_MAP WHERE CONTENT_ID = ?" ); - $stmt->execute( [$contentId] ); - $requiredRoleId = $stmt->fetchColumn(); - - if( $requiredRoleId === false ) { - // no restriction - public content - http_response_code( 200 ); - } elseif( in_array( (int)$requiredRoleId, $_SESSION['user_role'] ?? [] ) ) { - http_response_code( 200 ); - } else { - http_response_code( 403 ); - } - } catch( PDOException $e ) { - http_response_code( 403 ); - } - exit; -} - -// no content_id in URI - nothing to restrict -http_response_code( 200 );
\ No newline at end of file diff --git a/config/kernel/auth_config.php b/config/kernel/auth_config.php deleted file mode 100755 index c7e9016..0000000 --- a/config/kernel/auth_config.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -session_name( 'bit-user-myhomecloud' ); -session_start(); -$gBitDbHost='firebird:dbname=localhost:myhomecloud;charset=utf8;'; -$gBitDbUser='SYSDBA'; -$gBitDbPassword='smallBRO'; |
