Browse Source

block loading include files directly

pull/40/head
Savetheinternet 13 years ago
parent
commit
b895102563
  1. 6
      inc/config.php
  2. 5
      inc/database.php
  3. 6
      inc/display.php
  4. 6
      inc/functions.php
  5. 5
      inc/mod.php
  6. 9
      inc/template.php
  7. 6
      inc/user.php

6
inc/config.php

@ -588,4 +588,10 @@
// Link imageboard to your Google Analytics account to track users and provide marketing insights.
// $config['google_analytics'] = 'UA-xxxxxxx-yy';
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
?>

5
inc/database.php

@ -1,4 +1,9 @@
<?php
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
function sql_open() {
global $pdo, $config;

6
inc/display.php

@ -1,4 +1,10 @@
<?php
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
/*
Stuff to help with the display.
*/

6
inc/functions.php

@ -1,4 +1,10 @@
<?php
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
loadConfig();
function loadConfig() {

5
inc/mod.php

@ -1,4 +1,9 @@
<?php
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
// Creates a small random string for validating moderators' cookies
function mkhash($length=12) {

9
inc/template.php

@ -1,8 +1,9 @@
<?php
// PHP Template Preprocessor by Savetheinternet
// http://codecanyon.net/user/Savetheinternet
// [email protected]
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
// -----------------------------------------------------
// Standard configuration

6
inc/user.php

@ -1,4 +1,10 @@
<?php
if($_SERVER['SCRIPT_FILENAME'] == str_replace('\\', '/', __FILE__)) {
// You cannot request this file directly.
header('Location: ../', true, 302);
exit;
}
// 'false' means that the user is not logged in as a moderator
$mod = false;

Loading…
Cancel
Save