-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
218 lines (183 loc) · 8.09 KB
/
index.php
File metadata and controls
218 lines (183 loc) · 8.09 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?php
error_reporting(E_ALL & ~E_NOTICE);
include_once "include/include.php";
include_once ".env.php";
$GLOBALS['token'] = TRUE;
$GLOBALS['appid'] = "";
$username = $password = "";
$email_notification = FALSE;
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$email_notification = test_input($_GET["email_notification"]);
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = test_input($_POST["username"]);
$password = test_input($_POST["password"]);
include_once "functions/login.php";
$GLOBALS['token'] = login($username, $password);
if ($GLOBALS['token'] != FALSE) {
$_SESSION['token'] = $GLOBALS['token'];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "api.toolbox.philsoft.at/users/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer " . $_SESSION['token']
),
));
$response = curl_exec($curl);
curl_close($curl);
$_SESSION['userdata'] = $response;
$userdata = json_decode($_SESSION['userdata']);
header("Location: /appcenter/home.php");
exit();
}
}
?>
<html lang="de_DE">
<head>
<meta charset="UTF-8">
<title>HTL-Toolbox</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="css/w3.css"
<link rel="stylesheet" href="css/login.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/style.scss">
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/favicons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
<link rel="manifest" href="/favicons/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/favicons/ms-icon-144x144.png">
<meta name="theme-color" content="#9372b1">
<style>
h1 {
color: white;
font-size: 80px;
text-align: center;
margin: 50px;
}
#remove1 {
display: none;
}
#remove2 {
display: none;
}
#remove3 {
display: none;
}
html {
margin: 0;
height: 100%;
overflow: hidden;
}
.animate-opacity {
animation: opac 0.8s
}
@keyframes opac {
from {
opacity: 0
}
to {
opacity: 1
}
}
</style>
</head>
<body>
<div id="particles-background" class="vertical-centered-box"></div>
<div id="particles-foreground" class="vertical-centered-box"></div>
<div class="vertical-centered-box">
<div id="load">
<script src="js/index.js"></script>
<div id="particles-background" class="vertical-centered-box"></div>
<div id="particles-foreground" class="vertical-centered-box"></div>
<div class="vertical-centered-box animate-opacity">
<div class="content">
<div class="loader-circle"></div>
<div class="loader-line-mask">
<div class="loader-line"></div>
</div>
<img src="/content/Logo.png" width="65" alt="">
</div>
</div>
</div>
<div class="content" id="main">
<div class="wrap-login100 p-l-50 p-r-50 p-t-77 p-b-30">
<form class="login100-form validate-form" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"
method="post">
<span class="login100-form-title p-b-55">
<img src="/content/Design/Black/Logo.png" width="100" alt="">
</span>
<?php
if ($GLOBALS['token'] == FALSE) {
echo "<div class='w3-panel w3-red flex-sb p-t-10 p-l-10 p-r-10 p-b-10'>
<i class='w3-xxlarge p-r-10 lnr lnr-cross-circle'></i>
<h3>Email und Passwort sind in dieser Kombination nicht korrekt.</h3>
</div> ";
}
if ($email_notification == true) {
echo "<div class='w3-panel w3-green flex-sb p-t-10 p-l-10 p-r-10 p-b-10'>
<i class='w3-xxlarge p-r-10 lnr lnr-checkmark-circle'></i>
<h3>Email wurde verschickt! Checke auch deinen Spam-Ordner</h3>
</div> ";
}
?>
<div class="wrap-input100 validate-input m-b-16" id="remove1"
data-validate="Du musst eine gültige E-Mail-Adresse der HTL Salzburg eingeben: z.B. max.mustermann02@htl-salzburg.ac.at">
<input class="input100" type="email" name="username" placeholder="E-Mail">
<span class="focus-input100"></span>
<span class="symbol-input100">
<span style="" class="lnr lnr-envelope"></span>
</span>
</div>
<div class="wrap-input100 validate-input m-b-16" id="remove2"
data-validate="Du musst dein Passwort eingeben.">
<input class="input100" type="password" name="password" placeholder="Passwort">
<span class="focus-input100"></span>
<span class="symbol-input100">
<span class="lnr lnr-lock"></span>
</span>
</div>
<div class="container-login100-form-btn p-t-25">
<button class="login100-form-btn">Login</button>
</div>
<div class="text-center w-full p-t-115">
<span class="txt1 m-r-10">Noch keinen Account?</span>
<a class="txt1 bo1 hov1" href="register.php">Registieren</a>
</div>
</form>
</div>
</div>
</div>
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="js/main.js"></script>
<script src="js/index.js"></script>
<script src="js/load.js"></script>
</body>
</html>