1 | <?php |
||
2 | /******************************************************************************* |
||
3 | * common.php |
||
4 | * ----------------------- |
||
5 | * begin : Tuesday, february 11, 2004 |
||
6 | * copyright : (C) 2003 Atari Legend |
||
7 | * email : [email protected] |
||
8 | * |
||
9 | * Id: common.php,v 0.10 2015/08/20 00:02 ST Graveyard |
||
10 | * |
||
11 | ******************************************************************************** |
||
12 | |||
13 | ********************************************************************************* |
||
14 | *In here we call all common includes and variables ... We also check on sessions! |
||
15 | *********************************************************************************/ |
||
16 | |||
17 | extract($_REQUEST); |
||
18 | |||
19 | require_once __DIR__ . "/../vendor/autoload.php"; |
||
20 | include("../../config/connect.php"); |
||
21 | include("../../config/config.php"); |
||
22 | include("../../lib/user_functions.php"); |
||
23 | include("../../lib/functions.php"); |
||
24 | include("../../lib/karma.php"); |
||
25 | include("../../lib/who_is_online.php"); |
||
26 | |||
27 | // Define default email config that will get overwritten |
||
28 | // in email_settings.php |
||
29 | $email_mailer = 'mail'; |
||
30 | $smtp_host = ''; |
||
31 | $smtp_username = ''; |
||
32 | $smtp_password = ''; |
||
33 | $smtp_port = -1; |
||
34 | $smtp_auth = false; |
||
35 | $smtp_secure = ''; |
||
36 | |||
37 | // email_settings.php may not exist (to use the default settings) |
||
38 | // So suppress errors with @ |
||
39 | @include("../../config/email_settings.php"); |
||
40 | |||
41 | if (file_exists("../../config/database_upgrade.php")==true) { |
||
0 ignored issues
–
show
|
|||
42 | exit("Upgrade mode"); |
||
43 | } |
||
44 | |||
45 | //Check if the user is logged on to the site |
||
46 | sec_session_start(); |
||
47 | |||
48 | if (login_check($mysqli) == true) { |
||
49 | $smarty->assign('user_session', array( |
||
50 | 'userid' => $_SESSION['userid'], |
||
51 | 'user_id' => $_SESSION['user_id'], |
||
52 | 'permission' => $_SESSION['permission'], |
||
53 | 'extension' => $_SESSION['image'], |
||
54 | 'image' => "$user_avatar_path$_SESSION[user_id].$_SESSION[image]" |
||
55 | )); |
||
56 | } |
||
57 | |||
58 | include("../../config/template_config.php"); |
||
59 | |||
60 | //transfer edit messages to template |
||
61 | if (isset($_SESSION['edit_message'])) { |
||
62 | $smarty->assign('edit_message', $_SESSION['edit_message']); |
||
63 | unset($_SESSION['edit_message']); |
||
64 | } |
||
65 | |||
66 | if (SITESTATUS == "offline") { |
||
67 | if ($_SESSION['permission'] !== "1") { |
||
68 | header("Location: " . SITEURL . "blank.php"); |
||
69 | } |
||
70 | } |
||
71 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.