-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprotected_template.php
More file actions
56 lines (47 loc) · 2.14 KB
/
Copy pathprotected_template.php
File metadata and controls
56 lines (47 loc) · 2.14 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
<?php
/*
Copyright 2016 - 2018 Musto Technologies LLC http://www.mustotechnologies.com
-- GPLv3 License --
This file is part of MT Kestrel.
MT Kestrel 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
any later version.
MT Kestrel 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.
You should have received a copy of the GNU General Public License
along with MT Kestrel as the COPYING.txt file. If not,
see <http://www.gnu.org/licenses/>.
*/
include("$_SERVER[DOCUMENT_ROOT]/MT-Kestrel/mt_api/config.php");
include("$_SERVER[DOCUMENT_ROOT]/MT-Kestrel/mt_api/security_fucntions.php");
sec_session_start();
// $connect to our DB
$connect = mysqli_connect($db_host_name, $db_user_name, $db_password, $database);
if (mysqli_connect_errno()) {
die('<p>Failed to connect to MySQL, send this message to support: '.mysqli_connect_error().'</p>');
}
if(login_check($connect) == true) {
include("$_SERVER[DOCUMENT_ROOT]/MT-Kestrel/webparts/header.php");
echo '<title>Register - MT Salespoint</title>';
echo '</head>';
echo '<body>';
include("webparts/navigation.php");
//Insert secure content here...
echo '<p>Welcome ' . $_SESSION['username'] . ', you have the following role(s): ' . $_SESSION['user_role'] . '!</p><br>';
echo "<p>
This is an example protected page. To access this page, users
must be logged in. At some stage, we'll also check the role of
the user, so pages will be able to determine the type of user
authorised to access the page.
</p>
<p>Return to <a href=\"index.php\">login page</a></p>";
} else {
include("$_SERVER[DOCUMENT_ROOT]/MT-Kestrel/webparts/header.php");
echo '<h2>Oops!</h2><br>';
echo "<span class=\"error\">You are not authorized to access this page.</span> Please <a href=\"index.php\">login</a>.";
}
include("webparts/footer.php");
?>