| 73 | | addRow("connectionName", connectionName); |
| 74 | | addRow("connectionPassword", connectionPassword ); |
| 75 | | addRow("connectionURL", connectionURL ); |
| 76 | | addRow("contextFactory", contextFactory); |
| 77 | | addRow( "digest", digest); |
| 78 | | addRow("userPassword", userPassword ); |
| 79 | | addRow("userMail", userMail ); |
| 80 | | addRow("userCn", userCn ); |
| 81 | | addRow("userSearch", userSearch ); |
| 82 | | addRow("userBase", userBase ); |
| | 79 | addRow(CONNECTION_NAME, connectionName); |
| | 80 | addRow(CONNECTION_PASSWORD, connectionPassword ); |
| | 81 | addRow(CONNECTION_URL, connectionURL ); |
| | 82 | addRow(CONTEXT_FACTORY, contextFactory); |
| | 83 | addRow(DIGEST, digest); |
| | 84 | addRow(USER_PASSWORD, userPassword ); |
| | 85 | addRow(USER_MAIL, userMail ); |
| | 86 | addRow(USER_CN, userCn ); |
| | 87 | addRow(USER_SEARCH, userSearch ); |
| | 88 | addRow(USER_BASE, userBase ); |
| | 89 | JButton testButton = new JButton("Test access"); |
| | 90 | addRow("TestAccess", testButton ); |
| | 91 | testButton.addActionListener( new ActionListener() |
| | 92 | { |
| | 93 | |
| | 94 | public void actionPerformed(ActionEvent e) { |
| | 95 | try |
| | 96 | { |
| | 97 | JNDITest test = (JNDITest)getContext().lookup(JNDITest.ROLE); |
| | 98 | DefaultConfiguration conf = new DefaultConfiguration("test"); |
| | 99 | StringBuffer buf = new StringBuffer(); |
| | 100 | addChildren(conf); |
| | 101 | String[] attributes = conf.getAttributeNames(); |
| | 102 | for (int i=0;i<attributes.length;i++) |
| | 103 | { |
| | 104 | String attribute = attributes[i]; |
| | 105 | String value = conf.getAttribute( attribute, null); |
| | 106 | buf.append( attribute); |
| | 107 | buf.append("="); |
| | 108 | buf.append( value ); |
| | 109 | buf.append("RAPLANEXT"); |
| | 110 | } |
| | 111 | String list = buf.toString(); |
| | 112 | String username = "admin"; |
| | 113 | String password =""; |
| | 114 | { |
| | 115 | PasswordEnterUI testUser = new PasswordEnterUI(getContext()); |
| | 116 | DialogUI dialog =DialogUI.create( getContext(), getComponent(), true,testUser.getComponent(),new String[] {"test","abort"}); |
| | 117 | dialog.setTitle("Please enter valid user!"); |
| | 118 | dialog.start(); |
| | 119 | username = testUser.getUsername(); |
| | 120 | password = new String(testUser.getNewPassword()); |
| | 121 | int index=dialog.getSelectedIndex(); |
| | 122 | if ( index > 0) |
| | 123 | { |
| | 124 | return; |
| | 125 | } |
| | 126 | } |
| | 127 | test.test(list,username,password); |
| | 128 | { |
| | 129 | DialogUI dialog =DialogUI.create( getContext(), getComponent(), true, "JNDI","JNDI Authentification successfull"); |
| | 130 | dialog.start(); |
| | 131 | } |
| | 132 | } catch (Exception ex) |
| | 133 | { |
| | 134 | showException(ex, getComponent()); |
| | 135 | } |
| | 136 | |
| | 137 | } |
| | 138 | |
| | 139 | }); |
| 96 | | setAttribute(newConfig,"digest", digest); |
| 97 | | setAttribute(newConfig,"connectionName", connectionName); |
| 98 | | setAttribute(newConfig,"connectionPassword", connectionPassword ); |
| 99 | | setAttribute(newConfig,"connectionURL", connectionURL ); |
| 100 | | setAttribute(newConfig,"contextFactory", contextFactory); |
| 101 | | setAttribute(newConfig,"userPassword", userPassword ); |
| 102 | | setAttribute(newConfig,"userMail", userMail ); |
| 103 | | setAttribute(newConfig,"userCn", userCn ); |
| 104 | | setAttribute(newConfig,"userSearch", userSearch ); |
| 105 | | setAttribute(newConfig,"userBase", userBase ); |
| | 153 | setAttribute(newConfig,CONNECTION_NAME, connectionName); |
| | 154 | setAttribute(newConfig,CONNECTION_PASSWORD, connectionPassword ); |
| | 155 | setAttribute(newConfig,CONNECTION_URL, connectionURL ); |
| | 156 | setAttribute(newConfig,CONTEXT_FACTORY, contextFactory); |
| | 157 | setAttribute(newConfig,DIGEST, digest); |
| | 158 | setAttribute(newConfig,USER_BASE, userBase ); |
| | 159 | setAttribute(newConfig,USER_CN, userCn ); |
| | 160 | setAttribute(newConfig,USER_MAIL, userMail ); |
| | 161 | setAttribute(newConfig,USER_PASSWORD, userPassword ); |
| | 162 | setAttribute(newConfig,USER_SEARCH, userSearch ); |