Author: nrannou Date: 2009-08-18 09:49:38 +0200 (Tue, 18 Aug 2009) New Revision: 2730 Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/PasswordGenerator.java trunk/todo.txt Log: modification d'un vote par url forg?\195?\169e Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2009-08-17 15:02:38 UTC (rev 2729) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/pages/poll/VoteForPoll.java 2009-08-18 07:49:38 UTC (rev 2730) @@ -209,7 +209,11 @@ /** Liste des choix */ private List<ChoiceDTO> voteChoices = new ArrayList<ChoiceDTO>(); + + /** Identifiant du compte correspondant à l'adresse forgée */ + private String pollAccountId; + /** Compte du votant */ @Property private PollAccountDTO pollAccount; @@ -444,12 +448,15 @@ // si le votant du vote correspond au votingId if (account.getVotingId().equals(votingId)) { + if (logger.isDebugEnabled()) { + logger.debug("vote account: " + account.getId()); + logger.debug("voting account: " + pollAccountId); + } - // si le votant du vote correspond au votant actuel (pollAccount) - // TODO autoriser la modification au pollAccount actuel - /*if (account.getId().equals(pollAccount.getId())) { + // si le votant du vote correspond au votant actuel (pollAccountId) + if (pollAccountId.equals(account.getId())) { modifAllowed = true; - }*/ + } // si l'utilisateur du vote correspond à l'utilisateur actuel (user) if (userExists && user.getId().length() > 0) { @@ -952,6 +959,7 @@ String accountId = id.split(":", 2)[1]; pollAccount = servicePollAccount .findPollAccountByAccountId(accountId); + pollAccountId = pollAccount.getId(); } if (pollAccount == null) { pollAccount = new PollAccountDTO(); Modified: trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/PasswordGenerator.java =================================================================== --- trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/PasswordGenerator.java 2009-08-17 15:02:38 UTC (rev 2729) +++ trunk/pollen-ui/src/main/java/org/chorem/pollen/ui/utils/PasswordGenerator.java 2009-08-18 07:49:38 UTC (rev 2730) @@ -46,7 +46,6 @@ c = 'A' + (int) (Math.random() * 26); break; default: - System.out.println("carTypeError"); break; } chars[i] = (char) c; Modified: trunk/todo.txt =================================================================== --- trunk/todo.txt 2009-08-17 15:02:38 UTC (rev 2729) +++ trunk/todo.txt 2009-08-18 07:49:38 UTC (rev 2730) @@ -1,7 +1,6 @@ TODO envoi emails de rappel -modification d'un vote par url forgée (sondage restreint) amélioration des tests