gpt4 book ai didi

com.xpn.xwiki.user.api.XWikiUser.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 19:15:05 25 4
gpt4 key购买 nike

本文整理了Java中com.xpn.xwiki.user.api.XWikiUser.<init>()方法的一些代码示例,展示了XWikiUser.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWikiUser.<init>()方法的具体详情如下:
包路径:com.xpn.xwiki.user.api.XWikiUser
类名称:XWikiUser
方法名:<init>

XWikiUser.<init>介绍

暂无

代码示例

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

public User getUser(String username, XWikiContext context)
{
  XWikiUser xwikiUser = new XWikiUser(username);
  User user = new User(xwikiUser, context);
  return user;
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

public void setUser(String user, boolean main)
{
  if (user == null) {
    this.user = null;
    remove(USER_KEY);
  } else {
    this.user = new XWikiUser(user, main);
    put(USER_KEY, user);
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

@Override
public XWikiUser checkAuth(XWikiContext context) throws XWikiException
{
  String user = context.getRequest().getRemoteUser();
  if ((user == null) || user.equals("")) {
    return super.checkAuth(context);
  } else {
    if (log.isDebugEnabled())
      log.debug("Launching create user for " + user);
    createUser(user, context);
    if (log.isDebugEnabled())
      log.debug("Create user done for " + user);
    user = "XWiki." + user;
  }
  context.setUser(user);
  return new XWikiUser(user);
}

代码示例来源:origin: org.phenotips/lims-integration-api

/**
   * Convert a username to an XWikiUser object, taking care of proper escapes.
   *
   * @param username the username to process
   * @return an XWikiUser object holding the specified username
   */
  private XWikiUser toXWikiUser(String username, XWikiContext context)
  {
    DocumentReference ref = new DocumentReference(context.getDatabase(), XWiki.SYSTEM_SPACE, username);
    return new XWikiUser(ref.toString());
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * {@inheritDoc}
 * 
 * @see com.xpn.xwiki.user.impl.xwiki.XWikiAuthServiceImpl#checkAuth(com.xpn.xwiki.XWikiContext)
 */
@Override
public XWikiUser checkAuth(XWikiContext context) throws XWikiException
{
  String user = context.getRequest().getRemoteUser();
  LOG.debug(MessageFormat.format("Checking auth for remote user {0}", user));
  if (StringUtils.isBlank(user)) {
    return super.checkAuth(context);
  } else {
    user = this.extractUsernameFromPrincipal(user);
    user = createUser(user, context);
    user = XWIKI_SPACE + DOT + user;
  }
  context.setUser(user);
  return new XWikiUser(user);
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
   * We cannot authenticate locally since we need to trust the app server for authentication.
   */
  @Override
  public XWikiUser checkAuth(String username, String password, String rememberme, XWikiContext context)
    throws XWikiException
  {
    String user = context.getRequest().getRemoteUser();
    if ((user == null) || user.equals("")) {
      return super.checkAuth(username, password, rememberme, context);
    } else {
      createUser(user, context);
      user = "XWiki." + user;
    }
    context.setUser(user);

    return new XWikiUser(user);
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

return new XWikiUser(getContextUserName(principal, context));
} catch (Exception e) {
  LOG.error("Failed to authenticate", e);

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

return new XWikiUser(userName);
} catch (Exception e) {
  LOG.error("Failed to authenticate", e);

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

user = context.getWiki().checkAuth(context);
} else {
  user = new XWikiUser(context.getUser());

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com