
package God_In;

import javax.inject.Named;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author yorma
 */
@Named(value = "god_In")
@ManagedBean
@SessionScoped


public class God_In {
    private String email;
    private String password;
    
    public God_In() {
        email="";
        password="";
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public String  checklinks ()
    {
        
        String page="home";
        if(this.email.equals("admin")&& this.password.equals("admin"))
        {
            page="Workspace";
        }
        else {
            this.email="";
            this.password="";
//            FacesContext.getCurrentInstance().addMessage(
//                    null,
//                    new FacesMessage(FacesMessage.SEVERITY_WARN,
//                            "Incorrect Username and Passowrd",
//                            "Please enter correct username and Password"));
            page="Error";
              }
           return page;
    }
    
}
