Skip to content

Commit

Permalink
Merge pull request #961 from support-project/issue926_signup
Browse files Browse the repository at this point in the history
#926 Change page transition after double opt-in
  • Loading branch information
koda-masaru authored Nov 19, 2017
2 parents afc9cc1 + 5c1bd9e commit fdbac9b
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.support.project.knowledge.control.open;

import java.util.Date;
import java.util.List;
import java.util.UUID;

Expand All @@ -24,7 +23,6 @@
import org.support.project.web.boundary.Boundary;
import org.support.project.web.common.HttpStatus;
import org.support.project.web.common.HttpUtil;
import org.support.project.web.config.HttpMethod;
import org.support.project.web.config.WebConfig;
import org.support.project.web.control.service.Get;
import org.support.project.web.control.service.Post;
Expand Down Expand Up @@ -135,7 +133,7 @@ public Boundary save() {
@Aspect(advice = org.support.project.ormapping.transaction.Transaction.class)
private ProvisionalRegistrationsEntity addProvisionalRegistration() {
ProvisionalRegistrationsEntity entity = super.getParams(ProvisionalRegistrationsEntity.class);
String id = UUID.randomUUID().toString() + "-" + DateUtils.now() + "-" + UUID.randomUUID().toString();
String id = UUID.randomUUID().toString() + "-" + DateUtils.getTransferDateFormat().format(DateUtils.now());
entity.setId(id);
ProvisionalRegistrationsDao dao = ProvisionalRegistrationsDao.get();
// 既に仮登録が行われたユーザ(メールアドレス)でも、再度仮登録できる
Expand Down Expand Up @@ -230,7 +228,7 @@ public Boundary activate() {
logic.setSession(entity.getUserKey(), getRequest(), getResponse());

addMsgInfo("knowledge.signup.done");
return devolution(HttpMethod.get, "Index/index");
return forward("signup_done.jsp");
}

}
1 change: 1 addition & 0 deletions src/main/resources/appresource.properties
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ knowledge.signup.success=User registration is now complete
knowledge.signup.exists=It is already been registered. Since the registered e-mail address has sent an invitation e-mail, please check.
knowledge.signup.waiting=You are already registered but do not live to be confirmed by the administrator. Please wait.
knowledge.signup.done=User registration is now complete
knowledge.signup.done.link=Start Knowledge

knowledge.tags.title=Tag list
knowledge.account.title=My Account
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/appresource_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ knowledge.signup.success=ユーザ登録しました
knowledge.signup.exists=既に登録済です。登録されたメールアドレスに招待のメールを送信していますので、ご確認ください。
knowledge.signup.waiting=既に登録済ですが管理者による確認がすんでいません。少々お待ちください。
knowledge.signup.done=ユーザ登録が完了しました
knowledge.signup.done.link=Knowledge の利用開始

knowledge.tags.title=タグ一覧
knowledge.account.title=アカウント情報
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/WEB-INF/views/commons/errors/server_error.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<br/>

<%
if (request.getRemoteAddr().startsWith("192.168.")
|| request.getRemoteAddr().equals("127.0.0.1")
if (
request.getRemoteAddr().equals("127.0.0.1")
|| request.getRemoteAddr().equals("0:0:0:0:0:0:0:1")) {
if (exception == null && request.getAttribute("SERVER_EXCEPTION") != null) {
exception = (Throwable) request.getAttribute("SERVER_EXCEPTION");
Expand Down
52 changes: 26 additions & 26 deletions src/main/webapp/WEB-INF/views/open/signup/signup.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@
<h4 class="title"><%= jspUtil.label("knowledge.signup.title") %></h4>

<div class="row">
<div class="col-sm-12 col-md-12">
<form action="<%= request.getContextPath()%>/open.signup/save" method="post" role="form">
<div class="form-group">
<label for="userKey"><%= jspUtil.label("knowledge.signup.label.mail") %></label>
<input type="text" class="form-control" name="userKey" id="userKey" placeholder="Mail Address" value="<%= jspUtil.out("userKey") %>" />
</div>
<div class="form-group">
<label for="userName"><%= jspUtil.label("knowledge.signup.label.name") %></label>
<input type="text" class="form-control" name="userName" id="userName" placeholder="User Name" value="<%= jspUtil.out("userName") %>" />
</div>
<div class="form-group">
<label for="password"><%= jspUtil.label("knowledge.signup.label.password") %></label>
<input type="password" class="form-control" name="password" id="password" placeholder="Password" value="<%= jspUtil.out("password") %>" />
</div>
<div class="form-group">
<label for="confirm_password"><%= jspUtil.label("knowledge.signup.label.confirm.password") %></label>
<input type="password" class="form-control" name="confirm_password" id="confirm_password" placeholder="Confirm Password" value="<%= jspUtil.out("confirm_password") %>" />
</div>
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i>&nbsp;<%= jspUtil.label("label.registration") %></button>
<a href="<%= request.getContextPath() %>/open.knowledge/list"
class="btn btn-success " role="button"><i class="fa fa-list-ul"></i>&nbsp;<%= jspUtil.label("knowledge.view.back.list") %></a>
</form>
</div>
<div class="col-sm-12 col-md-12">
<form action="<%= request.getContextPath()%>/open.signup/save" method="post" role="form">
<div class="form-group">
<label for="userKey"><%= jspUtil.label("knowledge.signup.label.mail") %></label>
<input type="text" class="form-control" name="userKey" id="userKey" placeholder="Mail Address" value="<%= jspUtil.out("userKey") %>" />
</div>
<div class="form-group">
<label for="userName"><%= jspUtil.label("knowledge.signup.label.name") %></label>
<input type="text" class="form-control" name="userName" id="userName" placeholder="User Name" value="<%= jspUtil.out("userName") %>" />
</div>
<div class="form-group">
<label for="password"><%= jspUtil.label("knowledge.signup.label.password") %></label>
<input type="password" class="form-control" name="password" id="password" placeholder="Password" value="<%= jspUtil.out("password") %>" />
</div>
<div class="form-group">
<label for="confirm_password"><%= jspUtil.label("knowledge.signup.label.confirm.password") %></label>
<input type="password" class="form-control" name="confirm_password" id="confirm_password" placeholder="Confirm Password" value="<%= jspUtil.out("confirm_password") %>" />
</div>
<button type="submit" class="btn btn-primary"><i class="fa fa-save"></i>&nbsp;<%= jspUtil.label("label.registration") %></button>
<a href="<%= request.getContextPath() %>/open.knowledge/list"
class="btn btn-success " role="button"><i class="fa fa-list-ul"></i>&nbsp;<%= jspUtil.label("knowledge.view.back.list") %></a>
</form>
</div>
</div>


Expand Down
30 changes: 30 additions & 0 deletions src/main/webapp/WEB-INF/views/open/signup/signup_done.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%@page import="org.support.project.web.util.JspUtil"%>
<%@page pageEncoding="UTF-8" isELIgnored="false" session="false" errorPage="/WEB-INF/views/commons/errors/jsp_error.jsp"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<% JspUtil jspUtil = new JspUtil(request, pageContext); %>

<c:import url="/WEB-INF/views/commons/layout/layoutMain.jsp">

<c:param name="PARAM_HEAD">
</c:param>

<c:param name="PARAM_SCRIPTS">
</c:param>

<c:param name="PARAM_CONTENT">
<h4 class="title"><%= jspUtil.label("knowledge.signup.title") %></h4>

<p>
<%= jspUtil.label("knowledge.signup.done") %>
</p>

<p>
<a href="<%= request.getContextPath() %>/open.knowledge/list" class="btn btn-info"><%= jspUtil.label("knowledge.signup.done.link") %></a>
</p>

</c:param>

</c:import>

0 comments on commit fdbac9b

Please sign in to comment.