Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 45 lines (40 sloc) 1.377 kB
01a7f58 @rosslagerwall Initial commit
authored
1 <?php
5851d65 @rosslagerwall Comment classes and some other files.
authored
2 /* This file provides includes and sets up sessions, certain variables,
3 remember me functionality and logins.
4 This file is included from many different pages. */
5
01a7f58 @rosslagerwall Initial commit
authored
6 include_once("class.User.php");
7 include_once("class.Topic.php");
8 include_once("class.Post.php");
9 include_once("class.Forum.php");
10 include_once("class.PM.php");
11 include_once("function.OnlineList.php");
12 include_once("outHtml.php");
13 session_start();
14
15 if (isset($_COOKIE['username']) && isset($_COOKIE['password']) && ($_SESSION['loggedIn'] == false || !isset($_SESSION['loggedIn'])))
16 {
17 $fileC = file("db/forumUsers.dat");
18 foreach ($fileC as $item)
19 {
20 $temp = new User($item);
21 if ($_COOKIE['username'] == $temp->getUserId() && $_COOKIE['password'] == $temp->getPassword())
22 {
23 setcookie("username",$_COOKIE['username'],time()+(60*60*24*14));
24 setcookie("password",$_COOKIE['password'],time()+(60*60*24*14));
25 $_SESSION['loggedIn'] = true;
26 $_SESSION['user'] = $temp;
27 }
28 }
29 }
30
31 if ($_SESSION['loggedIn'] == true)
32 {
33 addUser($_SESSION['user']->getUserId());
34 }
35 else
36 {
37 addGuest($_SERVER['SERVER_ADDR']);
38 }
39
40 $boardname = trim(file_get_contents("db/boardname.dat"));
41 $boarddescription = trim(file_get_contents("db/boarddescription.dat"));
42 define(BOARDNAME,$boardname);
43 define(BOARDDESCRIPTION,$boarddescription);
44 ?>
Something went wrong with that request. Please try again.