+logout working
This commit is contained in:
parent
d1a45681a2
commit
a53cccc52e
@ -33,7 +33,6 @@ public class UserBean {
|
|||||||
@Getter
|
@Getter
|
||||||
private boolean error = false;
|
private boolean error = false;
|
||||||
|
|
||||||
|
|
||||||
public String login() {
|
public String login() {
|
||||||
Database db = Database.getInstance();
|
Database db = Database.getInstance();
|
||||||
User user = db.user().get(username);
|
User user = db.user().get(username);
|
||||||
@ -56,6 +55,7 @@ public class UserBean {
|
|||||||
|
|
||||||
public String logout() {
|
public String logout() {
|
||||||
user = null;
|
user = null;
|
||||||
|
loggedIn = false;
|
||||||
return "index.html";
|
return "index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,13 @@
|
|||||||
<ol>
|
<ol>
|
||||||
<li><a href="orders.xhtml">Meine Bestellungen</a></li>
|
<li><a href="orders.xhtml">Meine Bestellungen</a></li>
|
||||||
<li><a href="">Adressen und Konten</a></li>
|
<li><a href="">Adressen und Konten</a></li>
|
||||||
<li><a href="logout.xhtml">Abmelden</a></li>
|
<h:form>
|
||||||
|
<h:commandLink action="#{userBean.logout}">Abmelden</h:commandLink>
|
||||||
|
<ui:remove>
|
||||||
|
<li><a href="logout.xhtml">Abmelden</a></li>
|
||||||
|
</ui:remove>
|
||||||
|
</h:form>
|
||||||
|
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
Loading…
Reference in New Issue
Block a user