public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		UsermanForm usermanForm = (UsermanForm) form;// TODO Auto-generated method stub
		
		String output ="doneedit";
		
		String login = usermanForm.getLogin();
		String password = usermanForm.getPassword();
		String name = usermanForm.getName();
		String surname = usermanForm.getSurname();
		String title = usermanForm.getTitle();
		String address = usermanForm.getAddress();
		String mailpass = usermanForm.getMailpass();
		String right = usermanForm.getRight();
		String man = usermanForm.getMan();
		
		Logger log = Logger.getLogger(TextAction.class);
		PrivilegeDAO pridao = new PrivilegeDAO();
		Privilege pri = new Privilege();
		CompteDAO codao = new CompteDAO();
		Compte comp = codao.findById(login);
		
		
		if (right.equals("super"))
			pri= pridao.findById((long) 3);
		else if (right.equals("admin"))
			pri= pridao.findById((long) 2);
		else
			pri= pridao.findById((long) 2);
		
		
		if (man.contains("Add")){
			comp.setPrivilege(pri);
			comp.setLogin(login);
			comp.setPassword(password);
			comp.setNom(surname);
			comp.setPrenom(name);
			comp.setTitre(title);
			comp.setAdresseMail(address);
			comp.setMailpassword(mailpass);
			
			
			Session hsf = HibernateSessionFactory.getSession();
			Transaction trans = hsf.beginTransaction();
			hsf.saveOrUpdate(comp); 
			trans.commit();
			hsf.close();
			
			request.getSession().setAttribute("info", "User has been added.");
			log.info("User " + comp.getLogin() + " has been added.");
			output ="doneadd";
		}
		else if (man.contains("Save")){
			comp = codao.findById(login);
			comp.setPrivilege(pri);
			comp.setPassword(password);
			comp.setNom(surname);
			comp.setPrenom(name);
			comp.setTitre(title);
			comp.setAdresseMail(address);
			comp.setMailpassword(mailpass);
			
			Session hsf = HibernateSessionFactory.getSession();
			Transaction trans = hsf.beginTransaction();
			hsf.saveOrUpdate(comp); 
			trans.commit();
			hsf.close();
			
			request.getSession().setAttribute("info", "User has been modified.");
			log.info("User " + comp.getLogin() + " has been modified.");
			output ="doneedit";
		}
		
		
		return mapping.findForward(output);
	}