/** * Delete token. * * @param context DSpace context * @param token The token to delete * @throws SQLException If a database error occurs */ @Override public void deleteToken(Context context, String token) throws SQLException { registrationDataService.deleteByToken(context, token); }
MessagingException, AuthorizeException { RegistrationData rd = registrationDataService.findByEmail(context, email); rd = registrationDataService.create(context); rd.setToken(Utils.generateHexKey()); registrationDataService.update(context, rd);
/** * Return the e-mail address referred to by a token, or null if email * address can't be found ignores expiration of token * * @param context DSpace context * @param token Account token * @return The email address corresponding to token, or null. */ @Override public String getEmail(Context context, String token) throws SQLException { RegistrationData registrationData = registrationDataService.findByToken(context, token); if (registrationData == null) { return null; } /* * ignore the expiration date on tokens Date expires = * rd.getDateColumn("expires"); if (expires != null) { if ((new * java.util.Date()).after(expires)) return null; } */ return registrationData.getEmail(); }