
package de.ivu.elect.presentation.security;

import java.io.Serializable;

import javax.annotation.PreDestroy;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import org.apache.commons.lang3.StringUtils;
import org.apache.deltaspike.core.api.scope.ViewAccessScoped;

@Named
@SessionScoped
public class ChangePasswordParameter implements Serializable {

  private static final long serialVersionUID = 1L;

  private boolean afterLogin = false;

  private String passwortAlt;

  private String passwortNeu;

  private String passwortNeuMatch;

  public void cleanup(){
    passwortAlt = null;
    passwortNeu = null;
    passwortNeuMatch = null;
    afterLogin = false;
  }

  public void setAfterLogin(String passwortBisher) {
    this.passwortAlt = passwortBisher;
    afterLogin = true;
  }

  public boolean isAfterLogin() {
    return afterLogin && StringUtils.isNotBlank(passwortAlt);
  }

  public String getPasswortAlt() {
    return passwortAlt;
  }

  public void setPasswortAlt(String passwortAlt) {
    this.passwortAlt = passwortAlt;
  }

  public String getPasswortNeu() {
    return passwortNeu;
  }

  public void setPasswortNeu(String passwortNeu) {
    this.passwortNeu = passwortNeu;
  }

  public String getPasswortNeuMatch() {
    return passwortNeuMatch;
  }

  public void setPasswortNeuMatch(String passwortNeuMatch) {
    this.passwortNeuMatch = passwortNeuMatch;
  }
}
