Skip to content

Commit

Permalink
Merge pull request #432 from support-project/fix/issue431_mail_read
Browse files Browse the repository at this point in the history
Fix/issue431 mail read
  • Loading branch information
koda-masaru authored Jul 26, 2016
2 parents 9fc360d + 5671bea commit dcada7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;

import org.support.project.common.log.Log;
import org.support.project.common.log.LogFactory;
import org.support.project.common.util.Base64Utils;
import org.support.project.common.util.PasswordUtil;
import org.support.project.common.util.StringUtils;
import org.support.project.knowledge.config.AppConfig;
import org.support.project.knowledge.deploy.Migrate;
import org.support.project.knowledge.logic.MailLogic;
import org.support.project.ormapping.tool.dao.InitializeDao;
import org.support.project.web.dao.LdapConfigsDao;
import org.support.project.web.dao.MailConfigsDao;
Expand All @@ -27,6 +30,9 @@
import org.support.project.web.entity.ProxyConfigsEntity;

public class Migrate_1_5_0 implements Migrate {
/** ログ */
private static final Log LOG = LogFactory.getLog(Migrate_1_5_0.class);

private static final String CIPHER_ALGORITHM = "AES";

public static Migrate_1_5_0 get() {
Expand Down Expand Up @@ -60,6 +66,8 @@ public boolean doMigrate() throws Exception {
// 暗号化の仕組みを変更したため、旧暗号化の仕組みを使っていた場合、それを復元して、再度暗号化し直す
File keyTxt = new File(AppConfig.get().getBasePath(), "key.txt");
if (!keyTxt.exists()) {
LOG.info("start data convert.");
AppConfig.get().getKey();
List<LdapConfigsEntity> ldaps = LdapConfigsDao.get().selectAll();
for (LdapConfigsEntity entity : ldaps) {
if (StringUtils.isNotEmpty(entity.getBindPassword())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1313,21 +1313,21 @@ public boolean isEditor(LoginedUser loginedUser, KnowledgesEntity entity, List<L
*/
public List<KnowledgesEntity> getPopularityKnowledges(LoginedUser loginedUser, int offset, int limit) {
long now = new Date().getTime();
LOG.info(now);
LOG.trace(now);

long term = 1000L * 60L * 60L * 24L * 30L;
LOG.info(term);
LOG.trace(term);
long s = now - term;
LOG.info(s);
LOG.trace(s);
Timestamp start = new Timestamp(s);
LOG.info(start.getTime());
LOG.info(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(start));
LOG.trace(start.getTime());
LOG.trace(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(start));

long e = now + (1000L * 60L * 60L * 24L * 1L);
LOG.info(e);
LOG.trace(e);
Timestamp end = new Timestamp(e);
LOG.info(end.getTime());
LOG.info(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(end));
LOG.trace(end.getTime());
LOG.trace(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(end));

if (loginedUser != null && loginedUser.isAdmin()) {
return KnowledgesDao.get().selectPopularity(start, end, offset, limit);
Expand Down

0 comments on commit dcada7c

Please sign in to comment.