basic contact overview

This commit is contained in:
Jörg Henke
2022-04-07 20:52:38 +02:00
parent 94bec47d4d
commit 9fe9555853
73 changed files with 996 additions and 1488 deletions

View File

@ -0,0 +1,38 @@
package de.jottyfan.timetrack.modules;
import java.sql.SQLException;
import javax.faces.application.FacesMessage;
import org.jooq.exception.DataAccessException;
import de.jooqfaces.JooqFacesContext;
/**
*
* @author henkej
*
*/
public class SessionModel {
public boolean doLogin(JooqFacesContext facesContext, SessionBean bean) {
try {
return new SessionGateway(facesContext).seekAndSetLogin(bean);
} catch (DataAccessException | ClassNotFoundException | SQLException e) {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on login", e.getMessage());
facesContext.addMessage(null, msg);
return false;
}
}
public boolean doChangePassword(JooqFacesContext facesContext, String secretNew) {
try {
SessionBean bean = (SessionBean) facesContext.getExternalContext().getSessionMap().get("sessionBean");
return new SessionGateway(facesContext).changePassword(bean, secretNew);
} catch (DataAccessException | ClassNotFoundException | SQLException e) {
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, "error on changing password", e.getMessage());
facesContext.addMessage(null, msg);
return false;
}
}
}