directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-commander git commit: FC-194 - Change password represenation from a char[] to a String
Date Tue, 11 Oct 2016 01:47:26 GMT
Repository: directory-fortress-commander
Updated Branches:
  refs/heads/master b5add2de1 -> b247605a4


FC-194 - Change password represenation from a char[] to a String


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/commit/b247605a
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/tree/b247605a
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/diff/b247605a

Branch: refs/heads/master
Commit: b247605a43685416c6d62209c29f7962da9c83b6
Parents: b5add2d
Author: Shawn McKinney <smckinney@apache.org>
Authored: Mon Oct 10 20:25:57 2016 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Mon Oct 10 20:25:57 2016 -0500

----------------------------------------------------------------------
 .../directory/fortress/web/common/GlobalIds.java    |  2 +-
 .../fortress/web/panel/UserDetailPanel.java         | 16 +++++++++-------
 .../fortress/web/panel/UserDetailPanel.html         |  4 ++--
 src/main/webapp/login/login.html                    |  4 ++--
 .../web/integration/FortressWebSeleniumITCase.java  |  8 ++++----
 5 files changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/b247605a/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java b/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
index dc9d42a..af1b6f1 100644
--- a/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
+++ b/src/main/java/org/apache/directory/fortress/web/common/GlobalIds.java
@@ -129,7 +129,7 @@ public class GlobalIds
     public static final String SAVE = "save";
     public static final String NAME = "name";
     public static final String USER_ID = "userId";
-    public static final String PSWD_FIELD = "pswdField";
+    public static final String PASSWORD = "password";
     public static final String NEW_USER_ROLE_FIELD = "newUserRole";
     public static final String NEW_USER_ADMIN_ROLE_FIELD = "newUserAdminRole";
     public static final String LOGIN = "login";

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/b247605a/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java b/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
index 1cef0a2..96a918f 100644
--- a/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
+++ b/src/main/java/org/apache/directory/fortress/web/panel/UserDetailPanel.java
@@ -130,7 +130,6 @@ public class UserDetailPanel extends FormComponentPanel
         private static final String DEFAULT_JPG = "GenericAvatar.jpg";
 
         // form model attributes:
-        private String pswdField;
         private String newUserRole;
         private String newUserAdminRole;
         private String userDetailLabel;
@@ -191,12 +190,9 @@ public class UserDetailPanel extends FormComponentPanel
             // Add the User page required attributes:
             userIdTF = new TextField( GlobalIds.USER_ID );
             add( userIdTF );
-            PasswordTextField pw = new PasswordTextField( GlobalIds.PSWD_FIELD, new PropertyModel<String>(
this,
-                GlobalIds.PSWD_FIELD ) );
-
+            PasswordTextField pw = new PasswordTextField( GlobalIds.PASSWORD );
             pw.setRequired( false );
             add( pw );
-
             TextField descriptionTF = new TextField( GlobalIds.DESCRIPTION );
             descriptionTF.setRequired( false );
             add( descriptionTF );
@@ -338,14 +334,16 @@ public class UserDetailPanel extends FormComponentPanel
                     log.debug( ".onSubmit Add" );
                     User user = ( User ) form.getModel().getObject();
                     // todo: fix this, going from string to char back to string (in ldap)?
+/*
                     if ( pswdField != null )
                     {
-                        user.setPassword( pswdField.toCharArray() );
+                        user.setPassword( pswdField );
                     }
                     else
                     {
                         user.setPassword( "".toCharArray() );
                     }
+*/
                     updateEntityWithComboData( user );
                     try
                     {
@@ -404,6 +402,7 @@ public class UserDetailPanel extends FormComponentPanel
                     log.debug( ".onSubmit commit" );
                     User user = ( User ) form.getModel().getObject();
                     // todo: fix this, going from string to char back to string (in ldap)?
+/*
                     if ( pswdField != null )
                     {
                         user.setPassword( pswdField.toCharArray() );
@@ -412,6 +411,7 @@ public class UserDetailPanel extends FormComponentPanel
                     {
                         user.setPassword( "".toCharArray() );
                     }
+*/
                     updateEntityWithComboData( user );
                     try
                     {
@@ -682,6 +682,7 @@ public class UserDetailPanel extends FormComponentPanel
                 protected void onSubmit( AjaxRequestTarget target, Form form )
                 {
                     User user = ( User ) form.getModel().getObject();
+/*
                     if ( pswdField != null )
                     {
                         user.setPassword( pswdField.toCharArray() );
@@ -690,10 +691,11 @@ public class UserDetailPanel extends FormComponentPanel
                     {
                         user.setPassword( "".toCharArray() );
                     }
+*/
                     String msg = "User: " + user.getUserId();
                     try
                     {
-                        adminMgr.resetPassword( user, user.getPassword() );
+                        adminMgr.resetPassword( user, user.getPassword().toCharArray() );
                         user.setReset( true );
                         msg += " account has been reset";
                         display.setMessage( msg );

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/b247605a/src/main/resources/org/apache/directory/fortress/web/panel/UserDetailPanel.html
----------------------------------------------------------------------
diff --git a/src/main/resources/org/apache/directory/fortress/web/panel/UserDetailPanel.html
b/src/main/resources/org/apache/directory/fortress/web/panel/UserDetailPanel.html
index 384439f..9c4d4e5 100644
--- a/src/main/resources/org/apache/directory/fortress/web/panel/UserDetailPanel.html
+++ b/src/main/resources/org/apache/directory/fortress/web/panel/UserDetailPanel.html
@@ -48,11 +48,11 @@
         </tr>
         <tr>
             <td>
-                <label for="pswdField">Password</label>
+                <label for="password">Password</label>
 
             </td>
             <td>
-                <input wicket:id="pswdField" id="pswdField" type="password" style="width:
250px"/>
+                <input wicket:id="password" id="password" type="password" style="width:
250px"/>
 
             </td>
         </tr>

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/b247605a/src/main/webapp/login/login.html
----------------------------------------------------------------------
diff --git a/src/main/webapp/login/login.html b/src/main/webapp/login/login.html
index 3187bbb..c179f39 100644
--- a/src/main/webapp/login/login.html
+++ b/src/main/webapp/login/login.html
@@ -39,11 +39,11 @@
             </tr>
             <tr>
                 <td>
-                    <label for="pswdField">Password</label>
+                    <label for="password">Password</label>
 
                 </td>
                 <td>
-                    <input id="pswdField" name="j_password" type="password" style="width:
250px"/>
+                    <input id="password" name="j_password" type="password" style="width:
250px"/>
                 </td>
             </tr>
             <tr>

http://git-wip-us.apache.org/repos/asf/directory-fortress-commander/blob/b247605a/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
b/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
index 56ba809..46aab70 100644
--- a/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
+++ b/src/test/java/org/apache/directory/fortress/web/integration/FortressWebSeleniumITCase.java
@@ -203,8 +203,8 @@ public class FortressWebSeleniumITCase
         driver.findElement( By.id( GlobalIds.USER_ID ) ).clear();
         driver.findElement( By.id( GlobalIds.USER_ID ) ).sendKeys( userId );
         TUtils.sleep( 1 );
-        driver.findElement( By.id( GlobalIds.PSWD_FIELD ) ).clear();
-        driver.findElement( By.id( GlobalIds.PSWD_FIELD ) ).sendKeys( password );
+        driver.findElement( By.id( GlobalIds.PASSWORD ) ).clear();
+        driver.findElement( By.id( GlobalIds.PASSWORD ) ).sendKeys( password );
         TUtils.sleep( 1 );
         driver.findElement( By.name( GlobalIds.LOGIN ) ).click();
     }
@@ -245,8 +245,8 @@ public class FortressWebSeleniumITCase
         driver.findElement( By.name( GlobalIds.CLEAR ) ).click();
         TUtils.sleep( 1 );
         driver.findElement( By.id( GlobalIds.USER_ID ) ).sendKeys( "selTestU1" );
-        driver.findElement( By.id( GlobalIds.PSWD_FIELD ) ).clear();
-        driver.findElement( By.id( GlobalIds.PSWD_FIELD ) ).sendKeys( "password" );
+        driver.findElement( By.id( GlobalIds.PASSWORD ) ).clear();
+        driver.findElement( By.id( GlobalIds.PASSWORD ) ).sendKeys( "password" );
         driver.findElement( By.id( GlobalIds.OU ) ).clear();
         driver.findElement( By.id( GlobalIds.OU ) ).sendKeys( "dev1" );
         driver.findElement( By.name( GlobalIds.OU_SEARCH ) ).click();


Mime
View raw message