Initial commit
This commit is contained in:
71
service/password/forgot-password.php
Normal file
71
service/password/forgot-password.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php session_start();
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<!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 änderst aktuell dein Passwort"><i class="fas fa-key"></i>Passwort-Service</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<?php
|
||||
|
||||
include "../../files/errorcodesscript.inc.php";
|
||||
|
||||
?>
|
||||
<h4>Passwort zurücksetzen</h4>
|
||||
<form action='sendcode' method="post">
|
||||
<input type="text" name="Benutzername" required placeholder="Benutzername">
|
||||
<br>
|
||||
<input type="email" name="Email" required placeholder="Email">
|
||||
<br>
|
||||
<button type="submit" class="classic-button classic-button-grey">
|
||||
Weiter
|
||||
<i class="fas fa-angle-right"> </i>
|
||||
</button>
|
||||
</form>
|
||||
<a class="no-formatting" href="../../login"><small>Ich weiß mein Passwort</small></a>
|
||||
</div>
|
||||
<a class="no-formatting impressum" href="https://www.timvandenboom.de/impressum">Impressum</a>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
81
service/password/new-password.php
Normal file
81
service/password/new-password.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php session_start();
|
||||
|
||||
$Benutzername = strip_tags(htmlentities($_SESSION["Benutzername"]));
|
||||
$Email = strip_tags(htmlentities($_SESSION["Email"]));
|
||||
$Code = strip_tags(htmlentities($_POST["Code"]));
|
||||
$RealCode = $_SESSION["RealCode"];
|
||||
|
||||
$_SESSION["Verification"] = 'true';
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<!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">
|
||||
</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 änderst aktuell dein Passwort"><i class="fas fa-key"></i>Passwort-Service</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<?php
|
||||
|
||||
|
||||
require "../../files/ezine_db.inc.php";
|
||||
|
||||
if(empty($Benutzername) || empty($Email) || empty($Code) || empty($RealCode)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=forgot-password'>");
|
||||
}
|
||||
else{
|
||||
if($Code == $RealCode) {
|
||||
|
||||
?>
|
||||
<h4>Neues Passwort festlegen</h4>
|
||||
<form action='../../actions/change-password' method='post'>
|
||||
<input type="hidden" value="<?php $Benutzername; ?>" name="Benutzername">
|
||||
<input type="password" name="Passwort1" required placeholder="Passwort" id="toggle-password1">
|
||||
<input type="checkbox" class="fas fa-eye" id="toggle-password-chb1-eye" onclick="togglePassword(1)">
|
||||
<input type="checkbox" class="fas fa-eye-slash" id="toggle-password-chb1-eye-slash" onclick="togglePassword(1)"><br>
|
||||
<input type="password" name="Passwort2" required placeholder="Passwort wiederholen" id="toggle-password2">
|
||||
<input type="checkbox" class="fas fa-eye" id="toggle-password-chb2-eye" onclick="togglePassword(2)">
|
||||
<input type="checkbox" class="fas fa-eye-slash" id="toggle-password-chb2-eye-slash" onclick="togglePassword(2)"><br>
|
||||
<button type="submit" class="classic-button classic-button-grey">
|
||||
<i class="fas fa-check"> </i>
|
||||
Fertigstellen
|
||||
</button>
|
||||
</form>
|
||||
<?php
|
||||
|
||||
}
|
||||
else {
|
||||
$_SESSION["errorCode"] = 'wrongCode';
|
||||
print("<meta http-equiv='refresh' content='0; URL=forgot-password'>");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</middle>
|
||||
</body>
|
||||
</html>
|
||||
97
service/password/sendcode.php
Normal file
97
service/password/sendcode.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php session_start();
|
||||
|
||||
if($_POST["Benutzername"] != '' && $_POST["Email"] != '') {
|
||||
$Benutzername = strip_tags(htmlentities($_POST["Benutzername"]));
|
||||
$Email = strip_tags(htmlentities($_POST["Email"]));
|
||||
}
|
||||
else {
|
||||
$Benutzername = $_SESSION["Benutzername"];
|
||||
$Email = $_SESSION["Email"];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$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;
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<!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 änderst aktuell dein Passwort"><i class="fas fa-key"></i>Passwort-Service</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="middle">
|
||||
<?php
|
||||
|
||||
require "../../files/ezine_db.inc.php";
|
||||
|
||||
if(empty($Benutzername) || empty($Email)) {
|
||||
$_SESSION["errorCode"] = 'generalError';
|
||||
print("<meta http-equiv='refresh' content='0; URL=forgot-password'>");
|
||||
}
|
||||
else{
|
||||
|
||||
$sql = "SELECT * FROM `VokabelBoxUsers` WHERE `Benutzername` = '$Benutzername' AND `Email` = '$Email'";
|
||||
$result_articles = $conn->query($sql);
|
||||
|
||||
if(mysqli_num_rows($result_articles))
|
||||
{
|
||||
$betreff = "Passwort fuer VokabelBox zuruecksetzen";
|
||||
$from = "VokabelBox";
|
||||
$text = "Dein Code: " . $RealCode;
|
||||
mail($Email, $betreff, $text, $from);
|
||||
|
||||
?>
|
||||
<form action='new-password' method='post'>
|
||||
<p>Es wurde ein Code an <?php print("$Email"); ?> geschickt.</p>
|
||||
<input maxlength='8' type='text' name='Code' required placeholder='Dein Code'>
|
||||
<button type="submit" class="classic-button classic-button-grey">
|
||||
Weiter
|
||||
<i class="fas fa-angle-right"> </i>
|
||||
</button>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$_SESSION["errorCode"] = 'noDataFound';
|
||||
print("<meta http-equiv='refresh' content='0; URL=forgot-password'>");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</middle>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user