From 77b02552b197353520abd69e6f46dff0efc23399 Mon Sep 17 00:00:00 2001 From: "Ray J. Greenwell" Date: Fri, 4 Nov 2011 15:14:54 -0700 Subject: [PATCH] Match changes to the Depot user repo commited in r.... Oh hello, git. I mean... "change 4e5882cb4b89bb084ba3a63d6060323a2b371f98". Yeah. Hm. Anyway, fix validation records so that we only store one and it corresponds to the latest email address. --- .../com/threerings/user/OOOUserRepository.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/threerings/user/OOOUserRepository.java b/src/main/java/com/threerings/user/OOOUserRepository.java index 0a3246e..3775f92 100644 --- a/src/main/java/com/threerings/user/OOOUserRepository.java +++ b/src/main/java/com/threerings/user/OOOUserRepository.java @@ -943,20 +943,16 @@ public class OOOUserRepository extends UserRepository /** * Creates a pending record for an account that has been created but not yet validated (which - * involves the user accessing a secret URL we send to them in an email message). If a record - * already exists for the supplied user, it will be reused and returned. + * involves the user accessing a secret URL we send to them in an email message). */ public ValidateRecord createValidateRecord (int userId, boolean persist) throws PersistenceException { - // reuse an existing record if we have one - ValidateRecord rec = getValidateRecord(userId); - if (rec != null) { - return rec; - } + // delete any old validate mappings for the user + update("delete from penders where userId = '" + userId + "'"); - // otherwise create a new one and insert it into the database - rec = new ValidateRecord(); + // create a new one and insert it into the database + ValidateRecord rec = new ValidateRecord(); rec.secret = Long.toString(Math.abs((new Random()).nextLong()), 16); rec.userId = userId; rec.persist = persist;