M5 A1 fertig
This commit is contained in:
@@ -13,15 +13,14 @@ function anmelden(string $email, string $passwort)
|
|||||||
|
|
||||||
if ($row['passwort'] == NULL) {
|
if ($row['passwort'] == NULL) {
|
||||||
$row = 0;
|
$row = 0;
|
||||||
}
|
} elseif ($row['passwort'] == $passwort) {
|
||||||
elseif ($row['passwort'] == $passwort) {
|
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
mysqli_begin_transaction($link);
|
mysqli_begin_transaction($link);
|
||||||
$sql = "UPDATE benutzer SET letzteanmeldung = current_time, anzahlfehler = 0 WHERE email = '$email'";
|
$sql = "UPDATE benutzer SET letzteanmeldung = current_time, anzahlfehler = 0 WHERE email = '$email'";
|
||||||
$link->query($sql);
|
$link->query($sql);
|
||||||
|
|
||||||
$sql = "UPDATE benutzer SET anzahlanmeldungen = anzahlanmeldungen + 1 WHERE id = ".$row['id'];
|
$sql = "UPDATE benutzer SET anzahlanmeldungen = anzahlanmeldungen + 1 WHERE id = " . $row['id'];
|
||||||
$link->query($sql);
|
$link->query($sql);
|
||||||
|
|
||||||
mysqli_commit($link);
|
mysqli_commit($link);
|
||||||
@@ -31,8 +30,7 @@ function anmelden(string $email, string $passwort)
|
|||||||
$_SESSION['name'] = $row['name'];
|
$_SESSION['name'] = $row['name'];
|
||||||
$_SESSION['email'] = $row['email'];
|
$_SESSION['email'] = $row['email'];
|
||||||
return 1;
|
return 1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
mysqli_begin_transaction($link);
|
mysqli_begin_transaction($link);
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ return array(
|
|||||||
|
|
||||||
'/anmeldung' => 'AnmeldungController@start',
|
'/anmeldung' => 'AnmeldungController@start',
|
||||||
'/anmeldung_verifizieren' => 'AnmeldungController@anmeldung_verifizieren',
|
'/anmeldung_verifizieren' => 'AnmeldungController@anmeldung_verifizieren',
|
||||||
'/anmeldung_nichtkorrekt' => 'AnmeldungController@check',
|
'/anmeldung_fehler' => 'AnmeldungController@check',
|
||||||
'/abmeldung' => 'AnmeldungController@abmelden'
|
'/abmeldung' => 'AnmeldungController@abmelden'
|
||||||
);
|
);
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<?php echo \htmlentities(session_start()??'', ENT_QUOTES, 'UTF-8', false); ?>
|
<?php echo \htmlentities(session_start()??'', ENT_QUOTES, 'UTF-8', false); ?>
|
||||||
|
|
||||||
Anmeldung erlaubt!
|
Anmeldung erlaubt!
|
||||||
<?php else: ?> Anmeldung nicht erlaubt!
|
<?php else: ?> Es ist ein Fehler aufgetretten!
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php $this->stopSection(); ?>
|
<?php $this->stopSection(); ?>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
<?php $this->startSection("main"); ?>
|
<?php $this->startSection("main"); ?>
|
||||||
|
|
||||||
<?php if($anmeldung == 1): ?>
|
<?php if($anmeldung == 1): ?>
|
||||||
<meta http-equiv="refresh" content="/main"/>
|
<meta http-equiv="refresh" content="/"/>
|
||||||
<form id="form_ok" action="/main"></form>
|
<form id="form_ok" action="/"></form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
||||||
<form method="post" id="auto_form" action="/anmeldung_nichtkorrekt">
|
<form method="post" id="auto_form" action="/anmeldung_fehler">
|
||||||
<input type="hidden" name="email" value=<?php echo \htmlentities($email??'', ENT_QUOTES, 'UTF-8', false); ?>>
|
<input type="hidden" name="email" value=<?php echo \htmlentities($email??'', ENT_QUOTES, 'UTF-8', false); ?>>
|
||||||
<input type="hidden" name="passwort" value=<?php echo \htmlentities($passwort??'', ENT_QUOTES, 'UTF-8', false); ?>>
|
<input type="hidden" name="passwort" value=<?php echo \htmlentities($passwort??'', ENT_QUOTES, 'UTF-8', false); ?>>
|
||||||
<input type="hidden" name="anmeldung" value=<?php echo \htmlentities($anmeldung??'', ENT_QUOTES, 'UTF-8', false); ?>>
|
<input type="hidden" name="anmeldung" value=<?php echo \htmlentities($anmeldung??'', ENT_QUOTES, 'UTF-8', false); ?>>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
@elseif ($anmeldung == 1)
|
@elseif ($anmeldung == 1)
|
||||||
{{ session_start() }}
|
{{ session_start() }}
|
||||||
Anmeldung erlaubt!
|
Anmeldung erlaubt!
|
||||||
@else Anmeldung nicht erlaubt!
|
@else Es ist ein Fehler aufgetretten!
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
23
M5/emensa/views/m5_a1/anmeldung_nichtkorrekt.blade.php
Normal file
23
M5/emensa/views/m5_a1/anmeldung_nichtkorrekt.blade.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
@extends("m5_a1.layout_anmeldung")
|
||||||
|
|
||||||
|
@section("main")
|
||||||
|
|
||||||
|
<form action="/anmeldung_verifizieren" method="post">
|
||||||
|
|
||||||
|
<label for="email">E-Mail</label>
|
||||||
|
<input id="email" name="email" type="email" placeholder="email" required maxlength="100">
|
||||||
|
|
||||||
|
<label for="passwort">Passwort</label>
|
||||||
|
<input id="passwort" name="passwort" type="password" placeholder="passwort" required maxlength="200">
|
||||||
|
|
||||||
|
<button type="submit" >Anmelden</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
@if(!isset($anmeldung)) Bitte anmelden!
|
||||||
|
@elseif ($anmeldung == 1)
|
||||||
|
{{ session_start() }}
|
||||||
|
Anmeldung erlaubt!
|
||||||
|
@else Es ist ein Fehler aufgetretten!
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
@section("main")
|
@section("main")
|
||||||
|
|
||||||
@if($anmeldung == 1)
|
@if($anmeldung == 1)
|
||||||
<meta http-equiv="refresh" content="/main"/>
|
<meta http-equiv="refresh" content="/"/>
|
||||||
<form id="form_ok" action="/main"></form>
|
<form id="form_ok" action="/"></form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
</script>
|
</script>
|
||||||
@else
|
@else
|
||||||
|
|
||||||
<form method="post" id="auto_form" action="/anmeldung_nichtkorrekt">
|
<form method="post" id="auto_form" action="/anmeldung_fehler">
|
||||||
<input type="hidden" name="email" value={{ $email}}>
|
<input type="hidden" name="email" value={{ $email}}>
|
||||||
<input type="hidden" name="passwort" value={{$passwort}}>
|
<input type="hidden" name="passwort" value={{$passwort}}>
|
||||||
<input type="hidden" name="anmeldung" value={{$anmeldung }}>
|
<input type="hidden" name="anmeldung" value={{$anmeldung }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user