diff options
Diffstat (limited to 'pki/base/common/src/com/netscape')
15 files changed, 89 insertions, 8 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java index 1ba80999a..c205dad95 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/AdminPanel.java @@ -205,20 +205,28 @@ public class AdminPanel extends WizardPanelBase { context.put("admin_pwd_again", pwd_again); context.put("import", "true"); - if (name == null || name.equals("")) + if (name == null || name.equals("")) { + context.put("updateStatus", "validate-failure"); throw new IOException("Name is empty"); + } - if (email == null || email.equals("")) + if (email == null || email.equals("")) { + context.put("updateStatus", "validate-failure"); throw new IOException("Email is empty"); + } - if (uid == null || uid.equals("")) + if (uid == null || uid.equals("")) { + context.put("updateStatus", "validate-failure"); throw new IOException("Uid is empty"); + } if (!pwd.equals(pwd_again)) { + context.put("updateStatus", "validate-failure"); throw new IOException("Password and password again are not the same."); } if (email == null || email.length() == 0) { + context.put("updateStatus", "validate-failure"); throw new IOException("Email address is empty string."); } } @@ -266,6 +274,7 @@ public class AdminPanel extends WizardPanelBase { createAdmin(request); } catch (IOException e) { context.put("errorString", "Failed to create administrator."); + context.put("updateStatus", "failure"); throw e; } @@ -285,6 +294,7 @@ public class AdminPanel extends WizardPanelBase { CMS.debug("AdminPanel update: Exception: " + e.toString()); context.put("errorString", "Failed to create administrator certificate."); + context.put("updateStatus", "failure"); throw e; } } else { @@ -322,6 +332,8 @@ public class AdminPanel extends WizardPanelBase { try { config.commit(false); } catch (Exception e) {} + + context.put("updateStatus", "success"); } diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/BackupKeyCertPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/BackupKeyCertPanel.java index 5c5d80719..7e2aedad2 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/BackupKeyCertPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/BackupKeyCertPanel.java @@ -158,11 +158,13 @@ public class BackupKeyCertPanel extends WizardPanelBase { String pwdAgain = request.getParameter("__pwdagain"); if (pwd == null || pwdAgain == null || pwd.equals("") || pwdAgain.equals("")) { CMS.debug("BackupKeyCertPanel validate: Password is null"); + context.put("updateStatus", "validate-failure"); throw new IOException("PK12 password is empty."); } if (!pwd.equals(pwdAgain)) { CMS.debug("BackupKeyCertPanel validate: Password and password again are not the same."); + context.put("updateStatus", "validate-failure"); throw new IOException("PK12 password is different from the PK12 password again."); } } @@ -191,6 +193,7 @@ public class BackupKeyCertPanel extends WizardPanelBase { config.commit(false); } catch (EBaseException e) { } + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java index 720f419f4..842f87b5f 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CertRequestPanel.java @@ -489,8 +489,10 @@ public class CertRequestPanel extends WizardPanelBase { } catch (Exception e) { } - if (isPanelDone()) + if (isPanelDone()) { + context.put("updateStatus", "success"); return; + } try { Enumeration c = mCerts.elements(); @@ -736,6 +738,11 @@ public class CertRequestPanel extends WizardPanelBase { } } catch (Exception e) { } + if (!hasErr) { + context.put("updateStatus", "success"); + } else { + context.put("updateStatus", "failure"); + } } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java index 464abf955..a99969880 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/CreateSubsystemPanel.java @@ -195,6 +195,7 @@ public class CreateSubsystemPanel extends WizardPanelBase { if (select == null) { CMS.debug("CreateSubsystemPanel: choice not found"); + context.put("updateStatus", "failure"); throw new IOException("choice not found"); } @@ -276,6 +277,7 @@ public class CreateSubsystemPanel extends WizardPanelBase { } else { CMS.debug("CreateSubsystemPanel: invalid choice " + select); errorString = "Invalid choice"; + context.put("updateStatus", "failure"); throw new IOException("invalid choice " + select); } @@ -285,6 +287,7 @@ public class CreateSubsystemPanel extends WizardPanelBase { } context.put("errorString", errorString); + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java index fc127700f..feb16a490 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DatabasePanel.java @@ -310,15 +310,20 @@ public class DatabasePanel extends WizardPanelBase { } catch (Exception ee) { } } - if (masterhost.equals(realhostname) && masterport.equals(portStr)) + if (masterhost.equals(realhostname) && masterport.equals(portStr)) { + context.put("updateStatus", "validate-failure"); throw new IOException("Master and clone must not share the same internal database"); + } - if (!masterbasedn.equals(basedn)) + if (!masterbasedn.equals(basedn)) { + context.put("updateStatus", "validate-failure"); throw new IOException("Master and clone should have the same base DN"); + } } if (hostname == null || hostname.length() == 0) { cs.putString("preop.database.errorString", "Host is empty string"); + context.put("updateStatus", "validate-failure"); throw new IOException("Host is empty string"); } @@ -329,32 +334,38 @@ public class DatabasePanel extends WizardPanelBase { port = Integer.parseInt(portStr); } catch (Exception e) { cs.putString("preop.database.errorString", "Port is invalid"); + context.put("updateStatus", "validate-failure"); throw new IOException("Port is invalid"); } } else { cs.putString("preop.database.errorString", "Port is empty string"); + context.put("updateStatus", "validate-failure"); throw new IOException("Port is empty string"); } if (basedn == null || basedn.length() == 0) { cs.putString("preop.database.errorString", "Base DN is empty string"); + context.put("updateStatus", "validate-failure"); throw new IOException("Base DN is empty string"); } if (binddn == null || binddn.length() == 0) { cs.putString("preop.database.errorString", "Bind DN is empty string"); + context.put("updateStatus", "validate-failure"); throw new IOException("Bind DN is empty string"); } if (database == null || database.length() == 0) { cs.putString("preop.database.errorString", "Database is empty string"); + context.put("updateStatus", "validate-failure"); throw new IOException("Database is empty string"); } if (bindpwd == null || bindpwd.length() == 0) { cs.putString("preop.database.errorString", "Bind password is empty string"); + context.put("updateStatus", "validate-failure"); throw new IOException("Bind password is empty string"); } @@ -882,6 +893,7 @@ public class DatabasePanel extends WizardPanelBase { if (hostname1.equals(hostname2) && portStr1.equals(portStr2) && database1.equals(database2)) { + context.put("updateStatus", "success"); return; } } @@ -893,11 +905,13 @@ public class DatabasePanel extends WizardPanelBase { populateDB(request, context, (secure.equals("on")?"true":"false")); } catch (IOException e) { CMS.debug("DatabasePanel update: populateDB Exception: "+e.toString()); + context.put("updateStatus", "failure"); throw e; } catch (Exception e) { CMS.debug("DatabasePanel update: populateDB Exception: "+e.toString()); context.put("errorString", e.toString()); cs.putString("preop.database.errorString", e.toString()); + context.put("updateStatus", "failure"); throw new IOException(e.toString()); } @@ -914,6 +928,7 @@ public class DatabasePanel extends WizardPanelBase { psStore = CMS.createFileConfigStore(passwordFile); } catch (Exception e) { CMS.debug("ConfigDatabaseServlet update: " + e.toString()); + context.put("updateStatus", "failure"); throw new IOException( e.toString() ); } psStore.putString("internaldb", bindpwd); @@ -935,6 +950,7 @@ public class DatabasePanel extends WizardPanelBase { CMS.debug("DatabasePanel update: " + e.toString()); context.put("errorString", e.toString()); cs.putString("preop.database.errorString", e.toString()); + context.put("updateStatus", "failure"); throw new IOException(e.toString()); } @@ -1022,6 +1038,7 @@ public class DatabasePanel extends WizardPanelBase { + e.toString()); } } + context.put("updateStatus", "success"); } private void setupReplication(HttpServletRequest request, diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java index d4816bc9f..cf25ab0e9 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/DisplayCertChainPanel.java @@ -218,6 +218,7 @@ public class DisplayCertChainPanel extends WizardPanelBase { CMS.debug("DisplayCertChainPanel Exception="+ee.toString()); } } + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/HierarchyPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/HierarchyPanel.java index ed552c9fa..653387bf4 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/HierarchyPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/HierarchyPanel.java @@ -159,8 +159,10 @@ public class HierarchyPanel extends WizardPanelBase { IConfigStore config = CMS.getConfigStore(); try { String cstype = config.getString("preop.subsystem.select", ""); - if (cstype.equals("clone")) + if (cstype.equals("clone")) { + context.put("updateStatus", "success"); return; + } } catch (Exception e) { } @@ -168,6 +170,7 @@ public class HierarchyPanel extends WizardPanelBase { if (select == null) { CMS.debug("HierarchyPanel: choice not found"); + context.put("updateStatus", "failure"); throw new IOException("choice not found"); } @@ -185,8 +188,10 @@ public class HierarchyPanel extends WizardPanelBase { } else { config.putString(PCERT_PREFIX + "signing.type", "remote"); CMS.debug("HierarchyPanel: invalid choice " + select); + context.put("updateStatus", "failure"); throw new IOException("invalid choice " + select); } + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java index fc7338485..9b4a3ae3f 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportAdminCertPanel.java @@ -229,6 +229,7 @@ public class ImportAdminCertPanel extends WizardPanelBase { } catch (Exception e) { CMS.debug( "ImportAdminCertPanel update: Failed to get request id."); + context.put("updateStatus", "failure"); throw new IOException("Failed to get request id."); } @@ -294,12 +295,14 @@ public class ImportAdminCertPanel extends WizardPanelBase { } catch (LDAPException e) { CMS.debug("ImportAdminCertPanel update: failed to add certificate to the internal database. Exception: "+e.toString()); if (e.getLDAPResultCode() != LDAPException.ATTRIBUTE_OR_VALUE_EXISTS) { + context.put("updateStatus", "failure"); throw new IOException(e.toString()); } } catch (Exception e) { CMS.debug( "ImportAdminCertPanel update: failed to add certificate. Exception: " + e.toString()); + context.put("updateStatus", "failure"); throw new IOException(e.toString()); } @@ -307,6 +310,7 @@ public class ImportAdminCertPanel extends WizardPanelBase { context.put("info", ""); context.put("title", "Import Administrator Certificate"); context.put("panel", "admin/console/config/importadmincertpanel.vm"); + context.put("updateStatus", "success"); } public boolean shouldSkip() { diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportCAChainPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportCAChainPanel.java index c3c60cd82..fe32ee799 100755 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportCAChainPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ImportCAChainPanel.java @@ -136,6 +136,7 @@ public class ImportCAChainPanel extends WizardPanelBase { context.put("errorString", ""); context.put("title", "Import CA's Certificate Chain"); context.put("panel", "admin/console/config/importcachainpanel.vm"); + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java index be20a849b..e5852cf59 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/ModulePanel.java @@ -310,9 +310,11 @@ public class ModulePanel extends WizardPanelBase { config.putBoolean("preop.ModulePanel.done", true); } config.commit(false); + context.put("updateStatus", "success"); } catch (Exception e) { CMS.debug("ModulePanel: Exception caught: " + e.toString()); System.err.println("Exception caught: " + e.toString()); + context.put("updateStatus", "failure"); } } diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java index 1ab7c03a4..9e0b3c863 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/NamePanel.java @@ -324,6 +324,7 @@ public class NamePanel extends WizardPanelBase { String dn = HttpInput.getDN(request, cert.getCertTag()); if (dn == null || dn.length() == 0) { + context.put("updateStatus", "validate-failure"); throw new IOException("Empty DN for " + cert.getUserFriendlyName()); } } @@ -728,6 +729,7 @@ public class NamePanel extends WizardPanelBase { if (inputChanged(request)) { mServlet.cleanUpFromPanel(mServlet.getPanelNo(request)); } else if (isPanelDone()) { + context.put("updateStatus", "success"); return; } @@ -756,10 +758,12 @@ public class NamePanel extends WizardPanelBase { } updateCloneConfig(config); CMS.debug("NamePanel: clone configuration done"); + context.put("updateStatus", "success"); return; } } catch (Exception e) { CMS.debug("NamePanel: configCertWithTag failure - " + e); + context.put("updateStatus", "failure"); return; } @@ -870,7 +874,11 @@ public class NamePanel extends WizardPanelBase { config.commit(false); } catch (Exception e) {} - + if (!hasErr) { + context.put("updateStatus", "success"); + } else { + context.put("updateStatus", "failure"); + } CMS.debug("NamePanel: update() done"); } diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java index b84732a94..d9ee171d9 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/RestoreKeyCertPanel.java @@ -180,6 +180,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { s = HttpInput.getPassword(request, "__password"); if (s == null || s.equals("")) { CMS.debug("RestoreKeyCertPanel validate: password is empty"); + context.put("updateStatus", "validate-failure"); throw new IOException("Empty password"); } } @@ -202,6 +203,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { } catch (EBaseException e) { } getConfigEntriesFromMaster(request, response, context); + context.put("updateStatus", "success"); return; } String pwd = HttpInput.getPassword(request, "__password"); @@ -299,6 +301,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { importkeycert(pkeyinfo_collection, cert_collection); } else { + context.put("updateStatus", "failure"); throw new IOException("The pkcs12 file is not correct."); } } @@ -318,6 +321,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { if (!cloneReady) { CMS.debug("RestoreKeyCertPanel update: clone does not have all the certificates."); context.put("errorString", "Make sure you have copied the certificate database over to the clone"); + context.put("updateStatus", "failure"); throw new IOException("Clone is not ready"); } } @@ -329,6 +333,7 @@ public class RestoreKeyCertPanel extends WizardPanelBase { } getConfigEntriesFromMaster(request, response, context); + context.put("updateStatus", "success"); } private void getConfigEntriesFromMaster(HttpServletRequest request, diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SavePKCS12Panel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SavePKCS12Panel.java index 84ddd2e7c..f336cd84c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SavePKCS12Panel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SavePKCS12Panel.java @@ -143,6 +143,7 @@ public class SavePKCS12Panel extends WizardPanelBase { Context context) throws IOException { context.put("title", "Save Keys and Certificates"); context.put("panel", "admin/console/config/savepkcs12panel.vm"); + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SecurityDomainPanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SecurityDomainPanel.java index bfe1a1e46..6abdd8618 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SecurityDomainPanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SecurityDomainPanel.java @@ -243,6 +243,7 @@ public class SecurityDomainPanel extends WizardPanelBase { String name = HttpInput.getSecurityDomainName(request, "sdomainName"); if (name == null || name.equals("")) { initParams(request, context); + context.put("updateStatus", "validate-failure"); throw new IOException("Missing name value for the security domain"); } } else if (select.equals("existingdomain")) { @@ -251,6 +252,7 @@ public class SecurityDomainPanel extends WizardPanelBase { String admin_url = HttpInput.getURL( request, "sdomainURL" ); if( admin_url == null || admin_url.equals("") ) { initParams( request, context ); + context.put("updateStatus", "validate-failure"); throw new IOException( "Missing SSL Admin HTTPS url value " + "for the security domain" ); } else { @@ -268,6 +270,7 @@ public class SecurityDomainPanel extends WizardPanelBase { } catch( Exception e ) { CMS.debug( "SecurityDomainPanel: exception caught: " + e.toString() ); + context.put("updateStatus", "validate-failure"); throw new IOException( "Illegal SSL Admin HTTPS url value " + "for the security domain" ); } @@ -325,6 +328,7 @@ public class SecurityDomainPanel extends WizardPanelBase { if (select == null) { CMS.debug("SecurityDomainPanel: choice not found"); + context.put("updateStatus", "failure"); throw new IOException("choice not found"); } IConfigStore config = CMS.getConfigStore(); @@ -383,6 +387,7 @@ public class SecurityDomainPanel extends WizardPanelBase { admin_port = admin_u.getPort(); } catch( MalformedURLException e ) { errorString = "Malformed SSL Admin HTTPS URL"; + context.put("updateStatus", "failure"); throw new IOException( errorString ); } @@ -402,6 +407,7 @@ public class SecurityDomainPanel extends WizardPanelBase { } else { CMS.debug("SecurityDomainPanel: invalid choice " + select); errorString = "Invalid choice"; + context.put("updateStatus", "failure"); throw new IOException("invalid choice " + select); } @@ -418,6 +424,7 @@ public class SecurityDomainPanel extends WizardPanelBase { } catch (EBaseException e) {} context.put("errorString", errorString); + context.put("updateStatus", "success"); } /** diff --git a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java index 4384936c0..48601629c 100644 --- a/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java +++ b/pki/base/common/src/com/netscape/cms/servlet/csadmin/SizePanel.java @@ -386,13 +386,16 @@ public class SizePanel extends WizardPanelBase { if (hasChanged || (val1 != null && !val1.equals(""))) { mServlet.cleanUpFromPanel(mServlet.getPanelNo(request)); } else if (isPanelDone()) { + context.put("updateStatus", "success"); return; } } catch (IOException e) { CMS.debug("SizePanel: update() IOException caught: " + e.toString()); + context.put("updateStatus", "failure"); throw e; } catch (NumberFormatException e) { CMS.debug("SizePanel: update() NumberFormatException caught: " + e.toString()); + context.put("updateStatus", "failure"); throw e; } catch (Exception e) { CMS.debug("SizePanel: update() Exception caught: " + e.toString()); @@ -433,6 +436,7 @@ public class SizePanel extends WizardPanelBase { } catch (Exception e) { CMS.debug(e); CMS.debug("SizePanel: key generation failure: " + e.toString()); + context.put("updateStatus", "failure"); throw new IOException("key generation failure for the certificate: " + friendlyName + ". See the logs for details."); } @@ -449,6 +453,7 @@ public class SizePanel extends WizardPanelBase { } } CMS.debug("SizePanel: update() done"); + context.put("updateStatus", "success"); } |