public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ManageuserForm manageuserForm = (ManageuserForm) form;// TODO Auto-generated method stub
		String edit= manageuserForm.getEdit();
		String output="remove";
		Logger log = Logger.getLogger(TextAction.class);

		
		CompteDAO codao = new CompteDAO();
		Compte comp = new Compte();
		String index;
		
		if (edit.contains("Delete")){
			index = (String) edit.subSequence(7, edit.length());
			comp = codao.findById(index);
			
			Session hsf = HibernateSessionFactory.getSession();
			Transaction trans = hsf.beginTransaction();
			hsf.delete(comp); 
			trans.commit();
			hsf.close();
			
			output="remove";
			request.getSession().setAttribute("info", "User has been deleted.");
			log.info("User " + comp.getLogin() + " has been deleted.");
		}
		
		else if (edit.contains("Add")){
			output="adduser";
		}
		
		else if (edit.contains("Edit")){
			index = (String) edit.subSequence(5, edit.length());
			comp = codao.findById(index);
			
			
			request.getSession().setAttribute("login", index);
			request.getSession().setAttribute("password", comp.getPassword());
			request.getSession().setAttribute("title", comp.getTitre());
			request.getSession().setAttribute("name", comp.getPrenom());
			request.getSession().setAttribute("surname", comp.getNom());
			request.getSession().setAttribute("address", comp.getAdresseMail());
			request.getSession().setAttribute("mailpass", comp.getMailpassword());
			request.getSession().setAttribute("right", comp.getPrivilege());
			
			output="edituser";
		}
		
		return mapping.findForward(output);
	}