Revize b748cb5f
Přidáno uživatelem Tomáš Pašek před více než 3 roky(ů)
application/index.php | ||
---|---|---|
1 |
<?php |
|
2 |
session_start(); |
|
3 |
?> |
|
4 |
|
|
1 | 5 |
<!doctype html> |
2 | 6 |
|
3 | 7 |
<html > |
... | ... | |
30 | 34 |
</div> |
31 | 35 |
<?php include "./view/footer.html" ?> |
32 | 36 |
</div> |
33 |
|
|
34 | 37 |
<?php include "./view/modals/loginModal.html" ?> |
35 | 38 |
<?php include "./view/modals/settingsModal.html" ?> |
39 |
<!--TODO logování upravit, zde pouze příklad --> |
|
40 |
<?php if(isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true) {?> |
|
41 |
<h1>LOGGEDIN!!!!!!!!!</h1> |
|
42 |
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="logout()">Odhlásit se</button> |
|
43 |
<?php }?> |
|
36 | 44 |
</body> |
37 | 45 |
</html> |
46 |
|
|
47 |
<script> |
|
48 |
function logout () { |
|
49 |
var data = new FormData(); |
|
50 |
var xhr = new XMLHttpRequest(); |
|
51 |
xhr.open("POST", "controller/LogoutController.php"); |
|
52 |
xhr.onload = function(){ |
|
53 |
let search = JSON.parse(this.response); |
|
54 |
console.log(search); |
|
55 |
}; |
|
56 |
xhr.send(data); |
|
57 |
return false; |
|
58 |
} |
|
59 |
|
|
60 |
</script> |
Také k dispozici: Unified diff
Feature #8522 Login a bezpečnost webové aplikace
Feature #8523 Tvorba uživatele