Revize a9bb4272
Přidáno uživatelem Ondřej Drtina před více než 3 roky(ů)
application/index.php | ||
---|---|---|
35 | 35 |
<?php include "./view/footer.html" ?> |
36 | 36 |
</div> |
37 | 37 |
<?php include "./view/modals/loginModal.html" ?> |
38 |
<?php include "./view/modals/invalidLoginModal.html" ?> |
|
38 | 39 |
<?php include "./view/modals/settingsModal.html" ?> |
39 | 40 |
<!--TODO logování upravit, zde pouze příklad --> |
40 | 41 |
<?php if(isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true) {?> |
application/search.php | ||
---|---|---|
34 | 34 |
</div> |
35 | 35 |
|
36 | 36 |
<?php include "./view/modals/loginModal.html" ?> |
37 |
<?php include "./view/modals/invalidLoginModal.html" ?> |
|
37 | 38 |
<?php include "./view/modals/detailModal.html" ?> |
38 | 39 |
<?php include "./view/modals/settingsModal.html" ?> |
39 | 40 |
<?php include "./view/modals/editModal.html" ?> |
application/view/modals/invalidLoginModal.html | ||
---|---|---|
1 |
<div id="invalidlogin-modal" class="modal fade" role="dialog"> |
|
2 |
<div class="modal-dialog modal-dialog-centered" role="document"> |
|
3 |
<div class="modal-content"> |
|
4 |
<div class="modal-header"> |
|
5 |
<h4 class="modal-title">Neplatné údaje</h4> |
|
6 |
<button type="button" class="close" data-dismiss="modal">×</button> |
|
7 |
</div> |
|
8 |
<div class="modal-body"> |
|
9 |
<div class="container"> |
|
10 |
<div class="row"> |
|
11 |
<div class="col-xs-12 col-sm-5"> |
|
12 |
<label for="itemsPerPage">Bylo zadáno špatné jméno či heslo! Zkuste to znovu.</label> |
|
13 |
</div> |
|
14 |
</div> |
|
15 |
</div> |
|
16 |
</div> |
|
17 |
<div class="modal-footer"> |
|
18 |
<button type="button" class="btn btn-default" data-dismiss="modal">Zavřít</button> |
|
19 |
</div> |
|
20 |
</div> |
|
21 |
</div> |
|
22 |
</div> |
application/view/modals/loginModal.html | ||
---|---|---|
51 | 51 |
var xhr = new XMLHttpRequest(); |
52 | 52 |
xhr.open("POST", "controller/LoginController.php"); |
53 | 53 |
xhr.onload = function(){ |
54 |
let search = JSON.parse(this.response); |
|
55 |
console.log(this.response); |
|
54 |
if(this.response == 'Incorrect username and/or password!'){ //login was not successful, show modal |
|
55 |
$("#invalidlogin-modal").modal("show"); |
|
56 |
}else{ //login was successful, refresh page to apply changes in visible items |
|
57 |
window.location.href = window.location.href; |
|
58 |
} |
|
56 | 59 |
}; |
57 | 60 |
xhr.send(data); |
61 |
|
|
58 | 62 |
return false; |
59 | 63 |
} |
60 | 64 |
|
Také k dispozici: Unified diff
#8643 - při zadání špatných přihlaš. údajů vyskočí modal + při úspěšném přihlášení obnovení stránky. Fčí core, dodělám