/***
 * Excerpted from "Domain-Driven Design Using Naked Objects",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/dhnako for more book information.
***/
package com.pragprog.dhnako.carserv.wicket.ui.security;

import org.apache.wicket.Page;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;

import com.pragprog.dhnako.carserv.wicket.app.NakedObjectsAuthenticatedWebSession;
import com.pragprog.dhnako.carserv.wicket.ui.NakedObjectsPanel;

public class UserPanel extends NakedObjectsPanel {

	private static final long serialVersionUID = 1L;

	public UserPanel(String id, Class<? extends Page> signoutClass) {
		super(id);
		NakedObjectsAuthenticatedWebSession session = getNakedObjectsAuthenticatedWebSession();
		add(new Label("fullname", session.getAuthenticationSession().getUserName()));
		add(new BookmarkablePageLink("signout", signoutClass));
	}

}
