mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-05 22:45:18 +00:00
Enabling basic functionality
- removed deprecated functions (mysql) - adding function: select view at login - adapting queries to database structure - some minor stuff
This commit is contained in:
parent
1a9e2a34d1
commit
c02cd74586
7 changed files with 203 additions and 60 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue