blob: 3a5a4df72e4377b837697e2ed543407ed9a267cd (
plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
<?php
# if we kann redirect user with the ?goto variable
$redirect = true;
require_once( dirname(__FILE__) . '/bootstrap.php');
ob_start('minify');
session_name(SESSION);
session_start();
$c = new cache(REDIS_CONNECT, REDIS_DB);
if ( isset($_SESSION["loggedin"]) && $_SESSION["loggedin"]){
$a = "1_";
} else {
$a = "0_";
}
if ( $_SERVER["REQUEST_METHOD"] == "GET" && $_SERVER["REDIRECT_STATUS"] == 200 && strpos($_SERVER["QUERY_STRING"], "account") === false && strpos($_SERVER["QUERY_STRING"], "logout") === false) {
$token = $c->getToken($_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]. $_SERVER["QUERY_STRING"], $a);
if ( $c->exists($token)){
header("X-Cache: Hit");
echo $c->getValue($token);
ob_end_flush();
exit;
}
} else {
header("X-Cache: Miss ");
}
$db = new db();
if ( ! isset($_SESSION["username"]))
$u = null;
else
$u = $_SESSION["username"];
$user = new jg($u);
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<?php
//<link rel ="stylesheet" href="/static/style.css">
echo "<style>" . file_get_contents('static/style.min.css');?>
.dl-horizontal dt{white-space: normal;} .btn-info{background-color:#3083D6;} .img-responsive{margin: 0 auto;} @-moz-document url-prefix() { fieldset { display: table-cell; } }</style>
<noscript><style>.navbar{margin-bottom:0;}</style></noscript>
<title>Junge Gemeinde Adlershof</title>
<link rel='shortcut icon' href='/favicon.ico' type='image/x-icon'>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<?php
require_once 'static/header.php';
?>
<div class="container">
<div class="text-center">
<div class="row">
<?php
if( ! isset($_GET["page"]))
$_GET["page"] = "";
if($_GET["page"] == "" || $_GET["page"] == "index")
print_index();
else{
switch($_GET["page"]){
case("login"):
print_login();
break;
case("logout"):
print_logout();
break;
case("liste"):
print_list();
break;
case("register"):
print_register();
break;
case("update"):
print_update_list($_GET['id']);
break;
case("add"):
print_add_entry_to_list();
break;
case("account"):
print_account();
break;
case("404"):
print_404();
break;
case("action"):
require_once 'action.php';
break;
case("recover").
print_recover();
break;
default:
print_index();
break;
}
}
/*
if ( isset($_GET['goto']) && $_GET['goto'] != "" && $redirect ){
header($_SERVER['SERVER_PROTOCOL'] . ' 302 Moved');
header('Location: /?page='.$_GET['goto']);
}
*/
?>
</div>
</div>
<?php
require_once 'static/footer.php';
$html = ob_get_contents();
if ( $_SERVER["REQUEST_METHOD"] == "GET" && $_SERVER["REDIRECT_STATUS"] == 200 && strpos($_SERVER["QUERY_STRING"], "account") === false ) {
$c->setKey($token, $html, 3600);
}
ob_end_flush();
|