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