Package org.jamwiki.authentication

Examples of org.jamwiki.authentication.WikiUserDetails


   *
   * @return The current logged-in <code>WikiUser</code>, or an empty WikiUser
   *         if there is no user currently logged in.
   */
  public static WikiUser currentWikiUser() throws AuthenticationCredentialsNotFoundException {
    WikiUserDetails userDetails = ServletUtil.currentUserDetails();
    WikiUser user = new WikiUser();
    String username = userDetails.getUsername();
    if (username.equals(WikiUserDetails.ANONYMOUS_USER_USERNAME)) {
      return user;
    }
    if (!WikiUtil.isFirstUse() && !WikiUtil.isUpgrade()) {
      try {
View Full Code Here


      if (watchlist != null) {
        return watchlist;
      }
    }
    // no watchlist in session, retrieve from database
    WikiUserDetails userDetails = ServletUtil.currentUserDetails();
    Watchlist watchlist = new Watchlist();
    if (userDetails.hasRole(RoleImpl.ROLE_ANONYMOUS)) {
      return watchlist;
    }
    WikiUser user = ServletUtil.currentWikiUser();
    try {
      watchlist = WikiBase.getDataHandler().getWatchlist(virtualWiki, user.getUserId());
View Full Code Here

    // return 0;
  }

  @Override
  public String lookupWikiUserEncryptedPassword(String username) throws org.jamwiki.DataAccessException {
    WikiUserDetails userDetails = WikiUserDetailsService.findByName(username);
    if (userDetails == null) {
      return null;
    }
    return userDetails.getPassword();
  }
View Full Code Here

    WikiUtil.validateUserName(user.getUsername());

    try {
      // status = DatabaseConnection.startTransaction();
      if (user.getUserId() == null) {
        WikiUserDetails userDetails = new WikiUserDetails(username, encryptedPassword, true, true, true, true,
            JAMWikiAuthenticationConfiguration.getDefaultGroupRoles());
        WikiUserDetailsService.save(userDetails);
        WikiUserService.save(user);
        // this.addWikiUser(user, conn);
        // add all users to the registered user group
        this.addGroupMember(user.getUsername(), WikiBase.getGroupRegisteredUser().getGroupId());
        // FIXME - reconsider this approach of separate entries for every
        // virtual wiki
        // List<VirtualWiki> virtualWikis = this.getVirtualWikiList();
        // for (VirtualWiki virtualWiki : virtualWikis) {
        // LogItem logItem = LogItem.initLogItem(user, virtualWiki.getName());
        // this.addLogItem(logItem, conn);
        // RecentChange change = RecentChange.initRecentChange(logItem);
        // this.addRecentChange(change, conn);
        // }
      } else {
        if (!StringUtils.isBlank(encryptedPassword)) {
          WikiUserDetails userDetails = new WikiUserDetails(username, encryptedPassword, true, true, true, true,
              JAMWikiAuthenticationConfiguration.getDefaultGroupRoles());
          // this.updateUserDetails(userDetails, conn);
        }
        // this.updateWikiUser(user, conn);
        WikiUserService.update(user);
View Full Code Here

TOP

Related Classes of org.jamwiki.authentication.WikiUserDetails

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.