Package ru.org.linux.user

Examples of ru.org.linux.user.User


      ts = null;
    } else {
      ts = new Timestamp(calendar.getTimeInMillis());
    }

    User user = tmpl.getCurrentUser();

    user.checkCommit();

    ipBlockDao.blockIP(ip, user, reason, ts, allowPosting, captchaRequired);

    return new ModelAndView(new RedirectView("sameip.jsp?ip=" + URLEncoder.encode(ip, "UTF-8")));
  }
View Full Code Here


  @Autowired
  private ProfileDao profileDao;

  @Override
  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
    User user;

    if (username.contains("@")) {
      user = userDao.getByEmail(username, true);
      if (user == null) {
        throw new UsernameNotFoundException(username);
View Full Code Here

    response.addHeader("Cache-Control", "private");
  }

  private void forWikiManipulation(HttpServletRequest request, HttpServletResponse response) {
    HttpSession session = request.getSession();
    User user = AuthUtil.getCurrentUser();
    if(user!=null){
      user.acegiSecurityHack(response, session);
    }
  }
View Full Code Here

      }
    }

    params.put("showDeleted", showDeleted);

    User currentUser = AuthUtil.getCurrentUser();

    permissionService.checkView(group, topic, currentUser, showDeleted);

    params.put("message", topic);
    params.put("preparedMessage", preparedMessage);
View Full Code Here

    if (topic.isExpired()) {
      throw new MessageNotFoundException(topic.getId(), "no more comments");
    }

    User currentUser = AuthUtil.getCurrentUser();

    permissionService.checkView(group, topic, currentUser, false);

    params.put("message", topic);
    params.put("preparedMessage", preparedMessage);
View Full Code Here

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
    }

    User user = tmpl.getCurrentUser();

    user.checkAnonymous();

    Topic message = messageDao.getById(msgid);

    if (message.isDeleted()) {
      throw new UserErrorException("Сообщение уже удалено");
    }

    if (!permissionService.isDeletable(message, user))  {
      throw new AccessViolationException("Вы не можете удалить это сообщение");
    }

    topicService.deleteWithBonus(message, user, reason, bonus);
    logger.info("Удалено сообщение " + msgid + " пользователем " + user.getNick() + " по причине `" + reason + '\'');

    // Delete msgs from search index
    searchQueueSender.updateMessage(msgid, true);

    return new ModelAndView("action-done", "message", "Сообщение удалено");
View Full Code Here

    boolean secure = rootNode.isSecure();
    UserDao userDao = rootNode.getUserDao();
    String result;
    try {
      if(userDao != null && toHtmlFormatter != null){
        User user = rootNode.getUserDao().getUser(memberName);
        if (!user.isBlocked()) {
          result = String.format(" <span style=\"white-space: nowrap\"><img src=\"/img/tuxlor.png\"><a style=\"text-decoration: none\" href=\"%s\">%s</a></span>",
              toHtmlFormatter.memberURL(user, secure), Parser.escape(memberName));
          rootNode.addReplier(user);
        } else {
          result = String.format(" <span style=\"white-space: nowrap\"><img src=\"/img/tuxlor.png\"><s><a style=\"text-decoration: none\" href=\"%s\">%s</a></s></span>",
View Full Code Here

          int messagesInPage
  ) {
    List<TopicsListItem> topicsList = new ArrayList<>();

    while (rs.next()) {
      User author;

      author = userDao.getUserCached(rs.getInt("userid"));

      ImmutableList<String> tags = topicTagService.getTagsForTitle(rs.getInt("msgid"));
View Full Code Here

   * @return true если можно, false если нет
   */
  public boolean isEditable(@Nonnull PreparedTopic topic, @Nullable User by) {
    Topic message = topic.getMessage();
    Section section = topic.getSection();
    User author = topic.getAuthor();

    if (message.isDeleted()) {
      return false;
    }

    if (by==null || by.isAnonymous() || by.isBlocked()) {
      return false;
    }

    if (message.isExpired()) {
      return false;
    }

    if (by.isAdministrator()) {
      return true;
    }

    if (!topic.isLorcode()) {
      return false;
    }

    if (by.isModerator()) {
      return true;
    }

    if (by.canCorrect() && section.isPremoderated()) {
      return true;
    }

    if (by.getId()==author.getId() && !message.isCommited()) {
      if (message.isSticky()) {
        return true;
      }

      if (section.isPremoderated()) {
        return true;
      }

      if (message.isDraft()) {
        return true;
      }

      if (author.getScore()>=EDIT_SELF_ALWAYS_SCORE) {
        return !message.isExpired();
      }

      DateTime editDeadline = new DateTime(message.getPostdate()).plus(EDIT_PERIOD);

View Full Code Here

   * @return true если можно, false если нет
   */
  public boolean isTagsEditable(@Nonnull PreparedTopic topic, @Nullable User by) {
    Topic message = topic.getMessage();
    Section section = topic.getSection();
    User author = topic.getAuthor();

    if (message.isDeleted()) {
      return false;
    }

    if (by==null || by.isAnonymous() || by.isBlocked()) {
      return false;
    }

    if (by.isAdministrator()) {
      return true;
    }

    if (by.isModerator()) {
      return true;
    }

    if (by.canCorrect()) {
      return true;
    }

    if (by.getId()==author.getId() && !message.isCommited()) {
      if (message.isSticky()) {
        return true;
      }

      if (section.isPremoderated()) {
        return true;
      }

      if (author.getScore()>=EDIT_SELF_ALWAYS_SCORE) {
        return !message.isExpired();
      }

      DateTime editDeadline = new DateTime(message.getPostdate()).plus(EDIT_PERIOD);

View Full Code Here

TOP

Related Classes of ru.org.linux.user.User

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.