mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-02 06:40:06 +01:00
Merge pull request #300 from Schrolli91/flothi-patch-1
Enabling basic functionality
This commit is contained in:
commit
dfad66783e
|
|
@ -36,7 +36,7 @@ CREATE TABLE `login` (
|
|||
|
||||
LOCK TABLES `login` WRITE;
|
||||
/*!40000 ALTER TABLE `login` DISABLE KEYS */;
|
||||
INSERT INTO `login` VALUES ,(1,'Test','098f6bcd4621d373cade4e832627b4f6');
|
||||
INSERT INTO `login` VALUES (1,'admin',md5('admin'));
|
||||
/*!40000 ALTER TABLE `login` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
$dbhost = "localhost";
|
||||
$dbuser = "USERNAME";
|
||||
$dbpassword = "PASSWORD";
|
||||
$dbuser = "boswatch";
|
||||
$dbpassword = "boswatch";
|
||||
$database = "boswatch";
|
||||
|
||||
$tableFMS = "bos_fms";
|
||||
|
|
|
|||
57
exampleAddOns/alarmMonitorWeb/do_eintragen.php
Normal file
57
exampleAddOns/alarmMonitorWeb/do_eintragen.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
<?php
|
||||
session_start();
|
||||
?>
|
||||
|
||||
<?php
|
||||
if(($_SESSION["username"])!="admin")
|
||||
{
|
||||
echo "Sie sind nicht berechtigt fuer diesen Bereich";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
@require_once("config.php");
|
||||
$verbindung = mysqli_connect($dbhost, $dbuser , $dbpassword, $database)
|
||||
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
||||
|
||||
$username = $_POST["username"];
|
||||
$passwort = $_POST["passwort"];
|
||||
$passwort2 = $_POST["passwort2"];
|
||||
|
||||
if($passwort != $passwort2 OR $username == "" OR $passwort == "")
|
||||
{
|
||||
echo "Eingabefehler. Bitte alle Felder korekt ausfüllen. <a href=\"eintragen.html\">Zurück</a>";
|
||||
exit;
|
||||
}
|
||||
$passwort = md5($passwort);
|
||||
|
||||
$result = mysqli_query($verbindung, "SELECT id FROM login WHERE username LIKE '$username'");
|
||||
$menge = mysqli_num_rows($result);
|
||||
|
||||
if($menge == 0)
|
||||
{
|
||||
$eintrag = "INSERT INTO login (username, passwort) VALUES ('$username', '$passwort')";
|
||||
$eintragen = mysqli_query($verbindung, $eintrag);
|
||||
|
||||
if($eintragen == true)
|
||||
{
|
||||
echo "Benutzername <b>$username</b> wurde erstellt. <a href=\"index.php\">Login</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Fehler beim Speichern des Benutzernames. <a href=\"eintragen.html\">Zurück</a>";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "Benutzername schon vorhanden. <a href=\"eintragen.html\">Zurück</a>";
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Escape Velocity by HTML5 UP
|
||||
html5up.net | @n33co
|
||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||
-->
|
||||
|
||||
<?php
|
||||
session_start();
|
||||
?>
|
||||
|
||||
<?php
|
||||
if(!isset($_SESSION["username"]))
|
||||
{
|
||||
echo "Bitte erst <a href=\"login.html\">einloggen</a>";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once ("config.php");
|
||||
require_once ("tpl/parser.php");
|
||||
|
||||
require_once ("tpl/mysql.class.php");
|
||||
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>BOSwatch</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jquery.dropotron.min.js"></script>
|
||||
<script src="js/skel.min.js"></script>
|
||||
<script src="js/skel-layers.min.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<noscript>
|
||||
<link rel="stylesheet" href="css/skel.css" />
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<link rel="stylesheet" href="css/style-desktop.css" />
|
||||
</noscript>
|
||||
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
|
||||
</head>
|
||||
<body class="no-sidebar">
|
||||
|
||||
<!-- Header -->
|
||||
<div id="header-wrapper" class="wrapper">
|
||||
<div id="header">
|
||||
|
||||
|
||||
|
||||
<!-- Nav -->
|
||||
<nav id="nav">
|
||||
<ul>
|
||||
<li><a href="show_pocsag.php">POCSAG</a></li>
|
||||
<li><a href="show_fms.php">FMS</a></li>
|
||||
<li><a href="show_zvei.php">ZVEI</a></li>
|
||||
<li><a href="prefs.php">Einstellungen</a></li>
|
||||
<li><a href="eintragen.html">Nutzer anlegen</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Highlights -->
|
||||
<div class="wrapper style1">
|
||||
<div class="title">Usermanagment</div>
|
||||
<div class="container">
|
||||
|
||||
<div style="width: 400px;margin-left:auto;margin-right:auto;text-align:center;">
|
||||
|
||||
<form action="eintragen.php" method="post">
|
||||
Username:<br>
|
||||
<input type="text" size="12"
|
||||
name="username"><br>
|
||||
|
||||
Passwort:<br>
|
||||
<input type="password" size="24" maxlength="50"
|
||||
name="passwort"><br>
|
||||
|
||||
Passwort wiederholen:<br>
|
||||
<input type="password" size="24" maxlength="50"
|
||||
name="passwort2"><br>
|
||||
|
||||
<input type="submit" value="Abschicken">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="copyright">
|
||||
<ul>
|
||||
<li style="color:grey;">© BOSWatch</li><li style="color:grey;">Design: <a href="http://html5up.net">HTML5 UP</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,58 +1,111 @@
|
|||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Escape Velocity by HTML5 UP
|
||||
html5up.net | @n33co
|
||||
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
|
||||
-->
|
||||
|
||||
<?php
|
||||
session_start();
|
||||
?>
|
||||
|
||||
<?php
|
||||
if(($_SESSION["username"])!="Kevin")
|
||||
if(!isset($_SESSION["username"]))
|
||||
{
|
||||
echo "Sie sind nicht berechtigt fuer diesen Bereich";
|
||||
echo "Bitte erst <a href='login.html'>einloggen</a>";
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
require_once ("config.php");
|
||||
require_once ("tpl/parser.php");
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$verbindung = mysql_connect("localhost", "root" , "kevin21")
|
||||
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
||||
|
||||
mysql_select_db("login") or die ("Datenbank konnte nicht ausgewählt werden");
|
||||
|
||||
$username = $_POST["username"];
|
||||
$passwort = $_POST["passwort"];
|
||||
$passwort2 = $_POST["passwort2"];
|
||||
|
||||
if($passwort != $passwort2 OR $username == "" OR $passwort == "")
|
||||
{
|
||||
echo "Eingabefehler. Bitte alle Felder korekt ausfüllen. <a href=\"eintragen.html\">Zurück</a>";
|
||||
exit;
|
||||
}
|
||||
$passwort = md5($passwort);
|
||||
|
||||
$result = mysql_query("SELECT id FROM login WHERE username LIKE '$username'");
|
||||
$menge = mysql_num_rows($result);
|
||||
|
||||
if($menge == 0)
|
||||
{
|
||||
$eintrag = "INSERT INTO login (username, passwort) VALUES ('$username', '$passwort')";
|
||||
$eintragen = mysql_query($eintrag);
|
||||
|
||||
if($eintragen == true)
|
||||
{
|
||||
echo "Benutzername <b>$username</b> wurde erstellt. <a href=\"login.html\">Login</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Fehler beim Speichern des Benutzernames. <a href=\"eintragen.html\">Zurück</a>";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "Benutzername schon vorhanden. <a href=\"eintragen.html\">Zurück</a>";
|
||||
}
|
||||
require_once ("tpl/mysql.class.php");
|
||||
$db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error = 1!
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>BOSwatch</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="" />
|
||||
<meta name="keywords" content="" />
|
||||
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
|
||||
<script src="js/jquery.min.js"></script>
|
||||
<script src="js/jquery.dropotron.min.js"></script>
|
||||
<script src="js/skel.min.js"></script>
|
||||
<script src="js/skel-layers.min.js"></script>
|
||||
<script src="js/init.js"></script>
|
||||
<noscript>
|
||||
<link rel="stylesheet" href="css/skel.css" />
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<link rel="stylesheet" href="css/style-desktop.css" />
|
||||
</noscript>
|
||||
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
|
||||
</head>
|
||||
<body class="no-sidebar">
|
||||
|
||||
<!-- Header -->
|
||||
<div id="header-wrapper" class="wrapper">
|
||||
<div id="header">
|
||||
|
||||
|
||||
|
||||
<!-- Nav -->
|
||||
<nav id="nav">
|
||||
<ul>
|
||||
<li><a href="show_pocsag.php">POCSAG</a></li>
|
||||
<li><a href="show_fms.php">FMS</a></li>
|
||||
<li><a href="show_zvei.php">ZVEI</a></li>
|
||||
<li><a href="prefs.php">Einstellungen</a></li>
|
||||
<li><a href="eintragen.php">Nutzer anlegen</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Highlights -->
|
||||
<div class="wrapper style1">
|
||||
<div class="title">Usermanagment</div>
|
||||
<div class="container">
|
||||
|
||||
<div style="width: 400px;margin-left:auto;margin-right:auto;text-align:center;">
|
||||
|
||||
<form action="do_eintragen.php" method="post">
|
||||
Username:<br>
|
||||
<input type="text" size="12"
|
||||
name="username"><br>
|
||||
|
||||
Passwort:<br>
|
||||
<input type="password" size="24" maxlength="50"
|
||||
name="passwort"><br>
|
||||
|
||||
Passwort wiederholen:<br>
|
||||
<input type="password" size="24" maxlength="50"
|
||||
name="passwort2"><br>
|
||||
|
||||
<input type="submit" value="Abschicken">
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="copyright">
|
||||
<ul>
|
||||
<li style="color:grey;">© BOSWatch</li><li style="color:grey;">Design: <a href="http://html5up.net">HTML5 UP</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ $db = new Database($dbhost, $dbuser, $dbpassword, $database, 1); //Show Error =
|
|||
|
||||
<!-- Logo -->
|
||||
<div id="logo">
|
||||
<h1><a href="index.html">Willkommen bei BOSWatch</a></h1>
|
||||
<h1><a href="index.php">Willkommen bei BOSWatch</a></h1>
|
||||
</div>
|
||||
|
||||
<!-- Nav -->
|
||||
|
|
@ -75,6 +75,14 @@ Dein Passwort:<br>
|
|||
<input type="password" size="24" maxlength="50"
|
||||
name="password"><br>
|
||||
|
||||
Startanzeige:<br>
|
||||
<select name="view">
|
||||
<option value="pocsag">POCSAG</option>
|
||||
<option value="fms">FMS</option>
|
||||
<option value="zvei">ZVEI</option>
|
||||
</select><br>
|
||||
|
||||
|
||||
<input type="submit" value="Login">
|
||||
</form>
|
||||
|
||||
|
|
@ -100,4 +108,4 @@ name="password"><br>
|
|||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -4,25 +4,44 @@ session_start();
|
|||
|
||||
<?php
|
||||
require_once ("config.php");
|
||||
$verbindung = mysql_connect($dbhost, $dbuser , $dbpassword)
|
||||
$verbindung = mysqli_connect($dbhost, $dbuser , $dbpassword)
|
||||
or die("Verbindung zur Datenbank konnte nicht hergestellt werden");
|
||||
mysql_select_db($tableLOG) or die ("Datenbank konnte nicht ausgewählt werden");
|
||||
mysqli_select_db($verbindung, $database) or die ("Datenbank konnte nicht ausgewählt werden");
|
||||
|
||||
if (!isset($_POST["username"]) XOR !isset($_POST["password"]))
|
||||
{
|
||||
echo "Fehlende Eingaben - <a href='index.php'>Login</a>";
|
||||
exit;
|
||||
}
|
||||
|
||||
$username = $_POST["username"];
|
||||
$passwort = md5($_POST["password"]);
|
||||
|
||||
$abfrage = "SELECT username, passwort FROM" $tableLOG "WHERE username LIKE '$username' LIMIT 1";
|
||||
$ergebnis = mysql_query($abfrage);
|
||||
$row = mysql_fetch_object($ergebnis);
|
||||
|
||||
$abfrage = "SELECT username, passwort FROM ".$tableLOG." WHERE username LIKE '$username' LIMIT 1";
|
||||
$ergebnis = mysqli_query($verbindung, $abfrage);
|
||||
$row = mysqli_fetch_object($ergebnis);
|
||||
|
||||
if($row->passwort == $passwort)
|
||||
{
|
||||
$_SESSION["username"] = $username;
|
||||
header("Location: /show_pocsag.php");
|
||||
switch ($_POST["view"]) {
|
||||
case 'pocsag':
|
||||
header("Location: show_pocsag.php");
|
||||
break;
|
||||
case 'zvei':
|
||||
header("Location: show_zvei.php");
|
||||
break;
|
||||
case 'fms':
|
||||
header("Location: show_fms.php");
|
||||
break;
|
||||
default:
|
||||
header("Location: show_pocsag.php");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Benutzername und/oder Passwort waren falsch. <a href=\"login.html\">Login</a>";
|
||||
echo "Benutzername und/oder Passwort waren falsch. <a href=\"index.php\">Login</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
6
exampleAddOns/alarmMonitorWeb/logout.php
Normal file
6
exampleAddOns/alarmMonitorWeb/logout.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
session_unset();
|
||||
header("Location: index.php");
|
||||
|
||||
?>
|
||||
|
|
@ -11,7 +11,7 @@ session_start();
|
|||
?>
|
||||
|
||||
<?php
|
||||
if(($_SESSION["username"])!="Test")
|
||||
if(($_SESSION["username"])!="admin")
|
||||
{
|
||||
echo "Sie sind nicht berechtigt fuer diesen Bereich";
|
||||
exit;
|
||||
|
|
@ -27,7 +27,7 @@ include("tpl/a_header.php");
|
|||
<div class="wrapper style3">
|
||||
<div class="title">Einstellungen</div>
|
||||
<div id="highlights" class="container" style="">
|
||||
|
||||
<!--
|
||||
<tr>
|
||||
<td>Filter Range Start:</td><td>
|
||||
<input type="text" size="24" maxlength="50" value="
|
||||
|
|
@ -43,7 +43,7 @@ $ini_array = parse_ini_file("config.ini");
|
|||
echo($ini_array['filter_range_end']);
|
||||
?>
|
||||
"></td>
|
||||
</tr>
|
||||
</tr>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -60,4 +60,4 @@ echo($ini_array['filter_range_end']);
|
|||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@
|
|||
<li><a href="show_fms.php">FMS</a></li>
|
||||
<li><a href="show_zvei.php">ZVEI</a></li>
|
||||
<li><a href="prefs.php">Einstellungen</a></li>
|
||||
<li><a href="eintragen.html">Nutzer anlegen</a></li>
|
||||
<li><a href="eintragen.php">Nutzer anlegen</a></li>
|
||||
<li><a href="logout.php">Ausloggen</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,16 +23,16 @@ Simple Database Class (C) by Bastian Schroll
|
|||
function __construct($host, $user, $password, $database, $show_error = 1)
|
||||
{
|
||||
$this->show_error = $show_error;
|
||||
@$this->conn = mysql_connect($host, $user, $password);
|
||||
@$this->conn = mysqli_connect($host, $user, $password);
|
||||
if ($this->conn == false)
|
||||
{
|
||||
$this->error("Keine Verbindung zum Datenbank Server!", mysql_error());
|
||||
$this->error("Keine Verbindung zum Datenbank Server!", mysqli_error($this->conn));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!@mysql_select_db($database, $this->conn))
|
||||
if (!@mysqli_select_db($this->conn, $database))
|
||||
{
|
||||
$this->error("Datenbank nicht gefunden!", mysql_error());
|
||||
$this->error("Datenbank nicht gefunden!", mysqli_error($this->conn));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
@ -48,10 +48,10 @@ Simple Database Class (C) by Bastian Schroll
|
|||
*/
|
||||
function query($query)
|
||||
{
|
||||
$this->result = @mysql_query($query, $this->conn);
|
||||
$this->result = @mysqli_query($this->conn, $query);
|
||||
if ($this->result == false)
|
||||
{
|
||||
$this->error("Fehlerhafte Datenbank Anfrage!", mysql_error());
|
||||
$this->error("Fehlerhafte Datenbank Anfrage!", mysqli_error($this->conn));
|
||||
return false;
|
||||
}
|
||||
return $this->result;
|
||||
|
|
@ -69,10 +69,10 @@ Simple Database Class (C) by Bastian Schroll
|
|||
{
|
||||
if ($result != null)
|
||||
{
|
||||
return @mysql_fetch_assoc($result);
|
||||
return @mysqli_fetch_assoc($result);
|
||||
} else
|
||||
{
|
||||
return @mysql_fetch_assoc($this->result);
|
||||
return @mysqli_fetch_assoc($this->result);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</tr>
|
||||
<?php
|
||||
|
||||
$db->query("SELECT id, time, ric, funktion, text, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100");
|
||||
$db->query("SELECT id, time, ric, function, msg, description FROM ".$tablePOC." ORDER BY id DESC LIMIT 100");
|
||||
$Rows = array();
|
||||
while ($daten = $db->fetchAssoc())
|
||||
{
|
||||
|
|
@ -29,11 +29,11 @@
|
|||
// echo "<td>". $poc['id'] . "</td>";
|
||||
//
|
||||
echo "<td>". $poc['description'] . "</td>";
|
||||
echo "<td>". $poc['text'] . "</td>";
|
||||
echo "<td>". $poc['msg'] . "</td>";
|
||||
echo "<td>". $time . "</td>";
|
||||
echo "<td>". $poc['ric'] . "</td>";
|
||||
echo "<td>". $poc['funktion'] . "</td>";
|
||||
echo "<td>". $poc['function'] . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in a new issue