Author: tchemit Date: 2012-08-28 18:30:53 +0200 (Tue, 28 Aug 2012) New Revision: 3652 Url: http://chorem.org/repositories/revision/pollen/3652 Log: creator can now vote as a normal user + change log levels and comment dummy code Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java 2012-08-28 16:29:38 UTC (rev 3651) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/AbstractVoteAction.java 2012-08-28 16:30:53 UTC (rev 3652) @@ -294,6 +294,8 @@ getUserSecurityContext().isAdmin(); } + //FIXME-tchemit-2012-08-27, why ? in none free poll can not see votingId ? + //FIXME-tchemit-2012-08-27 ...hum weird, just in anonymous vote (method will be removed after check...) public boolean isAccountFieldDisplayed() { return !poll.isAnonymous() || isRestrictedPoll() || isGroupPoll(); } @@ -469,17 +471,17 @@ feedFileExisting = getPollFeedService().isFeedExists(poll); - if (log.isInfoEnabled()) { + if (log.isDebugEnabled()) { Date now = serviceContext.getCurrentTime(); - log.info("pollChoiceOrVoteStarted = " + isPollChoiceOrVoteStarted()); - log.info("pollChoiceRunning = " + isPollChoiceRunning()); - log.info("pollRunning = " + poll.isRunning(now)); - log.info("accountFieldDisplayed = " + isAccountFieldDisplayed()); - log.info("creatorOrAdminUser = " + isCreatorOrAdmin()); - log.info("isVoteAllowed = " + isVoteAllowed()); - log.info("isCommentAllowed = " + isCommentAllowed()); - log.info("isResultAllowed = " + isResultAllowed()); - log.info("pollVoteVisibility = " + poll.getPollVoteVisibility()); + log.debug("pollChoiceOrVoteStarted = " + isPollChoiceOrVoteStarted()); + log.debug("pollChoiceRunning = " + isPollChoiceRunning()); + log.debug("pollRunning = " + poll.isRunning(now)); +// log.info("accountFieldDisplayed = " + isAccountFieldDisplayed()); + log.debug("creatorOrAdminUser = " + isCreatorOrAdmin()); + log.debug("isVoteAllowed = " + isVoteAllowed()); + log.debug("isCommentAllowed = " + isCommentAllowed()); + log.debug("isResultAllowed = " + isResultAllowed()); + log.debug("pollVoteVisibility = " + poll.getPollVoteVisibility()); } return INPUT; } Modified: trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java =================================================================== --- trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java 2012-08-28 16:29:38 UTC (rev 3651) +++ trunk/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/vote/VoteForPoll.java 2012-08-28 16:30:53 UTC (rev 3652) @@ -27,7 +27,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.chorem.pollen.PollenUserSecurityContext; import org.chorem.pollen.bean.PollUrl; import org.chorem.pollen.business.persistence.Poll; import org.chorem.pollen.business.persistence.PollAccount; @@ -64,8 +63,6 @@ // Messages Poll poll = getPoll(); - PollenUserSecurityContext securityContext = getUserSecurityContext(); - if (poll.isClosed()) { addFlashWarning(_("pollen.information.pollClosed")); } else if (!isPollStarted()) { @@ -74,18 +71,7 @@ addFlashWarning(_("pollen.information.pollFinished")); } else if (!isVoteAllowed()) { - // check crator does not try to vote with his creator id - if (securityContext.isCreator() && securityContext.isWithAccountId()) { - - if (poll.getCreator().getAccountId().equals(securityContext.getAccountId())) { - - // only participant can see votes - addFlashWarning(_("pollen.information.canNotvotewithCreatorAccountId")); - } - } else { - addFlashWarning(_("pollen.information.pollCanNotVote")); - } } if (isPollChoiceRunning()) { @@ -240,7 +226,7 @@ } else { - // there is a aacountId in url, just inform vote is saved + // there is a accountId in url, just inform vote is saved addFlashMessage(_("pollen.information.vote.created")); }