docs: public void onClickLogin() {
  
          String user = m_ui.getUser();
          String password = m_ui.getPassword();
          CmsMessageContainer message = CmsLoginHelper.validateUserAndPasswordNotEmpty(user, password);
          CmsLoginMessage loginMessage = OpenCms.getLoginManager().getLoginMessage();
          String storedMessage = null;
          if ((loginMessage != null) && !loginMessage.isLoginCurrentlyForbidden() && loginMessage.isActive()) {
              storedMessage = loginMessage.getMessage();
              // If login is forbidden, we will get an error message anyway, so we don't need to store the message here
          }
          if (message != null) {
              String errorMessage = message.key(m_params.getLocale());
              //  m_ui.displayError(errorMessage);
              displayError(errorMessage, true);
              return;
          }
  
          String ou = m_ui.getOrgUnit();
          String realUser = CmsStringUtil.joinPaths(ou, user);
          String pcType = m_ui.getPcType();
          CmsObject currentCms = A_CmsUI.getCmsObject();
          CmsUser userObj = null;
  
          try {
              try {
                  userObj = currentCms.readUser(realUser);
              } catch (CmsException e) {
                  LOG.warn(e.getLocalizedMessage(), e);
                  message = org.opencms.workplace.Messages.get().container(
                      org.opencms.workplace.Messages.GUI_LOGIN_FAILED_0);
                  displayError(message.key(m_params.getLocale()), true, true);
                  return;
              }
              if (OpenCms.getLoginManager().canLockBecauseOfInactivity(currentCms, userObj)) {
                  boolean locked = null != userObj.getAdditionalInfo().get(KEY_ACCOUNT_LOCKED);
                  if (locked) {
                      displayError(CmsInactiveUserMessages.getLockoutText(A_CmsUI.get().getLocale()), false);
                      return;
                  }
              }
              String messageToChange = "";
              if (OpenCms.getLoginManager().isPasswordReset(currentCms, userObj)) {
                  messageToChange = CmsVaadinUtils.getMessageText(Messages.GUI_PWCHANGE_RESET_0);
              }
              if (OpenCms.getLoginManager().requiresPasswordChange(currentCms, userObj)) {
                  messageToChange = getPasswordChangeMessage();
              }
              if (!CmsStringUtil.isEmptyOrWhitespaceOnly(messageToChange)) {
                  CmsChangePasswordDialog passwordDialog = new CmsChangePasswordDialog(
                      currentCms,
                      userObj,
                      A_CmsUI.get().getLocale());
                  passwordDialog.setAdditionalMessage(messageToChange);
                  A_CmsUI.get().setContentToDialog(
                      Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.GUI_PWCHANGE_HEADER_0)
                          + userObj.getSimpleName(),
                      passwordDialog);
                  return;
              }
              // do a provisional login first, to check the login target
              CmsObject cloneCms = OpenCms.initCmsObject(currentCms);
              cloneCms.loginUser(realUser, password);
              CmsWorkplaceSettings settings = CmsLoginHelper.initSiteAndProject(cloneCms);
              final String loginTarget = getLoginTarget(cloneCms, settings, m_params.getRequestedResource());
  
              // make sure we have a new session after login for security reasons
              HttpSession session = ((HttpServletRequest)VaadinService.getCurrentRequest()).getSession(false);
              if (session != null) {
                  session.invalidate();
              }
              session = ((HttpServletRequest)VaadinService.getCurrentRequest()).getSession(true);
  
              // provisional login successful, now do for real
              currentCms.loginUser(realUser, password);
              if (LOG.isInfoEnabled()) {
                  CmsRequestContext context = currentCms.getRequestContext();
                  LOG.info(
                      org.opencms.jsp.Messages.get().getBundle().key(
                          org.opencms.jsp.Messages.LOG_LOGIN_SUCCESSFUL_3,
                          context.getCurrentUser().getName(),
                          "{workplace login dialog}",
                          context.getRemoteAddress()));
              }
              settings = CmsLoginHelper.initSiteAndProject(currentCms);
              OpenCms.getSessionManager().updateSessionInfo(
                  currentCms,
                  (HttpServletRequest)VaadinService.getCurrentRequest());
              if ((loginMessage != null) && loginMessage.isLoginCurrentlyForbidden()) {
                  if (loginMessage.getTimeEnd() == CmsLoginMessage.DEFAULT_TIME_END) {
                      // we are an administrator
                      storedMessage = org.opencms.workplace.Messages.get().container(
                          org.opencms.workplace.Messages.GUI_LOGIN_SUCCESS_WITH_MESSAGE_WITHOUT_TIME_1,
                          loginMessage.getMessage(),
                          new Date(loginMessage.getTimeEnd())).key(A_CmsUI.get().getLocale());
  
                  } else {
                      // we are an administrator
                      storedMessage = org.opencms.workplace.Messages.get().container(
                          org.opencms.workplace.Messages.GUI_LOGIN_SUCCESS_WITH_MESSAGE_2,
                          loginMessage.getMessage(),
                          new Date(loginMessage.getTimeEnd())).key(A_CmsUI.get().getLocale());
                  }
              }
  
              if (storedMessage != null) {
                  OpenCms.getSessionManager().sendBroadcast(
                      null,
                      storedMessage,
                      currentCms.getRequestContext().getCurrentUser());
              }
  
              CmsLoginHelper.setCookieData(
                  pcType,
                  user,
                  ou,
                  (VaadinServletRequest)(VaadinService.getCurrentRequest()),
                  (VaadinServletResponse)(VaadinService.getCurrentResponse()));
              VaadinService.getCurrentRequest().getWrappedSession().setAttribute(
                  CmsWorkplaceManager.SESSION_WORKPLACE_SETTINGS,
                  settings);
  
              final boolean isPublicPC = CmsLoginForm.PC_TYPE_PUBLIC.equals(pcType);
              if (OpenCms.getLoginManager().requiresUserDataCheck(currentCms, userObj)) {
                  I_CmsDialogContext context = new A_CmsDialogContext("", ContextType.appToolbar, null) {
  
                      @Override
                      public void finish(CmsProject project, String siteRoot) {
  
                          finish(null);
                      }
  
                      @Override
                      public void finish(Collection<CmsUUID> result) {
  
                          m_ui.openLoginTarget(loginTarget, isPublicPC);
                      }
  
                      public void focus(CmsUUID structureId) {
  
                          // nothing to do
                      }
  
                      public List<CmsUUID> getAllStructureIdsInView() {
  
                          return null;
                      }
  
                      @Override
                      public void start(String title, Component dialog, DialogWidth style) {
  
                          if (dialog != null) {
                              m_window = CmsBasicDialog.prepareWindow(style);
                              m_window.setCaption(title);
                              m_window.setContent(dialog);
                              UI.getCurrent().addWindow(m_window);
                              if (dialog instanceof CmsBasicDialog) {
                                  ((CmsBasicDialog)dialog).initActionHandler(m_window);
                              }
                          }
                      }
  
                      public void updateUserInfo() {
  
                          // not supported
                      }
                  };
                  CmsUser u = currentCms.readUser(userObj.getId());
                  u.setAdditionalInfo(
                      CmsUserSettings.ADDITIONAL_INFO_LAST_USER_DATA_CHECK,
                      Long.toString(System.currentTimeMillis()));
                  currentCms.writeUser(u);
                  CmsUserDataDialog dialog = new CmsUserDataDialog(context, true);
                  context.start(dialog.getTitle(UI.getCurrent().getLocale()), dialog);
              } else {
  
                  m_ui.openLoginTarget(loginTarget, isPublicPC);
              }
          } catch (Exception e) {
  
              // there was an error during login
              if (e instanceof CmsException) {
                  CmsMessageContainer exceptionMessage = ((CmsException)e).getMessageContainer();
                  if (org.opencms.security.Messages.ERR_LOGIN_FAILED_DISABLED_2 == exceptionMessage.getKey()) {
                      // the user account is disabled
                      message = org.opencms.workplace.Messages.get().container(
                          org.opencms.workplace.Messages.GUI_LOGIN_FAILED_DISABLED_0);
                  } else if (org.opencms.security.Messages.ERR_LOGIN_FAILED_TEMP_DISABLED_4 == exceptionMessage.getKey()) {
                      // the user account is temporarily disabled because of too many login failures
                      message = org.opencms.workplace.Messages.get().container(
                          org.opencms.workplace.Messages.GUI_LOGIN_FAILED_TEMP_DISABLED_0);
                  } else if (org.opencms.security.Messages.ERR_LOGIN_FAILED_WITH_MESSAGE_1 == exceptionMessage.getKey()) {
                      // all logins have been disabled be the Administration
                      CmsLoginMessage loginMessage2 = OpenCms.getLoginManager().getLoginMessage();
                      if (loginMessage2 != null) {
                          message = org.opencms.workplace.Messages.get().container(
                              org.opencms.workplace.Messages.GUI_LOGIN_FAILED_WITH_MESSAGE_1,
                              loginMessage2.getMessage());
                      }
                  }
              }
              if (message == null) {
                  if (e instanceof CmsCustomLoginException) {
                      message = ((CmsCustomLoginException)e).getMessageContainer();
                  } else {
                      // any other error - display default message
                      message = org.opencms.workplace.Messages.get().container(
                          org.opencms.workplace.Messages.GUI_LOGIN_FAILED_0);
                      displayError(message.key(m_params.getLocale()), true, true);
                      return;
                  }
              }
  
              if (e instanceof CmsException) {
                  CmsJspLoginBean.logLoginException(currentCms.getRequestContext(), user, (CmsException)e);
              } else {
                  LOG.error(e.getLocalizedMessage(), e);
              }
              displayError(message.key(m_params.getLocale()), false);
              return;
          }
      }