Package nz.co.transparent.client.controller

Examples of nz.co.transparent.client.controller.SystemDBController


  }

  private void changePasswordActionMenuItem_actionPerformed(
      java.awt.event.ActionEvent evt) {

    SystemDBController systemController = SystemDBController.getInstance();
    ChangePasswordDialog passwordDialog = new ChangePasswordDialog(this, "Change password");
    Map passwordMap = null;
    Map userMap = null;
    int tries = 0;
   
    try {
      while (true) {
        passwordMap = passwordDialog.showDialog();
        if (((Boolean) passwordMap.get("isOkPressed")).equals(Boolean.FALSE)) {
          return;
        }
 
        if (!passwordMap.get("password1").equals(passwordMap.get("password2"))) {
          Messager.information(this, "Passwords are not equal");
          continue;
        }
       
        if (passwordMap.get("password1").toString().length() < 6) {
          Messager.information(this, "Passwords must have 6 or more characters");
          continue;
        }
       
        if (tries++ >3) {
          continue// Do not check anymore
        }

        userMap = systemController.getUser(LoginController.getPerson().get("user_name").toString());
       
        if (!userMap.get("Password").equals(passwordMap.get("passwordOld"))) {
          continue;
        }
       
        systemController.alterUser(LoginController.getPerson().get("user_name").toString(), passwordMap.get("password1").toString());
        return;
      }
    } catch (ControllerException ce) {
      Messager.exception(this, ce.getMessage());
      return;
View Full Code Here


 
  private boolean processPassword() {
   
    String password = null;
    Map personMap = null;
    SystemDBController systemController = SystemDBController.getInstance();
    PasswordOnlyDialog dialog = new PasswordOnlyDialog(this, "Password");
    int i =0;
   
    while (true) {
      password = dialog.showDialog();
     
      if (password == null) {
        return false;
      }
     
      // Check only 3 times
      try {
        if (i++ < 2) {
          personMap = systemController.getUser(LoginController.getPerson().get("user_name").toString());
         
          if (personMap != null) {
            if (password.equals(personMap.get("Password"))) {
              return true;
            }
View Full Code Here

  }

  public static void main(String[] args) {
   
    DataSourceHandler.loadCredentialsFromConfig();
    SystemDBController controller = SystemDBController.getInstance();
    try {
//      nz.co.transparent.client.controller.createUser("test_user", "pass1");
//      nz.co.transparent.client.controller.dropUser("test_user");
//      nz.co.transparent.client.controller.alterUser("admin", "client00", "'secure access'");
      controller.alterUser("test_user", "pass1", "'secure access'");
     
      System.out.println("Ready");
    } catch (ControllerException ce) {
      System.out.println(ce.getMessage());
      return;
View Full Code Here

TOP

Related Classes of nz.co.transparent.client.controller.SystemDBController

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.