code: private void createNewUser() throws CmsException {
  
          //Password was checked by validator before
          String ou = m_ou.getValue();
          if (!ou.endsWith("/")) {
              ou += "/";
          }
          CmsUser user = m_cms.createUser(ou + m_loginname.getValue(), m_pw.getPassword1(), "", null);
          updateUser(user);
          m_cms.writeUser(user);
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_group.getValue())) {
              m_cms.addUserToGroup(user.getName(), m_group.getValue());
          }
          OpenCms.getRoleManager().addUserToRole(m_cms, (CmsRole)m_role.getValue(), user.getName());
          m_user = user;
  
      }
docs: Creates new user.<p>
  
  @throws CmsException exception