Package com.ubx1.pdpscanner.client.views.project

Examples of com.ubx1.pdpscanner.client.views.project.GeneralTab


    this.line = line;
  }

  public static String getAbbrevDescription(String abbrev) {

    FindbugsAbbrev fbAbbrev = FindbugsAbbrev.valueOf(abbrev);

    if (fbAbbrev != null) {

      return fbAbbrev.description();
    } else {

      return null;
    }
  }
View Full Code Here


    }
  }

  public static String getTypeDescription(String type) {

    FindbugsType fbType = FindbugsType.valueOf(type);

    if (fbType != null) {

      return fbType.description();
    } else {

      return null;
    }
  }
View Full Code Here

    else if (event.getValue().equals("Account")) {

      // Clear page
      RootPanel.get().clear();

      this.accountView = new AccountView(this);
      this.accountView.buildView();

      RootPanel.get().add(this.accountView.getViewPanel());
    }
    // Disconnection requested
View Full Code Here

      // Clear page
      RootPanel.get().clear();

      // Init Home view UI
      homeView = new HomeView();
      homeView.buildView();

      RootPanel.get().add(homeView.getViewPanel());

      // Fetch the projects list
View Full Code Here

        // Clear page
        RootPanel.get().clear();

        // Init Project view UI
        projectView = new ProjectView(PdpScanner.this, p);
        projectView.buildView();

        RootPanel.get().add(projectView.getViewPanel());
      }
    };
View Full Code Here

    else if (event.getValue().equals("Tips")) {

      // Clear page
      RootPanel.get().clear();

      this.tipsView = new TipsView();
      this.tipsView.buildView();

      RootPanel.get().add(this.tipsView.getViewPanel());
    }
    // Account view requested
View Full Code Here

    /*
     * Login validation
     */
    Validator.validateLogin(username, password);

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    username = "'" + username + "'";

    ResultSet rs = conn.SQLSelect("SELECT * FROM users WHERE username = "
        + username + " LIMIT 1");

    if (rs.next()) {

      String passwordHash = rs.getString("password");

      if (BCrypt.checkpw(password, passwordHash)) {

        String id = String.valueOf(rs.getInt("id"));
        String name = rs.getString("name");
        String email = rs.getString("email");
        String cell = rs.getString("cell");
        if (rs.wasNull())
          cell = null;
        String creationDate = rs.getDate("creation_date").toString();

        conn.disconnect();

        HttpSession userSession = getThreadLocalRequest().getSession();

        userSession.setAttribute("id", id);
        userSession.setAttribute("name", name);
        userSession.setAttribute("email", email);
        userSession.setAttribute("cell", cell);
        userSession.setAttribute("creationDate", creationDate);

        System.out.println("User session created.");

        return null;
      } else {

        conn.disconnect();

        throw new BadLoginException(username, password,
            "Incorrect password");
      }
    }
    // Username does not exist
    else {

      conn.disconnect();

      throw new BadLoginException(username, password,
          "Incorrect username");
    }
  }
View Full Code Here

     * Signup validation
     */
    Validator.validateSignUp(name, email, username, password, password,
        cell);

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    ResultSet rs = conn.SQLSelect("SELECT * FROM users");

    // Check username unicity
    while (rs.next()) {

      String s = rs.getString("username");

      if (s.equals(username)) {

        throw new BadUsernameException(username,
            "Username already exists");
      }
    }

    String passwordHash = BCrypt.hashpw(password, BCrypt.gensalt());

    // Prepare insert sql statement
    name = "'" + name + "'";
    email = "'" + email + "'";
    username = "'" + username + "'";
    passwordHash = "'" + passwordHash + "'";

    if (!cell.isEmpty())
      cell = "'" + cell + "'";
    else
      cell = "NULL";

    creationDate = "'" + creationDate + "'";

    // Insert new user
    conn.SQLUpdate("INSERT INTO users (name,email,username,password,cell,creation_date)"
        + " VALUES ("
        + name
        + ","
        + email
        + ","
        + username
        + ","
        + passwordHash + "," + cell + "," + creationDate + ")");

    conn.disconnect();

    return null;
  }
View Full Code Here

    } else {

      throw new InvalidSessionException();
    }

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    ResultSet rs = conn.SQLSelect("SELECT password FROM users WHERE id="
        + userId);

    if (rs.next()) {

      String dbPasswordHash = rs.getString("password");

      conn.disconnect();

      if (BCrypt.checkpw(password, dbPasswordHash)) {

        return null;
      } else {

        throw new BadPasswordException(password, "Incorrect password");
      }
    } else {

      conn.disconnect();

      throw new Exception("Could not find user with ID " + userId);
    }
  }
View Full Code Here

    } else {

      throw new InvalidSessionException();
    }

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    newPassword = "'" + BCrypt.hashpw(newPassword, BCrypt.gensalt()) + "'";

    conn.SQLUpdate("UPDATE users SET password=" + newPassword
        + " WHERE id=" + userId);

    conn.disconnect();

    return null;
  }
View Full Code Here

TOP

Related Classes of com.ubx1.pdpscanner.client.views.project.GeneralTab

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.