svnno****@sourc*****
svnno****@sourc*****
2007年 4月 13日 (金) 22:04:18 JST
Revision: 46 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=46 Author: shinsuke Date: 2007-04-13 22:04:18 +0900 (Fri, 13 Apr 2007) Log Message: ----------- password is not displayed at a confirmation page. Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java pal-admin/trunk/src/main/webapp/view/user/userConfirm.html pal-admin/trunk/src/main/webapp/view/user/userCreate.html -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java 2007-04-13 08:57:59 UTC (rev 45) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/PALAdminConstants.java 2007-04-13 13:04:18 UTC (rev 46) @@ -95,4 +95,6 @@ public static final String LOCAL_TEMP_FILENAME_PREFIX = "uploadedPortletApplication"; public static final String LOCAL_TEMP_FILENAME_SUFFIX = ".war"; + + public static final String PASSWORD = PREFIX + "Password"; } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java 2007-04-13 08:57:59 UTC (rev 45) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/util/PALAdminUtil.java 2007-04-13 13:04:18 UTC (rev 46) @@ -26,10 +26,21 @@ import java.util.List; import java.util.Map; +import javax.faces.context.FacesContext; import javax.security.auth.Subject; +import jp.sf.pal.admin.PALAdminConstants; + public class PALAdminUtil { + /** + * @return the facesContext + */ + private static FacesContext getFacesContext() + { + return FacesContext.getCurrentInstance(); + } + public static boolean isEmpty(String s) { if (s == null) @@ -141,4 +152,22 @@ } } } + + public static void setPasswordToSession(String value) + { + getFacesContext().getExternalContext().getSessionMap().put( + PALAdminConstants.PASSWORD, value); + } + + public static String getPasswordFromSession() + { + return (String) getFacesContext().getExternalContext().getSessionMap() + .get(PALAdminConstants.PASSWORD); + } + + public static void removePasswordFromSession() + { + getFacesContext().getExternalContext().getSessionMap().remove( + PALAdminConstants.PASSWORD); + } } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java 2007-04-13 08:57:59 UTC (rev 45) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserConfirmPage.java 2007-04-13 13:04:18 UTC (rev 46) @@ -21,6 +21,7 @@ import javax.faces.internal.FacesMessageUtil; import jp.sf.pal.admin.PALAdminException; +import jp.sf.pal.admin.util.PALAdminUtil; import jp.sf.pal.admin.web.CrudType; import org.seasar.framework.log.Logger; @@ -73,6 +74,8 @@ { try { + setPassword(PALAdminUtil.getPasswordFromSession()); + PALAdminUtil.removePasswordFromSession(); getUserManagementService().insert(this); FacesMessageUtil.addInfoMessage("added.new.user", new Object[] { getName() }); @@ -101,6 +104,13 @@ } } + @TakeOver(properties = "name,updateRequired,roleName") + public Class doCreate() + { + PALAdminUtil.removePasswordFromSession(); + return UserCreatePage.class; + } + public boolean isComeFromList() { return getCrudType() == CrudType.READ Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java 2007-04-13 08:57:59 UTC (rev 45) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/user/UserCreatePage.java 2007-04-13 13:04:18 UTC (rev 46) @@ -20,6 +20,11 @@ import java.util.List; import java.util.Map; +import jp.sf.pal.admin.PALAdminConstants; +import jp.sf.pal.admin.util.PALAdminUtil; + +import org.seasar.teeda.extension.annotation.takeover.TakeOver; + public class UserCreatePage extends AbstractUserPage implements Serializable { /** @@ -59,4 +64,11 @@ return null; } + @TakeOver(properties = "name,password,updateRequired,roleName") + public Class doConfirm() + { + PALAdminUtil.setPasswordToSession(getPassword()); + setPassword("******"); + return UserConfirmPage.class; + } } Modified: pal-admin/trunk/src/main/webapp/view/user/userConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userConfirm.html 2007-04-13 08:57:59 UTC (rev 45) +++ pal-admin/trunk/src/main/webapp/view/user/userConfirm.html 2007-04-13 13:04:18 UTC (rev 46) @@ -59,6 +59,10 @@ <input type="button" id="jumpUserList" value="Back" onclick="location.href='userList.html'" class="portlet-form-button"/> </div> + <div id="isCreate" style="display:inline;"> + <input type="button" id="doCreate" value="Back" + onclick="location.href='userCreate.html'" class="portlet-form-button"/> + </div> <div id="isNotRead" style="display:inline;"> <input type="button" id="doFinish-create" value="Finish" onclick="location.href='userList.html'" class="portlet-form-button"/> </div> Modified: pal-admin/trunk/src/main/webapp/view/user/userCreate.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/user/userCreate.html 2007-04-13 08:57:59 UTC (rev 45) +++ pal-admin/trunk/src/main/webapp/view/user/userCreate.html 2007-04-13 13:04:18 UTC (rev 46) @@ -60,7 +60,7 @@ <input type="button" id="jumpUserList" value="Back" onclick="location.href='userList.html'" class="portlet-form-button"/> <div id="isNotRead" style="display:inline;"> - <input type="button" id="goUserConfirm" value="Confirm" + <input type="button" id="doConfirm" value="Confirm" onclick="location.href='userConfirm.html'" class="portlet-form-button"/> </div> </div>