import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class LogoutMenu extends BasicMenu implements Menu 
{
	public LogoutMenu(Menu parent)
	{
		super(parent);
	}
	
	public boolean executeMenu()
	{

		if(HandleAuthorization.getCurrentUser() != null) {
	        HandleAuthorization.logoutUser();
	        GUI.setInfoMessage("Logout succeeded!");
	        System.out.println("Logout succeeded!");
	    }
		else {
			GUI.setErrorMessage("Logout failed! No user was logged in.");
		}
		MenuSystem.setCurrentMenu(parent);
	        //parent.executeMenu();
	        return true;
	}
	
	public boolean processInput(String input)
	{
	    return false;
	}
}
