public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		SigninForm signinForm = (SigninForm) form;// TODO Auto-generated method stub


		String output ="wrong";
		String login = signinForm.getLogin();
		String password = signinForm.getPassword();
		
		
		CompteDAO codao = new CompteDAO();
		Compte comp = codao.findById(login);
		VocabulaireDAO vocdao = new VocabulaireDAO();
		EmailDAO maidao = new EmailDAO();
		Email mail = new Email();
		
		TextToSpeech tts = new TextToSpeech();
		Reader Read = new Reader();
		
		Logger log = Logger.getLogger(TextAction.class);
		request.getSession().setAttribute("invalid", " ");
		request.getSession().setAttribute("mail", " ");
		request.getSession().setAttribute("name", " ");
		
		
		if(comp != null && comp.getPassword().equals(password))
		{
			
			if (comp.getPrivilege().getStatus().equals("user"))
			{
				
				log.info("The user " + login + " has connected.");
				output ="user";
				
				request.getSession().setAttribute("name", comp.getTitre() + " " + comp.getNom() + " " + comp.getPrenom() +  ".");
				request.getSession().setAttribute("mail", " " + comp.getAdresseMail());
				request.getSession().setAttribute("login", login);
				
				tts.playSynth("Welcome " + comp.getTitre() + " " + comp.getNom() + " " + comp.getPrenom() + ". On this page you have the list of your old mails");
				
				List<Email> listmail = new ArrayList<Email>();
				List<Email> listmailuser = new ArrayList<Email>();
				listmail = maidao.findAll();
				
				for (long i = 1; i<=listmail.size(); i++)
				{
					mail = maidao.findById(i);
					if (mail.getCompte().toString().equals(comp.toString()))
					{
						listmailuser.add(mail);
					}
				}
				request.getSession().setAttribute("listmail", listmailuser);
				}
			else if (comp.getPrivilege().getStatus().equals("admin"))
			{
				log.info("The Adminisrator " + login + " has connected.");
				request.getSession().setAttribute("name", comp.getTitre() + " " + comp.getNom() + " " + comp.getPrenom() +  ".");
				
				tts.playSynth("Welcome " + comp.getTitre() +comp.getNom() + " " + comp.getPrenom() +  ". This is the user list");
				
				List<Compte> listuser = new ArrayList<Compte>(); 
				listuser = codao.findAll(); 
				request.getSession().setAttribute("listuser",listuser);
				
				output ="admin";
				
			}
			else if (comp.getPrivilege().getStatus().equals("super"))
			{
				
				log.info("The Superviser " + login + " has connected.");
				request.getSession().setAttribute("name", comp.getTitre() + " " + comp.getNom() + " " + comp.getPrenom() +  ".");
				
				tts.playSynth("Welcome " + comp.getTitre() + comp.getNom() + " " + comp.getPrenom() +  ". There you have all the vocabilary list.");
				
				List<Vocabulaire> listvocab = new ArrayList<Vocabulaire>(); 
				listvocab = vocdao.findAll(); 
				request.getSession().setAttribute("listvocab",listvocab);
				
				output ="super";
			}
			else
			{
				log.error(login + " failed an attempts to login.");
				request.getSession().setAttribute("invalid", comp.getTitre() + " " + comp.getNom() + " " + comp.getPrenom() +  " you wrote a wrong password.");
				output = "wrong";
				
			}
				
		}
		else
		{
			log.error("An attempts to login by this id " + login + " has failed.");
			request.getSession().setAttribute("invalid", "Invalid login and password.");
		}
		return mapping.findForward(output);
	}