Hi, 

i have written some patches for jxplorer 

find_dn.patch: 
- right click on any attribute, if the value of the attribute is a dn, 
  then open it in the search bar 

ssha_and_passwd_verify.patch: 
- ssha support 
- passwords can be verified 

rfc2254_search_bar.patch: 
- it is possible use rfc2254-compatible search strings in the quick search 
  bar if the attribute is named "rfc2254". Very handy if you just want to 
  do a quick complex search. 

The patches are all for the 3.2RC1 source release (this week i didn't 
have access to the CVS version). 

I would be glad if you could integrate the patches into the mainstream 
version. 

Let me hear what you think about it. 

Greetings, 
-timo
--
Timo Benk - Jabber ID: [EMAIL PROTECTED] - ICQ ID: #241877854
PGP Public Key: http://m28s01.vlinux.de/timo_benk_gpg_key.asc
diff -r jxplorer.modified/src/com/ca/directory/jxplorer/viewer/TableAttributeEditor.java jxplorer.org/src/com/ca/directory/jxplorer/viewer/TableAttributeEditor.java
103c103
<         popupTableTool = new SmartPopupTableTool(attributeTable, tableData, (JXplorer)owner);
---
>         popupTableTool = new SmartPopupTableTool(attributeTable, tableData);
856c856
< }
---
> }
\ Kein Zeilenumbruch am Dateiende.
diff -r jxplorer.modified/src/com/ca/directory/jxplorer/viewer/tableviewer/SmartPopupTableTool.java jxplorer.org/src/com/ca/directory/jxplorer/viewer/tableviewer/SmartPopupTableTool.java
13,15d12
< import com.ca.directory.jxplorer.JXplorer;
< import com.ca.directory.jxplorer.search.SearchExecute;
< 
26,28c23
<     JMenuItem delete, newValue, findDN, makeNaming, removeNaming;  // displayable menu options for user input
< 
<     JXplorer jx;                       // JXplorer object
---
>     JMenuItem delete, newValue, makeNaming, removeNaming;  // displayable menu options for user input
55c50
<     public SmartPopupTableTool(JTable t, AttributeTableModel m, JXplorer jxplorer)
---
>     public SmartPopupTableTool(JTable t, AttributeTableModel m)
57d51
<         jx = jxplorer;
64d57
<         add(findDN = new JMenuItem(CBIntText.get("Find DN")));
72d64
<         findDN.addActionListener(this);
158,161d149
<         else if (eventSource == findDN)
<         {
<             findDNComponent();
<         }
216,238c204
<     public void findDNComponent()
<     {
<         if ("".equals(currentValue.getStringValue()))
<         {
<             jx.getSearchTree().clearTree();
<             jx.getTreeTabPane().setSelectedComponent(jx.getResultsPanel());
<             return;
<         }
< 
<         String filter = "(objectclass=*)";
<         DN dn = new DN(currentValue.getStringValue());
< 
<         String aliasOption = "always";
<         log.info("Setting search alias option to: ["+aliasOption+"]");
<         JXplorer.setProperty("option.ldap.searchAliasBehaviour", aliasOption);
< 
<         jx.getSearchBroker().setGUIQuiet(true);
<         SearchExecute.run(jx.getSearchTree(), dn, filter, new String[] {"objectClass"}, 0, jx.getSearchBroker());
< 
<         jx.getTreeTabPane().setSelectedComponent(jx.getResultsPanel());
<         
<     }
< 
---
>     
255c221
< }
---
> }
\ Kein Zeilenumbruch am Dateiende.
diff -r jxplorer.modified/src/com/ca/directory/jxplorer/search/SearchBar.java jxplorer.org/src/com/ca/directory/jxplorer/search/SearchBar.java
62c62
<             selections = new String[] {"rfc2254","cn","sn","description","telephoneNumber","postalCode","address"};
---
>             selections = new String[] {"cn","sn","description","telephoneNumber","postalCode","address"};
109,110d108
<                 else if("rfc2254".equals(searchAttribute.getSelectedItem()))
<                     filter = searchFilter.getText();
227c225
< }
---
> }
\ Kein Zeilenumbruch am Dateiende.
diff -r jxplorer.modified/src/com/ca/directory/jxplorer/editor/userpasswordeditor.java jxplorer.org/src/com/ca/directory/jxplorer/editor/userpasswordeditor.java
19d18
< import java.security.SecureRandom;
34,38d32
<     /**
<      * SSHA.
<      */
<     public static final String SSHA = "SSHA";
< 
94,101d87
<         if(default_encryption == 0) {
<             newPwd.setEditable (false);
<             newLabel.setEnabled (false);
<         } else {
<             newPwd.setEditable (true);
<             newLabel.setEnabled (true);
<         }
< 
112d97
<         comboType.addItem(CBIntText.get("verify"));
116d100
<         comboType.addItem(CBIntText.get(SSHA));
119,134d102
<         comboType.addItemListener(new ItemListener()
<         {
<             public void itemStateChanged (ItemEvent e)
<             {
<                 if (comboType.getSelectedIndex() == 0)
<                 {
<                     newPwd.setEditable (false);
<                     newLabel.setEnabled (false);
<                 }
<                 else
<                 {
<                     newPwd.setEditable (true);
<                     newLabel.setEnabled (true);
<                 }
<             }
<         });
236c204
<     protected byte[] mdDecode(String s, int type, byte[] salt)
---
>     protected byte[] mdDecode(String s, int type)
244,247c212
<             if (type==4) {
<                 md=MessageDigest.getInstance(SHA);
<                 hexString.append("{" + SSHA + "}");
<             } else if (type==3) {
---
>             if (type==2) {
256,276c221,224
< 
<             if(salt!=null)
<             {
<                 md.update(salt);
<                 byte[] buff = md.digest();
<                 byte[] new_buf = new byte[buff.length+salt.length];
<                 
<                 for (int x = 0; x < buff.length; x++)
<                     new_buf[x] = buff[x];
< 
<                 for (int x = buff.length; x < new_buf.length; x++)
<                     new_buf[x] = salt[x-buff.length];
< 
<                 hexString.append(CBBase64.binaryToString(new_buf));
<              } else
<              {
<                 byte[] buff = md.digest();
<                 hexString.append(CBBase64.binaryToString(buff));
<              }
< 
<              return hexString.toString().getBytes("UTF-8");
---
>             byte[] buff = md.digest();
>             
>             hexString.append(CBBase64.binaryToString(buff));
>             return hexString.toString().getBytes("UTF-8");
295c243
<     protected byte[] stringDecode(String s, byte[] salt)
---
>     protected byte[] stringDecode(String s)
302c250
<                 case 1:
---
>                 case 0:
303a252,253
>                 case 1:
>                     return mdDecode(s, 1);
305,309c255
<                     return mdDecode(s, 2, null);
<                 case 3:
<                     return mdDecode(s, 3, null);
<                 case 4:
<                     return mdDecode(s, 4, salt);
---
>                     return mdDecode(s, 2);
311c257
<                     return mdDecode(s, 2, null);
---
>                     return mdDecode(s, 1);
342c288
<         if (comboType.getSelectedIndex() == 0)
---
>         if (passwordConfirm())
344,392c290
<             String nPwd = new String(oldPwd.getPassword());
<             String oPwd = stringEncode(editMe.getValue());
<             if (oPwd.startsWith("{MD5}"))
<             {
<                     nPwd = new String(mdDecode(nPwd, 2, null));
<             }
<             else if (oPwd.startsWith("{SHA}"))
<             {
<                     nPwd = new String(mdDecode(nPwd, 3, null));
<             }
<             else if (oPwd.startsWith("{SSHA}"))
<             {
<                     if(oPwd.length() > 14) 
<                     {
<                         byte[] tmp = CBBase64.stringToBinary(oPwd.substring(6));
<                         byte[] salt = new byte[8];
<                         for(int x=0; x<8; x++) 
<                             salt[x]=tmp[x+(tmp.length-8)];
< 
<                         nPwd = new String(mdDecode(nPwd, 4, salt));
<                     }
<             }
<             else
<             {
<                     nPwd = new String(plainDecode(nPwd));
<             }
<             String msg_1 = CBIntText.get("Password not verified.");
<             String msg_2 = CBIntText.get("Password Verification.");
<             if (nPwd.equals(oPwd))
<                 msg_1 = CBIntText.get("Password verified.");
< 
<             JOptionPane.showMessageDialog(display, msg_1, msg_2, JOptionPane.INFORMATION_MESSAGE);
<         }
<         else if (passwordConfirm())
<         {
<             byte[] salt = null;
<             if(comboType.getSelectedIndex() == 4) {
<                 try {
<                     SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
<                     salt = new byte[8];
<                     random.nextBytes (salt);
<                 } catch (java.security.NoSuchAlgorithmException e) {
<                     log.log(Level.WARNING, "Unexpected error encoding password ", e);
<                     e.printStackTrace();
<                     return;
<                 }
<             }
<                 
<             editMe.setValue(stringDecode(new String(newPwd.getPassword()), salt));
---
>             editMe.setValue(stringDecode(new String(newPwd.getPassword())));
431c329
< }
---
> }
\ Kein Zeilenumbruch am Dateiende.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jxplorer-devel mailing list
Jxplorer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jxplorer-devel

Reply via email to