This repository has been archived by the owner on Apr 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
74 lines (68 loc) · 2.32 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/***************************************************************************
* index.php
* -------------------
* begin : 03-29-2008
* copyright : (c) 2008 The phpBG Team
* email : [email protected]
*
****************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
***************************************************************************/
session_start();
error_reporting(E_ALL);
include("system/class.auth.php");
include("system/class.base.php");
include("system/class.dba.php");
#include("system/class.instance.php");
include("system/class.interface.php");
include("system/class.mail.php");
include("system/class.template.php");
$index = iface::loadData(new template());
if(isset($_SESSION['log'])) {
$error = new template("error.tpl");
$error->assign("message", $_SESSION['log']);
$index->assign("error", $error);
unset($_SESSION['log']);
}
$auth = isset($_SESSION['auth']) ? unserialize($_SESSION['auth']) : new auth();
$_SESSION['trackback'] = (isset($_GET['a'])) ? $_GET['a'] : "news";
switch($_GET['a'])
{
default:
case "news":
$news = new template("news.tpl");
$news->assign("newslist", news::newspage());
$index->assign("content", $news);
break;
case "login":
if(isset($_POST['login']) && isset($_POST['pass']))
$auth->login($_POST['login'], $_POST['pass']);
else {
$login = new template("login.tpl");
$index->assign("content", $login);
}
break;
case "logout":
$auth->logout();
break;
case "register":
if(isset($_POST['login']) && isset($_POST['pass']) && isset($_POST['email']))
$auth->register($_POST['login'], $_POST['pass'], $_POST['email']);
else {
$register = new template("register.tpl");
$index->assign("content", $register);
}
}
$index->view();
?>