Initial commit
This commit is contained in:
93
service/createaccount/activate-account.php
Normal file
93
service/createaccount/activate-account.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = strip_tags(htmlentities($_SESSION["Benutzername"]));
|
||||
$Email = strip_tags(htmlentities($_SESSION["Email"]));
|
||||
$Passwort = strip_tags(htmlentities($_SESSION["Passwort"]));
|
||||
$Code = strip_tags(htmlentities($_POST["Code"]));
|
||||
$RealCode = $_SESSION["RealCode"];
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>VokabelBox</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../files/style.css" />
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<p onclick="window.location.href='index'"></p>
|
||||
<div class="more-menu">
|
||||
<button class="fas fa-ellipsis-v"></button>
|
||||
<div class="more-menu-content">
|
||||
<div onclick="window.location.href='../../index'" title="VokabelBox"><i class="fas fa-home"></i>VokabelBox</div>
|
||||
<div onclick="window.location.href='../../myaccount'" title="Mein Account"><i class="far fa-user-circle"></i>Mein Account</div>
|
||||
<div onclick="window.location.href='../../marks'" title="Meine Noten"><i class="fas fa-table"></i>Meine Noten</div>
|
||||
<div onclick="window.location.href='../../search'" title="Meine VokabelBox durchsuchen"><i class="fas fa-search"></i>Suchen</div>
|
||||
<div onclick="window.location.href='../../help'" title="Hilfecenter öffnen"><i class="fas fa-question-circle"></i>Hilfe</div>
|
||||
<div onclick="window.location.href='../../actions/logout'" title="Von VokabelBox abmelden"><i class="fas fa-sign-out-alt"></i>Ausloggen</div>
|
||||
<br>
|
||||
<div class="selected" title="Du erstellst Dir gerade ein Benutzerkonto"><i class="fas fa-user"></i>Account erstellen</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<?php
|
||||
|
||||
require "../../files/ezine_db.inc.php";
|
||||
|
||||
if(empty($Benutzername) || empty($Email) || empty($Passwort) || empty($Code) || empty($RealCode)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else{
|
||||
if($Code == $RealCode) {
|
||||
|
||||
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Benutzername` = '$Benutzername'";
|
||||
$result_articles = $conn->query($sql);
|
||||
|
||||
if(mysqli_num_rows($result_articles))
|
||||
{
|
||||
$_SESSION["errorCode"] = 'usernameRegistered';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Email` = '$Email'";
|
||||
$result_articles = $conn->query($sql);
|
||||
|
||||
if(mysqli_num_rows($result_articles))
|
||||
{
|
||||
$_SESSION["errorCode"] = 'emailRegistered';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else {
|
||||
|
||||
print(
|
||||
" <p>Willkommen bei VokabelBox!</p>
|
||||
<button onclick=\"window.location.href='../../index'\" class='classic-button classic-button-grey'>Überpringen <i class='fas fa-forward'></i> </button>
|
||||
<button onclick=\"window.location.href='intro?p=1'\" class='classic-button classic-button-grey'>Einleitung <i class='fas fa-angle-right'></i> </button>
|
||||
");
|
||||
|
||||
|
||||
$conn->query("INSERT INTO `VokabelBoxUsers` (`Benutzername`,`Email`,`Passwort`,`GrossKlein`,`Zeit`) VALUES ('$Benutzername','$Email','$Passwort','','3')");
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$_SESSION["errorCode"] = 'wrongCode';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</middle>
|
||||
</body>
|
||||
</html>
|
||||
128
service/createaccount/create-account.php
Normal file
128
service/createaccount/create-account.php
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = $_POST["Benutzername"];
|
||||
|
||||
|
||||
|
||||
$Email = strip_tags(htmlentities($_POST["Email"]));
|
||||
$Passwort = strip_tags(htmlentities($_POST["Passwort"]));
|
||||
$Passwort2 = strip_tags(htmlentities($_POST["Passwort2"]));
|
||||
|
||||
$Passwort = hash('sha512',$Passwort);
|
||||
|
||||
$Passwort2 = hash('sha512',$Passwort2);
|
||||
|
||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||
$randstring = '';
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
$randstring = $characters[rand(0, strlen($characters))];
|
||||
}
|
||||
$randstring = hash('crc32',$randstring);
|
||||
$RealCode = $randstring;
|
||||
$_SESSION["RealCode"] = $randstring;
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Email"] = $Email;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>VokabelBox</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../files/style.css" />
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<p onclick="window.location.href='../../index'"></p>
|
||||
<div class="more-menu">
|
||||
<button class="fas fa-ellipsis-v"></button>
|
||||
<div class="more-menu-content">
|
||||
<div onclick="window.location.href='../../index'" title="VokabelBox"><i class="fas fa-home"></i>VokabelBox</div>
|
||||
<div onclick="window.location.href='../../myaccount'" title="Mein Account"><i class="far fa-user-circle"></i>Mein Account</div>
|
||||
<div onclick="window.location.href='../../marks'" title="Meine Noten"><i class="fas fa-table"></i>Meine Noten</div>
|
||||
<div onclick="window.location.href='../../search'" title="Meine VokabelBox durchsuchen"><i class="fas fa-search"></i>Suchen</div>
|
||||
<div onclick="window.location.href='../../help'" title="Hilfecenter öffnen"><i class="fas fa-question-circle"></i>Hilfe</div>
|
||||
<div onclick="window.location.href='../../actions/logout'" title="Von VokabelBox abmelden"><i class="fas fa-sign-out-alt"></i>Ausloggen</div>
|
||||
<br>
|
||||
<div class="selected" title="Du erstellst Dir gerade ein Benutzerkonto"><i class="fas fa-user"></i>Account erstellen</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<?php
|
||||
|
||||
require "../../files/ezine_db.inc.php";
|
||||
|
||||
if(empty($Benutzername) || empty($Email) || empty($Passwort) || empty($Passwort2)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else{
|
||||
if($Passwort != $Passwort2) {
|
||||
$_SESSION["errorCode"] = 'keineUebereinstimmung';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else {
|
||||
|
||||
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Benutzername` = '$Benutzername'";
|
||||
$result_articles = $conn->query($sql);
|
||||
|
||||
if(mysqli_num_rows($result_articles))
|
||||
{
|
||||
$_SESSION["errorCode"] = 'usernameRegistered';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else {
|
||||
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Email` = '$Email'";
|
||||
$result_articles = $conn->query($sql);
|
||||
|
||||
if(mysqli_num_rows($result_articles))
|
||||
{
|
||||
$_SESSION["errorCode"] = 'emailRegistered';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else {
|
||||
|
||||
if(strpos($Benutzername,'\'')!==false || strpos($Benutzername,'\\')!==false) {
|
||||
$_SESSION["errorCode"] = 'unallowedCharacters';
|
||||
print("<meta http-equiv='refresh' content='0; URL=../../register'>");
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
$betreff = "Accountverifizierung fuer VokabelBox";
|
||||
$from = "VokabelBox";
|
||||
$text = "Dein Code: " . $RealCode;
|
||||
mail($Email, $betreff, $text, $from);
|
||||
|
||||
print(
|
||||
" <form action='activate-account' method='post'>
|
||||
<p>Es wurde ein Code an <b>$Email </b>geschickt.</p>
|
||||
<input maxlength='8' type='text' name='Code' required placeholder='Dein Code'>
|
||||
<input type='submit' value='Überprüfen' class='classic-button classic-button-grey'>
|
||||
</form>
|
||||
");
|
||||
|
||||
$_SESSION["Benutzername"] = $Benutzername;
|
||||
$_SESSION["Passwort"] = $Passwort;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
</middle>
|
||||
</body>
|
||||
</html>
|
||||
104
service/createaccount/intro.php
Normal file
104
service/createaccount/intro.php
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php session_start();
|
||||
|
||||
$_SESSION["redirect"] = 'intro';
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>VokabelBox</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="../../files/style.css" />
|
||||
<script language="javascript" type="text/javascript" src="../../files/scripts.js"></script>
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css" integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-57x57.png">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-60x60.png">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-72x72.png">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-76x76.png">
|
||||
<link rel="apple-touch-icon" sizes="114x114" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-114x114.png">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-120x120.png">
|
||||
<link rel="apple-touch-icon" sizes="144x144" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-144x144.png">
|
||||
<link rel="apple-touch-icon" sizes="152x152" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-152x152.png">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="https://www.timvandenboom.de/Favicons/VokabelBox/apple-icon-180x180.png">
|
||||
<link rel="icon" type="image/png" sizes="192x192" href="https://www.timvandenboom.de/Favicons/VokabelBox/android-icon-192x192.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="96x96" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-96x96.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="https://www.timvandenboom.de/Favicons/VokabelBox/favicon-16x16.png">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="msapplication-TileImage" content="https://www.timvandenboom.de/Favicons/VokabelBox/ms-icon-144x144.png">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<p onclick="window.location.href='../../index'"></p>
|
||||
<div class="more-menu">
|
||||
<button class="fas fa-ellipsis-v"></button>
|
||||
<div class="more-menu-content">
|
||||
<div onclick="window.location.href='../../index'" title="VokabelBox"><i class="fas fa-home"></i>VokabelBox</div>
|
||||
<div onclick="window.location.href='../../myaccount'" title="Mein Account"><i class="far fa-user-circle"></i>Mein Account</div>
|
||||
<div onclick="window.location.href='../../marks'" title="Meine Noten"><i class="fas fa-table"></i>Meine Noten</div>
|
||||
<div onclick="window.location.href='../../search'" title="Meine VokabelBox durchsuchen"><i class="fas fa-search"></i>Suchen</div>
|
||||
<div onclick="window.location.href='../../help'" title="Hilfecenter öffnen"><i class="fas fa-question-circle"></i>Hilfe</div>
|
||||
<div onclick="window.location.href='../../actions/logout'" title="Von VokabelBox abmelden"><i class="fas fa-sign-out-alt"></i>Ausloggen</div>
|
||||
<br>
|
||||
<div class="selected" title="Du erstellst Dir gerade ein Benutzerkonto"><i class="fas fa-user"></i>Account erstellen</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<?php
|
||||
|
||||
|
||||
require "../../files/ezine_db.inc.php";
|
||||
|
||||
include "../../files/loginscript.inc.php";
|
||||
|
||||
include "../../files/errorcodesscript.inc.php";
|
||||
|
||||
if($LoggedIn == 'true') {
|
||||
|
||||
$page= strip_tags(htmlentities($_GET["p"]));
|
||||
|
||||
if($page == 1) {
|
||||
print(
|
||||
"<p>VokabelBox ist ein Platz für all deine Vokabeln. Jedem Nutzer stehen theoretisch unendlich viele Ordner und Vokabeln zur Verfügung.</p>
|
||||
");
|
||||
}
|
||||
if($page == 2) {
|
||||
print(
|
||||
"<p>Und das alles völlig kostenlos.</p>
|
||||
");
|
||||
}
|
||||
if($page == 3) {
|
||||
print(
|
||||
"<p>Und so funktioniert's: Nach Beenden des Intros wirst du zur Startseite weitergeleitet. Dort siehst du immer alle deine Ordner.</p>
|
||||
");
|
||||
}
|
||||
if($page == 4) {
|
||||
print(
|
||||
"<p>Ein Ordner kann zum Beispiel eine Lektion Vokabeln im Lehrbuch sein. Natürlich kannst du dich die Vokabeln auch abfragen lassen oder dir die Tabelle ausdrucken um sie auch offline lernen zu können.</p>
|
||||
");
|
||||
}
|
||||
if($page == 5) {
|
||||
print(
|
||||
"<p>Du kannst deine Vokabeln überall lernen, da sie unter allen Geräten an den die angemeldet bist synchronisiert sind.</p>
|
||||
");
|
||||
}
|
||||
if($page == 6) {
|
||||
print(
|
||||
"<p>Fang' jetzt mit dem Lernen an!</p>
|
||||
");
|
||||
}
|
||||
if($page == 7) {
|
||||
print("<meta http-equiv='refresh' content='0; URL=https://www.timvandenboom.de/vokabelbox/'>");
|
||||
}
|
||||
$page = $page + 1;
|
||||
print(
|
||||
"<button onclick=\"window.location.href='intro?p=$page'\" class='classic-button classic-button-grey'>Weiter <i class='fas fa-angle-right'></i> </button>");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</middle>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user