Examples of PebbleUserDetails


Examples of net.sourceforge.pebble.security.PebbleUserDetails

  private SyndEntry convertBlogEntry(AbstractBlog blog, BlogEntry entry) {
    SyndEntry feedEntry = new SyndEntryImpl();
    feedEntry.setUri(generateId(blog, entry.getDate(), entry.getId()));
    feedEntry.setTitle(entry.getTitle());
    feedEntry.setLink(entry.getPermalink());
    PebbleUserDetails entryUser = entry.getUser();
    if (entryUser == null) {
      feedEntry.setAuthor(entry.getAuthor());
    } else {
      SyndPerson entryAuthor = new SyndPersonImpl();
      entryAuthor.setName(entryUser.getName());
      entryAuthor.setUri(entryUser.getWebsite());
      feedEntry.setAuthors(Collections.singletonList(entryAuthor));
    }
    feedEntry.setUpdatedDate(entry.getLastModified());
    feedEntry.setPublishedDate(entry.getDate());
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

      // ... but only if the browser doesn't send the character encoding back
      if (request.getCharacterEncoding() == null) {
        request.setCharacterEncoding(blog.getCharacterEncoding());
      }

      PebbleUserDetails user = SecurityUtils.getUserDetails();
      if (user != null) {
        httpRequest.setAttribute(Constants.AUTHENTICATED_USER, user);
      }

      Config.set(request, Config.FMT_LOCALE, blog.getLocale());
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

      String name = request.getParameter("name");
      String emailAddress = request.getParameter("emailAddress");
      String website = request.getParameter("website");
      String profile = request.getParameter("profile");

      PebbleUserDetails currentUserDetails = SecurityUtils.getUserDetails();

      // can the user change their user details?
      if (!currentUserDetails.isDetailsUpdateable()) {
        return new FourZeroThreeView();
      }

      SecurityRealm realm = PebbleContext.getInstance().getConfiguration().getSecurityRealm();
      PebbleUserDetails newUserDetails;

      ValidationContext validationContext = new ValidationContext();

      if (!validationContext.hasErrors()) {
      newUserDetails = new PebbleUserDetails(
          currentUserDetails.getUsername(),
          name,
          emailAddress,
          website,
          profile,
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

   * @param request  the HttpServletRequest instance
   * @param response the HttpServletResponse instance
   * @return the name of the next view
   */
  public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    PebbleUserDetails currentUserDetails = SecurityUtils.getUserDetails();
    getModel().put("user", currentUserDetails);

    // can the user change their user details?
    if (!currentUserDetails.isDetailsUpdateable()) {
      return new FourZeroThreeView();
    }

    return new UserDetailsView();
  }
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

   *          the same as or greater than the first, respectively. However, if
   *          the counts are the same, then -n, 0 or +n is returned if the name
   *          of the first is less than, the same as or greater than the second
   */
  public int compare(Object o1, Object o2) {
    PebbleUserDetails pud1 = (PebbleUserDetails)o1;
    PebbleUserDetails pud2 = (PebbleUserDetails)o2;

    return pud1.getName().compareTo(pud2.getName());
  }
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

    self.setType(getFeedType().getContentType());
    syndFeed.setLinks(Arrays.asList(alternate, self));

    syndFeed.setPublishedDate(blogEntry.getLastModified());

    PebbleUserDetails userDetails = blogEntry.getUser();
    SyndPerson author = new SyndPersonImpl();
    author.setName(userDetails.getName());
    author.setUri(userDetails.getWebsite());
    syndFeed.setAuthors(Collections.singletonList(author));

    syndFeed.setDescription(blogEntry.getTruncatedContent());
    syndFeed.setCopyright(userDetails.getName());
  }
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

   * @param response the HttpServletResponse instance
   * @return the name of the next view
   */
  public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
    getModel().put("newUser", "true");
    getModel().put("user", new PebbleUserDetails());

    return new UserView();
  }
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

        if (parameterName.startsWith(PREFERENCE)) {
          preferences.put(parameterName.substring(PREFERENCE.length()), request.getParameter(parameterName));
        }
      }

      PebbleUserDetails currentUserDetails = SecurityUtils.getUserDetails();

      // can the user change their user details?
      if (!currentUserDetails.isDetailsUpdateable()) {
        return new FourZeroThreeView();
      }

      SecurityRealm realm = PebbleContext.getInstance().getConfiguration().getSecurityRealm();

      ValidationContext validationContext = new ValidationContext();

      if (!validationContext.hasErrors()) {
        currentUserDetails.setPreferences(preferences);
        realm.updateUser(currentUserDetails);

        return new RedirectView(blog.getUrl() + "editUserPreferences.secureaction");
      }
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

   * Gets the title of this view.
   *
   * @return the title as a String
   */
  public String getTitle() {
    PebbleUserDetails user = (PebbleUserDetails)getModel().get(Constants.USER_KEY);
    return user.getName();
  }
View Full Code Here

Examples of net.sourceforge.pebble.security.PebbleUserDetails

  private SyndEntry convertBlogEntry(AbstractBlog blog, BlogEntry entry) {
    SyndEntry feedEntry = new SyndEntryImpl();
    feedEntry.setUri(generateId(blog, entry.getDate(), entry.getId()));
    feedEntry.setTitle(entry.getTitle());
    feedEntry.setLink(entry.getPermalink());
    PebbleUserDetails entryUser = entry.getUser();
    if (entryUser == null) {
      feedEntry.setAuthor(entry.getAuthor());
    } else {
      SyndPerson entryAuthor = new SyndPersonImpl();
      entryAuthor.setName(entryUser.getName());
      entryAuthor.setUri(entryUser.getWebsite());
      feedEntry.setAuthors(Collections.singletonList(entryAuthor));
    }
    feedEntry.setUpdatedDate(entry.getLastModified());
    feedEntry.setPublishedDate(entry.getDate());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.