com.evasion.common.controler.User Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.evasion.common.controler;
import com.evasion.ejb.local.UserAuthServiceLocal;
import javax.annotation.ManagedBean;
import javax.ejb.EJB;
import javax.faces.bean.RequestScoped;
/**
*
* @author sebastien.glon
*/
@ManagedBean
@RequestScoped
public class User {
private String username;
private String password;
@EJB
private UserAuthServiceLocal ejb;
private com.evasion.entity.security.User userEntity;
public com.evasion.entity.security.User getUserEntity() {
return userEntity;
}
public void setUserEntity(com.evasion.entity.security.User user) {
userEntity = user;
username = userEntity.getUsername();
password = userEntity.getPassword();
}
public void validUser() {
userEntity = new com.evasion.entity.security.User();
userEntity.setUsername(username);
userEntity.setPassword(password);
}
/**
* Action de sauvegarde d'un changement de password.
* Mise à jour de type update.
*/
public void changePassword() {
userEntity.setPassword(password);
}
/**
*
* @return
*/
/** public final String saveUser() {
userEntity = ejb.createUser(userEntity);
if (userEntity.getCreationDate() != null) {
return "Succes";
} else {
return "Fail";
}
}
**/
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
}