\r
private JButton certificateDefaultsButton;\r
\r
+ private JButton newSSLCertificate;\r
+\r
public static void main(String... args) {\r
EventQueue.invokeLater(new Runnable() {\r
public void run() {\r
if (!caKeystore.exists()) {\r
// show certificate defaults dialog \r
certificateDefaultsButton.doClick();\r
+ \r
+ // create "localhost" ssl certificate\r
+ prepareX509Infrastructure();\r
}\r
}\r
}\r
\r
private boolean prepareX509Infrastructure() {\r
if (caKeystorePassword == null) {\r
- caKeystorePassword = gitblitSettings.getString(Keys.server.storePassword, null);\r
JPasswordField pass = new JPasswordField(10){\r
private static final long serialVersionUID = 1L;\r
\r
if (result == JOptionPane.OK_OPTION) {\r
caKeystorePassword = new String(pass.getPassword());\r
} else {\r
- caKeystorePassword = null;\r
return false;\r
}\r
}\r
}\r
});\r
\r
- JButton newSSLCertificate = new JButton(new ImageIcon(getClass().getResource("/rosette_16x16.png")));\r
+ newSSLCertificate = new JButton(new ImageIcon(getClass().getResource("/rosette_16x16.png")));\r
newSSLCertificate.setFocusable(false);\r
newSSLCertificate.setToolTipText(Translation.get("gb.newSSLCertificate")); \r
newSSLCertificate.addActionListener(new ActionListener() {\r
metadata.serverHostname = Constants.NAME;\r
}\r
metadata.userDisplayname = ucm.user.getDisplayName();\r
- sendEmail(ucm.user, metadata, zip);\r
- return true;\r
+ return sendEmail(ucm.user, metadata, zip);\r
}\r
\r
@Override\r
}\r
}\r
\r
- private void sendEmail(UserModel user, X509Metadata metadata, File zip) {\r
+ private boolean sendEmail(UserModel user, X509Metadata metadata, File zip) {\r
// send email\r
try {\r
if (mail.isReady()) {\r
message.setContent(mp);\r
\r
mail.sendNow(message);\r
+ return true;\r
} else {\r
JOptionPane.showMessageDialog(GitblitAuthority.this, "Sorry, the mail server settings are not configured properly.\nCan not send email.", Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);\r
}\r
} catch (Exception e) {\r
Utils.showException(GitblitAuthority.this, e);\r
}\r
+ return false;\r
}\r
}\r