コード例 #1
0
  public Users Student(Users user) {
    AttendanceHelper a_helper = new AttendanceHelper();

    Users uObj = user;
    Password pObj = new Password(user);
    AccountType aObj = new AccountType(Utilities.STUDENT, user);

    uObj.setUsername(user.getIdNo());

    a_helper.addStudent(uObj);
    a_helper.addPassword(pObj);
    a_helper.addAccountType(aObj);

    return uObj;
  }
コード例 #2
0
  @Override
  public String execute() throws Exception {
    // TODO Auto-generated method stub

    // Get currentSession
    try {
      usersModel = (Users) userSession.get("usersModel");
      if (usersModel.getUsername() == null || usersModel.getUsername().isEmpty()) {
        return INPUT;
      }
      System.out.println("Checking... ");
      System.out.println(usersModel.getUsername());

    } catch (Exception e) {
      return INPUT;
    }
    return SUCCESS;
  }
コード例 #3
0
  @Override
  public String execute() throws Exception {
    // TODO Auto-generated method stub
    try {
      GenericHelper g_helper = new GenericHelper();
      Users uModel = (Users) userSession.get(Utilities.user_sessionName);

      if (!uModel.getUsername().equals(Utilities.adminUsername)) {
        AuditLog auditLog =
            new AuditLog(AuditLogUtil.logoutAction, AuditLogUtil.logoutType, uModel);
        g_helper.AddAuditLog(auditLog);
      }

      userSession.clear();
      userSession.remove(Utilities.user_sessionName);

      return SUCCESS;
    } catch (Exception e) {
      // TODO: handle exception
      e.printStackTrace();
      return INPUT;
    }
  }