Package com.centraview.login

Examples of com.centraview.login.LoginHome


    int authenticationString = AUTHENTICATION_FAILED_STATUS;
    HashMap hm = null;
    getPATH();
    try {
      InitialContext ic = CVUtility.getInitialContext();
      LoginHome lh = (LoginHome) ic.lookup("Login");
      Login remote = (Login) lh.create();
      remote.setDataSource(dataSource);
      hm = (HashMap) remote.authenticateUser(userName, passwd);
      //checking hashmap
      if (hm != null && hm.get("userid")!= null && hm.get("individualid")!= null && hm.get("lastName")!= null && hm.get("firstName")!= null ) {
        session.set("authenticateUserHashMap", hm);
View Full Code Here


      // if the form wasn't submitted, then the process failed, so return false
      return (false);
    }

    try {
      LoginHome lh = (LoginHome)CVUtility.getHomeObject("com.centraview.login.LoginHome", "Login");
      com.centraview.login.Login remote = lh.create();
      remote.setDataSource(this.dataSource);

      HashMap loginResult = remote.authenticateUser(userName, password);

      if (!loginResult.containsKey("error")) {
View Full Code Here

    TreeMap errorMap = new TreeMap();
    String userType = null;
    UserObject userObject = null;
    HttpSession session = request.getSession();
    ModuleFieldRightMatrix mfrm = null;
    LoginHome lh = (LoginHome)CVUtility.getHomeObject("com.centraview.login.LoginHome","Login");

    try {
      // first, let's get the username and password from the HTML form
      DynaActionForm daf = (DynaActionForm)form;
      formUsername = (String)daf.get("username");
      formPassword = (String) daf.get("password");

      // next, let's check for the existence of the CVRMID cookie.
      boolean rmCookieExists = false;
      Cookie requestCookie = null;
      Cookie cookieList[] = request.getCookies();

      if (cookieList != null) {
        for (int i = 0; i < cookieList.length; i++) {
          Cookie tmpCookie = cookieList[i];
          if (tmpCookie.getName().equals("CVRMID")) {
            rmCookieExists = true;
            requestCookie = tmpCookie;
          }
        }
      }
      String cookieUsername = "";
      String cookiePassword = "";

      boolean useFormValues = false;

      // now, if the cookie exists, then get the content
      if (rmCookieExists) {
        // unencode the content of the cookie
        String unEncodedString = new String(Base64.decode(requestCookie.getValue()));

        // split the parts of the string on the "/" character
        String stringParts[] = unEncodedString.split("/");

        // get the username and password values and save for use
        cookieUsername = stringParts[0];
        cookiePassword = stringParts[1];

        // Note: In login.jsp, we checked to see if the cookie was set. If so, we
        // got the username and password from the cookie; we set the username form
        // value to the username from the cookie, and the password to "CVRMID-xxxxxxxx".
        // Therefore, we will check the form password value here; if it is NOT
        // "CVRMID-xxxxxxxx", the we know the user has manually typed in a different
        // password, and we will use the form password vs. the cookie password.
        if (formPassword != null && ! formPassword.equals("CVRMID-xxxxxxxx")) {
          useFormValues = true;
        }

        if (remember == null || remember.equals("")) {
          // if the user has *UN*-checked the Remember Me
          // checkbox, then get rid of their cookie
          this.forgetMe(response);
        }
      }

      String username = "";
      String password = "";

      if (rmCookieExists) {
        if (cookieUsername.equals(formUsername) && ! useFormValues) {
          // if the userName in the cookie equals the username in the form,
          // then, we'll authenticate on the cookie content
          username = cookieUsername;
          password = cookiePassword;
        } else {
          // if the username in the cookie does not match the username in the form,
          // then, we'll authenticate on the form content
          username = formUsername;
          password = formPassword;
        }
      } else {
        // if the cookie does not exist at all, authenticate on the form values
        username = formUsername;
        password = formPassword;
      }

      if (lh == null) {
        return (mapping.findForward("dataerror"));
      }

      Login remote = lh.create();
      remote.setDataSource(dataSource);
      usrResult = remote.authenticateUser(username, password);
      // Check to make sure the usrResult has all the fields we expect of it.
      // if so then it was a valid login, if not, then we will fail with a general
      // authentication error.
View Full Code Here

    if (action != null && action.equals("display")) {
      request.setAttribute("action", "display");
      return(mapping.findForward(".view.forgot"));
    }
   
    LoginHome lh = (LoginHome)CVUtility.getHomeObject("com.centraview.login.LoginHome","Login");
    try
    {
      ForgotPasswordForm fpf = (ForgotPasswordForm)form;
      formUserName = (String)fpf.getUsername();
      formEmail = (String)fpf.getEmail();

      HttpSession session = request.getSession(true);
     
      // EJB
      Login remote = (Login)lh.create();
      remote.setDataSource(dataSource);
      HashMap resultHashMap = remote.getForgottenPassword(formUserName, formEmail);
      String rand = "";
      int userid = 0;
      int individualID = 0;
View Full Code Here

TOP

Related Classes of com.centraview.login.LoginHome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.