-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
158 lines (137 loc) · 6.59 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
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
<!--[if IE 9 ]><html class="ie9"><![endif]-->
<?php
include 'php/config.php';
$db_host = $__database_host;
$db_db = $__database;
$db_user = $__database_user;
$db_passwd = $__database_password;
$link = new mysqli($db_host, $db_user, $db_passwd, $db_db);
if ($link->connect_errno > 0) {
die("Can't connect to Database! Check login credentials!" . $link->connect_errno);
}
$_sql = "SELECT * FROM users";
$_res = $link->query($_sql);
$_anzahl = $_res->num_rows;
if ($_anzahl <= 0) {
$__system_setup_desc = "<p>It looks like your visiting the first time. You need to setup the Databases or have our script doing it for you. Just put in your MySQL-Logindata below and click on setup!<br>This will only create the tables that are nessesarry for the basic system. <br> For every module you have to run their special initial script! </p>";
$__system_setup_title = "First Steps";
$__system_setup_logindesc ="Enter the credentials for the admin user!";
$__system_setup_timeinformation = "Start Setup! <small>Setup can take a while. Please stay patient!</small>";
$__system_setup_configinfo = "Attention! You have to set your MySQL credentials in the config.php (Folder: /php/config.php) first! Otherwise the setup will not work!<br> After the setup is completed you can login with your credentials down below <br> After that you can create more users. <br> Visit: <a href=''#''>the documentation</a> for more information.";
$initial_setup = true;
} else {
$initial_setup = false;
}
?>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>Intranet - Login</title>
<!-- Vendor CSS -->
<link href="vendors/bower_components/animate.css/animate.min.css" rel="stylesheet">
<link href="vendors/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.min.css" rel="stylesheet">
<!-- CSS -->
<link href="Interface/css/app_1.min.css" rel="stylesheet">
<link href="Interface/css/app_2.min.css" rel="stylesheet">
<style type="text/css">
body {
overflow: hidden !important;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
</head>
<body>
<?php
if ($initial_setup == false) {
echo '<div class="login-content">
<!-- Login -->
<div class="lc-block toggled" id="l-login">
<form action="php/login.php" id="login_form" method="post" name="login_form">
<div class="lcb-form">
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="zmdi zmdi-account"></i></span>
<div class="fg-line">
<input class="form-control" name="login_name" placeholder="Benutzer" type="text">
</div>
</div>
<div class="input-group m-b-20">
<span class="input-group-addon"><i class="zmdi zmdi-male"></i></span>
<div class="fg-line">
<input class="form-control" name="password" placeholder="Passwort" type="password">
</div>
</div>
<small>Intranet ' . $version . '</small>
<a class="btn btn-login btn-default btn-float"><i style="margin-top:25%;" class="zmdi zmdi-arrow-right"></i></a> <input class="btn btn-login btn-default btn-float" name="submit" type="submit" value=" ">
</div>
</form>
</div><!-- Register -->';
} else {
echo '<div style="margin: auto; width: 50%;">';
echo '<h1>' . $__system_setup_title . '</h1>';
echo $__system_setup_desc . '<hr>';
echo $__system_setup_configinfo;
echo '<div class="card" style="margin-top: 20px">
<a href="php/setup.php" target="_blank">' . $__system_setup_timeinformation . '</a>
</div>';
echo '</div>';
}
?>
<!-- Older IE warning message -->
<!--[if lt IE 9]>
<div class="ie-warning">
<h1 class="c-white">Warning!!</h1>
<p>You are using an outdated version of Internet Explorer, please upgrade <br/>to any of the following web browsers to access this website.</p>
<div class="iew-container">
<ul class="iew-download">
<li>
<a href="http://www.google.com/chrome/">
<img src="img/browsers/chrome.png" alt="">
<div>Chrome</div>
</a>
</li>
<li>
<a href="https://www.mozilla.org/en-US/firefox/new/">
<img src="img/browsers/firefox.png" alt="">
<div>Firefox</div>
</a>
</li>
<li>
<a href="http://www.opera.com">
<img src="img/browsers/opera.png" alt="">
<div>Opera</div>
</a>
</li>
<li>
<a href="https://www.apple.com/safari/">
<img src="img/browsers/safari.png" alt="">
<div>Safari</div>
</a>
</li>
<li>
<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">
<img src="img/browsers/ie.png" alt="">
<div>IE (New)</div>
</a>
</li>
</ul>
</div>
<p>Sorry for the inconvenience!</p>
</div>
<![endif]-->
<!-- Javascript Libraries -->
<script src="Interface/vendors/bower_components/jquery/dist/jquery.min.js">
</script>
<script src="Interface/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js">
</script>
<script src="Interface/vendors/bower_components/Waves/dist/waves.min.js">
</script>
<!-- Placeholder for IE9 -->
<!--[if IE 9 ]>
<script src="Interface/vendors/bower_components/jquery-placeholder/jquery.placeholder.min.js"></script>
<![endif]-->
<script src="Interface/js/app.min.js">
</script>
</body>
</html>