Forráskód Böngészése

minor newuser reg, configupload bugs

jrivard 10 éve
szülő
commit
85b538ac72

+ 2 - 1
pwm/servlet/src/password/pwm/PwmConstants.java

@@ -135,11 +135,12 @@ public abstract class PwmConstants {
         CompleteText,
         AvailableAuthMethods,
         ConfigurationSummaryOutput,
+        PageTitle,
 
         FormConfiguration,
         FormReadOnly,
         FormShowPasswordFields,
-        FormData,
+        FormData, ConfigFilename, ConfigLastModified, ConfigHasPassword,
     }
 
 

+ 4 - 0
pwm/servlet/src/password/pwm/config/PwmSetting.xml

@@ -3625,6 +3625,10 @@
         <default>
             <value>100000</value>
         </default>
+        <options>
+            <option value="min">1</option>
+            <option value="max">100000000</option>
+        </options>
     </setting>
     <setting key="reporting.job.timeOffset" level="2">
         <label>Reporting Job Time Offset</label>

+ 13 - 0
pwm/servlet/src/password/pwm/http/servlet/ConfigManagerServlet.java

@@ -39,6 +39,8 @@ import password.pwm.http.PwmRequest;
 import password.pwm.http.PwmResponse;
 import password.pwm.http.PwmSession;
 import password.pwm.http.bean.ConfigManagerBean;
+import password.pwm.i18n.Config;
+import password.pwm.i18n.LocaleHelper;
 import password.pwm.i18n.Message;
 import password.pwm.ldap.auth.AuthenticationType;
 import password.pwm.util.*;
@@ -153,9 +155,20 @@ public class ConfigManagerServlet extends PwmServlet {
             return;
         }
 
+        initRequestAttributes(pwmRequest);
         pwmRequest.forwardToJsp(PwmConstants.JSP_URL.CONFIG_MANAGER_MODE_CONFIGURATION);
     }
 
+    void initRequestAttributes(final PwmRequest pwmRequest)
+            throws PwmUnrecoverableException
+    {
+        final ConfigurationReader configurationReader = pwmRequest.getContextManager().getConfigReader();
+        pwmRequest.setAttribute(PwmConstants.REQUEST_ATTR.PageTitle,LocaleHelper.getLocalizedMessage(Config.Title_ConfigManager, pwmRequest));
+        pwmRequest.setAttribute(PwmConstants.REQUEST_ATTR.ConfigFilename, configurationReader.getConfigFile().getAbsolutePath());
+        pwmRequest.setAttribute(PwmConstants.REQUEST_ATTR.ConfigLastModified, PwmConstants.DEFAULT_DATETIME_FORMAT.format(configurationReader.getStoredConfiguration().modifyTime()));
+        pwmRequest.setAttribute(PwmConstants.REQUEST_ATTR.ConfigHasPassword, LocaleHelper.booleanString(configurationReader.getStoredConfiguration().hasPassword(),pwmRequest.getLocale(),pwmRequest.getConfig()));
+    }
+
     void restUploadLocalDB(final PwmRequest pwmRequest)
             throws IOException, ServletException, PwmUnrecoverableException
 

+ 8 - 7
pwm/servlet/src/password/pwm/http/servlet/NewUserServlet.java

@@ -437,9 +437,8 @@ public class NewUserServlet extends PwmServlet {
     private void handleProcessFormRequest(final PwmRequest pwmRequest, final NewUserBean newUserBean)
             throws PwmUnrecoverableException, ChaiUnavailableException, IOException, ServletException
     {
-        final PwmSession pwmSession = pwmRequest.getPwmSession();
-
-        pwmSession.clearSessionBean(NewUserBean.class);
+        newUserBean.setFormPassed(false);
+        newUserBean.setNewUserForm(null);
 
         try {
             NewUserBean.NewUserForm newUserForm = NewUserFormUtils.readFromRequest(pwmRequest);
@@ -600,7 +599,7 @@ public class NewUserServlet extends PwmServlet {
         sessionAuthenticator.authenticateUser(userIdentity, userPassword);
 
         {  // execute configured actions
-            final List<ActionConfiguration> actions = pwmApplication.getConfig().readSettingAsAction(
+            final List<ActionConfiguration> actions = newUserProfile.readSettingAsAction(
                     PwmSetting.NEWUSER_WRITE_ATTRIBUTES);
             if (actions != null && !actions.isEmpty()) {
                 LOGGER.debug(pwmSession, "executing configured actions to user " + theUser.getEntryDN());
@@ -623,7 +622,7 @@ public class NewUserServlet extends PwmServlet {
         // increment the new user creation statistics
         pwmApplication.getStatisticsManager().incrementValue(Statistic.NEW_USERS);
 
-        LOGGER.debug(pwmSession, "beginning createUser process for " + newUserDN + " (" + TimeDuration.fromCurrent(
+        LOGGER.debug(pwmSession, "completed createUser process for " + newUserDN + " (" + TimeDuration.fromCurrent(
                 startTime).asCompactString() + ")");
     }
 
@@ -884,7 +883,8 @@ public class NewUserServlet extends PwmServlet {
             return;
         }
 
-        final long minWaitTime = pwmRequest.getConfig().readSettingAsLong(PwmSetting.NEWUSER_MINIMUM_WAIT_TIME) * 1000L;
+        final NewUserProfile newUserProfile = NewUserServlet.getNewUserProfile(pwmRequest);
+        final long minWaitTime = newUserProfile.readSettingAsLong(PwmSetting.NEWUSER_MINIMUM_WAIT_TIME) * 1000L;
         final Date completeTime = new Date(startTime.getTime() + minWaitTime);
 
         final BigDecimal percentComplete;
@@ -923,7 +923,8 @@ public class NewUserServlet extends PwmServlet {
             return;
         }
 
-        final long minWaitTime = pwmRequest.getConfig().readSettingAsLong(PwmSetting.NEWUSER_MINIMUM_WAIT_TIME) * 1000L;
+        final NewUserProfile newUserProfile = NewUserServlet.getNewUserProfile(pwmRequest);
+        final long minWaitTime = newUserProfile.readSettingAsLong(PwmSetting.NEWUSER_MINIMUM_WAIT_TIME) * 1000L;
         final Date completeTime = new Date(startTime.getTime() + minWaitTime);
 
         // be sure minimum wait time has passed

+ 10 - 1
pwm/servlet/src/password/pwm/i18n/Config.properties

@@ -55,7 +55,7 @@ MenuDisplay_DownloadConfig=Download the current configuration XML file.
 MenuDisplay_DownloadConfigRunning=Download the in memory configuration to a file.  You can save the <em>%1%</em> file to the <em>WEB-INF</em> directory to change the configuration.  In most cases, the configuration will take effect immediately.
 MenuDisplay_DownloadBundle=Generate a support ZIP file that contains information useful for troubleshooting.
 MenuDisplay_LockConfig=Close the configuration. Once closed, you must be logged in with administrative access to edit the configuration, or you can edit the configuration file directly at <em>%1%</em>.
-MenuDisplay_UnlockConfig=For security reasons, the configuration can not be opened through a web browser.  The configuration can be opened in either of the following ways: <ol><li>Edit the configuration with a text editor<ol><li>Use a UTF8 encoding compatible text editor (do not use Windows Notepad)</li><li>Open the file at <i>%1%</i></li><li>Locate the property <i>configIsEditable</i></li><li>Change the value to "true"</li></ol><li>Use the command line tool</li><ol><li>Open a command prompt and change to <i>%2%</i> directory</li><li>Execute the <i>command.sh</i> or <i>command.bat</i> script as appropriate to your operating system.</li><li>Execute the script using the <i>ConfigUnlock</i> parameter.  Example: <i>./command.sh ConfigUnlock</i></li></ol></ol>
+MenuDisplay_UnlockConfig=For security reasons, the configuration can not be opened through a web browser.  The configuration can be opened in either of the following ways: <ol><li>Edit the configuration with a text editor<ol><li>Use a UTF8 encoding compatible text editor (do not use Windows Notepad)</li><li>Open the file at <i>%1%</i></li><li>Locate the property <i>configIsEditable</i></li><li>Change the value to "true"</li></ol><li>In the same directory as the config file, </li><ol><li>Open a command prompt and change to <i>%2%</i> directory</li><li>Execute the <i>command.sh</i> or <i>command.bat</i> script as appropriate to your operating system.</li><li>Execute the script using the <i>ConfigUnlock</i> parameter.  Example: <i>./command.sh ConfigUnlock</i></li></ol></ol>
 MenuDisplay_ExportLocalDB=Export the contents of the LocalDB.  Can be used for backup or to restore to another server.
 MenuDisplay_MainMenu=Return to the main menu to test the configuration.
 MenuDisplay_ManualConfig=Skip the configuration guide and manually configure the application.
@@ -111,3 +111,12 @@ Tooltip_HelpButton=Show description for this setting.
 Tooltip_Setting_Permission_Profile=Specify which of the defined LDAP profiles to use for the associated filter.  If <i>all</i>, all profiles will be checked for the associated filter.  If <i>default</i>, than only the default LDAP Profile will be checked for the associated search filter.
 Tooltip_Setting_Permission_Filter=A valid LDAP search filter.
 Tooltip_Setting_Permission_Base=An optional LDAP Base DN for the search.  If supplied, only users under this LDAP Base DN will be considered a match.
+Tooltip_FormOptions_Description=Detailed description of this form item, including any special instructions.
+Tooltip_FormOptions_Required=Marks the field as required.  The user must supply a value before being able to complete the form.
+Tooltip_FormOptions_Confirm=Adds a duplicate field to the form and requires the value be the same for the original and confirmation field.
+Tooltip_FormOptions_ReadOnly=Make the field unmodifiable.
+Tooltip_FormOptions_Unique=Indicate that the field value must be unique in the directory before proceeding.
+Tooltip_FormOptions_Regex=Apply a <i>regular expression</i> pattern to the value.  The value must match the pattern before the form is completed.  This pattern can be used to constrain the permitted syntax of the value.
+Tooltip_FormOptions_RegexError=Error message to show when the regular expression pattern is not matched.
+Tooltip_FormOptions_Placeholder=Placeholder text to display in the form field with the field is not populated with a value.
+Tooltip_FormOptions_Javascript=Javascript to be added to the browser.

+ 1 - 1
pwm/servlet/src/password/pwm/util/localdb/LocalDBUtility.java

@@ -221,7 +221,7 @@ public class LocalDBUtility {
 
         Reader csvReader = null;
         try {
-            csvReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream),PwmConstants.DEFAULT_CHARSET));
+            csvReader = new InputStreamReader(new GZIPInputStream(inputStream),PwmConstants.DEFAULT_CHARSET);
             for (final CSVRecord record : PwmConstants.DEFAULT_CSV_FORMAT.parse(csvReader)) {
                 importLineCounter++;
                 final LocalDB.DB db = LocalDB.DB.valueOf(record.get(0));

+ 1 - 1
pwm/servlet/src/password/pwm/util/operations/PasswordUtility.java

@@ -813,7 +813,7 @@ public class PasswordUtility {
                     final PasswordData oldPassword = loginInfoBean == null ? null : loginInfoBean.getUserCurrentPassword();
                     pwmPasswordRuleValidator.testPassword(password, oldPassword, userInfoBean, user);
                     pass = true;
-                    if (cacheService != null) {
+                    if (cacheService != null && cacheKey != null) {
                         cacheService.put(cacheKey, cachePolicy, NEGATIVE_CACHE_HIT);
                     }
                 }

+ 12 - 37
pwm/servlet/web/WEB-INF/jsp/configmanager.jsp

@@ -1,9 +1,4 @@
-<%@ page import="password.pwm.config.ConfigurationReader" %>
-<%@ page import="password.pwm.http.JspUtility" %>
-<%@ page import="password.pwm.i18n.LocaleHelper" %>
 <%@ page import="password.pwm.util.StringUtil" %>
-<%@ page import="java.io.File" %>
-<%@ page import="java.util.Date" %>
 <%--
   ~ Password Management Servlets (PWM)
   ~ http://code.google.com/p/pwm/
@@ -32,21 +27,7 @@
          contentType="text/html; charset=UTF-8" %>
 <%@ taglib uri="pwm" prefix="pwm" %>
 <%
-    final PwmRequest pwmRequest = PwmRequest.forRequest(request,response);
-    String configFileName = PwmConstants.DEFAULT_CONFIG_FILE_FILENAME;
-    String configFilePath = "<application path>/WEB-INF";
-    String pageTitle = LocaleHelper.getLocalizedMessage("Title_ConfigManager",pwmRequest.getConfig(),password.pwm.i18n.Config.class);
-    Date lastModified = null;
-    boolean hasPassword = false;
-
-    try {
-        final ConfigurationReader configurationReader = pwmRequest.getContextManager().getConfigReader();
-        lastModified = configurationReader.getStoredConfiguration().modifyTime();
-        configurationReader.getStoredConfiguration().hasPassword();
-        final File file = configurationReader.getConfigFile();
-        configFileName = file.getAbsolutePath();
-        configFilePath = file.getParentFile().getAbsolutePath();
-    } catch (Exception e) { /* */ }
+    final PwmRequest pwmRequest = JspUtility.getPwmRequest(pageContext);
 %>
 <% JspUtility.setFlag(pageContext, PwmRequest.Flag.HIDE_HEADER_WARNINGS); %>
 <html dir="<pwm:LocaleOrientation/>">
@@ -54,19 +35,10 @@
 <body class="nihilo">
 <div id="wrapper">
     <jsp:include page="fragment/header-body.jsp">
-        <jsp:param name="pwm.PageName" value="<%=pageTitle%>"/>
+        <jsp:param name="pwm.PageName" value="<%=JspUtility.getAttribute(pageContext,PwmConstants.REQUEST_ATTR.PageTitle)%>"/>
     </jsp:include>
     <div id="centerbody">
         <%@ include file="/WEB-INF/jsp/fragment/message.jsp" %>
-        <pwm:script>
-            <script type="text/javascript">
-                PWM_GLOBAL['startupFunctions'].push(function(){
-                    require(["dojo/domReady!"],function(){
-                        PWM_ADMIN.showAppHealth('healthBody', {showRefresh: true, showTimestamp: true});
-                    });
-                });
-            </script>
-        </pwm:script>
         <style>
             .buttoncell {
                 border: 0;
@@ -102,10 +74,11 @@
                     Last Modified
                 </td>
                 <td>
+                    <% String lastModified = (String)JspUtility.getAttribute(pageContext, PwmConstants.REQUEST_ATTR.ConfigLastModified); %>
                     <% if (lastModified == null) { %>
                     <pwm:display key="Value_NotApplicable"/>
                     <% } else { %>
-                    <span class="timestamp"><%= PwmConstants.DEFAULT_DATETIME_FORMAT.format(lastModified)%></span>
+                    <span class="timestamp"><%=lastModified%></span>
                     <% } %>
                 </td>
             </tr>
@@ -114,7 +87,7 @@
                     Password Protected
                 </td>
                 <td>
-                    <%if (hasPassword) {%><pwm:display key="Value_True"/><% } else { %><pwm:display key="Value_False"/><% } %>
+                    <%=JspUtility.getAttribute(pageContext, PwmConstants.REQUEST_ATTR.ConfigHasPassword)%>
                 </td>
             </tr>
             <tr>
@@ -123,7 +96,7 @@
                 </td>
                 <td>
                     <div style="max-width:398px; overflow-x: auto; white-space: nowrap">
-                        <%=StringUtil.escapeHtml(configFileName)%>
+                        <%=StringUtil.escapeHtml((String) JspUtility.getAttribute(pageContext, PwmConstants.REQUEST_ATTR.ConfigFilename))%>
                     </div>
                 </td>
             </tr>
@@ -204,7 +177,7 @@
                         <pwm:script>
                             <script type="application/javascript">
                                 PWM_GLOBAL['startupFunctions'].push(function(){
-                                    makeTooltip('MenuItem_LockConfig',PWM_CONFIG.showString('MenuDisplay_LockConfig',{value1:'<%=configFileName%>'}));
+                                    makeTooltip('MenuItem_LockConfig',PWM_CONFIG.showString('MenuDisplay_LockConfig',{value1:'<%=StringUtil.escapeJS((String)JspUtility.getAttribute(pageContext, PwmConstants.REQUEST_ATTR.ConfigFilename))%>'}));
                                     PWM_MAIN.addEventHandler('MenuItem_LockConfig','click',function(){
                                         PWM_CONFIG.lockConfiguration();
                                     });
@@ -225,8 +198,7 @@
                                             title:'Alert',
                                             width:500,
                                             text:PWM_CONFIG.showString('MenuDisplay_UnlockConfig',{
-                                                value1:'<%=StringUtil.escapeJS(configFileName)%>',
-                                                value2:'<%=StringUtil.escapeJS(configFilePath)%>'
+                                                value1:'<%=StringUtil.escapeJS((String)JspUtility.getAttribute(pageContext,PwmConstants.REQUEST_ATTR.ConfigFilename))%>'
                                             })
                                         });
                                     });
@@ -353,6 +325,10 @@
                 dojoParser.parse();
             });
             PWM_VAR['config_localDBLogLevel'] = '<%=pwmRequest.getConfig().getEventLogLocalDBLevel()%>'
+
+            require(["dojo/domReady!"],function(){
+                PWM_ADMIN.showAppHealth('healthBody', {showRefresh: true, showTimestamp: true});
+            });
         });
 
         function makeTooltip(id,text) {
@@ -376,7 +352,6 @@
 </pwm:script>
 <script nonce="<pwm:value name="cspNonce"/>" type="text/javascript" src="<pwm:context/><pwm:url url="/public/resources/js/configmanager.js"/>"></script>
 <script nonce="<pwm:value name="cspNonce"/>" type="text/javascript" src="<pwm:context/><pwm:url url="/public/resources/js/admin.js"/>"></script>
-<% password.pwm.http.JspUtility.setFlag(pageContext, PwmRequest.Flag.HIDE_LOCALE); %>
 <div><%@ include file="fragment/footer.jsp" %></div>
 </body>
 </html>

+ 3 - 3
pwm/servlet/web/WEB-INF/jsp/newuser-wait.jsp

@@ -1,11 +1,11 @@
 <%@ page import="password.pwm.error.PwmException" %>
-<%@ page import="password.pwm.http.JspUtility" %>
+<%@ page import="password.pwm.http.servlet.NewUserServlet" %>
 <%--
   ~ Password Management Servlets (PWM)
   ~ http://code.google.com/p/pwm/
   ~
   ~ Copyright (c) 2006-2009 Novell, Inc.
-  ~ Copyright (c) 2009-2014 The PWM Project
+  ~ Copyright (c) 2009-2015 The PWM Project
   ~
   ~ This program is free software; you can redistribute it and/or modify
   ~ it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
     long checkIntervalSeconds = 5;
     try {
         final PwmRequest pwmRequest = PwmRequest.forRequest(request, response);
-        refreshSeconds = 30 * pwmRequest.getConfig().readSettingAsLong(PwmSetting.NEWUSER_MINIMUM_WAIT_TIME);
+        refreshSeconds = 30 * NewUserServlet.getNewUserProfile(pwmRequest).readSettingAsLong(PwmSetting.NEWUSER_MINIMUM_WAIT_TIME);
         checkIntervalSeconds = Long.parseLong(pwmRequest.getConfig().readAppProperty(AppProperty.CLIENT_AJAX_PW_WAIT_CHECK_SECONDS));
     } catch (PwmException e) {
         /* noop */

+ 4 - 3
pwm/servlet/web/public/resources/configStyle.css

@@ -430,10 +430,11 @@ table {
 }
 
 .editorIdleStatus {
-    margin: 0 auto;
+    margin-left: 40%;
+    margin-right: 40%;
     position: absolute;
     top: 0;
     text-align: center;
-    width: 100%;
-    font-size: 10px
+    font-size: 10px;
+    width:20%;
 }

+ 16 - 23
pwm/servlet/web/public/resources/js/configeditor-settings.js

@@ -591,22 +591,15 @@ FormTableHandler.redraw = function(keyName) {
         FormTableHandler.drawRow(parentDiv, keyName, i, resultValue[i]);
     }
 
-    var newTableRow = document.createElement("tr");
-    newTableRow.setAttribute("style", "border-width: 0");
-    newTableRow.setAttribute("colspan", "5");
+    var buttonRow = document.createElement("tr");
+    buttonRow.setAttribute("colspan","5");
+    buttonRow.innerHTML = '<td><button class="btn" id="button-' + keyName + '-addRow"><span class="btn-icon fa fa-plus-square"></span>Add Form Item</button></td>';
 
-    var newTableData = document.createElement("td");
-    newTableData.setAttribute("style", "border-width: 0;");
-
-    var addItemButton = document.createElement("button");
-    addItemButton.setAttribute("type", "button");
-    addItemButton.setAttribute("class", "btn");
-    addItemButton.setAttribute("onclick", "FormTableHandler.addMultiSetting('" + keyName + "','" + parentDiv + "');");
-    addItemButton.innerHTML = '<span class="btn-icon fa fa-plus-square"></span>Add Form Item';
-    newTableData.appendChild(addItemButton);
+    parentDivElement.appendChild(buttonRow);
 
-    newTableRow.appendChild(newTableData);
-    parentDivElement.appendChild(newTableRow);
+    PWM_MAIN.addEventHandler('button-' + keyName + '-addRow','click',function(){
+        FormTableHandler.addRow(keyName);
+    });
 
 };
 
@@ -810,39 +803,39 @@ FormTableHandler.showOptionsDialog = function(keyName, iteration) {
         var initDialogWidgets = function() {
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-description',
-                text: 'Detailed description of this form item, including any special instructions.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Description')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-required',
-                text: 'Marks the field as required.  The user must supply a value before being able to complete the form.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Required')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-confirm',
-                text: 'Adds a duplicate field to the form and requires the value be the same for the original and confirmation field.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Confirm')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-readOnly',
-                text: 'Make the field unmodifiable.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_ReadOnly')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-unique',
-                text: 'Indicate that the field value must be unique in the directory before proceeding.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Unique')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-regex',
-                text: 'Apply a <i>regular expression</i> pattern to the value.  The value must match the pattern before the form is completed.  This pattern can be used to constrain the permitted syntax of the value.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Regex')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-regexError',
-                text: 'Error message to show when the regular expression pattern is not matched.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_RegexError')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-placeholder',
-                text: 'Placeholder text to display in the form field with the field is not populated with a value.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Placeholder')
             });
             PWM_MAIN.showTooltip({
                 id: inputID + '-label-js',
-                text: 'Javascript to be added to the browser.'
+                text: PWM_CONFIG.showString('Tooltip_FormOptions_Javascript')
             });
 
             PWM_MAIN.addEventHandler(inputID + 'editOptionsButton', 'click', function(){

+ 31 - 150
pwm/servlet/web/public/resources/js/configmanager.js

@@ -106,154 +106,32 @@ PWM_CONFIG.startConfigurationEditor=function() {
 
 
 PWM_CONFIG.uploadConfigDialog=function() {
-    var body = '<div id="uploadFormWrapper"><form action="ConfigGuide" enctype="multipart/form-data">';
-    body += '<div id="fileList"></div>';
-    body += '<input name="uploadFile" type="file" label="Select File" id="uploadFile"/>';
-    body += '<input type="submit" id="uploadButton" name="Upload"/>';
-    body += '</form></div>';
-
-    var uploadUrl = window.location.pathname + '?processAction=uploadConfig&pwmFormID=' + PWM_GLOBAL['pwmFormID'];
-
-    require(["dojo","dijit/Dialog","dojox/form/Uploader","dojox/form/uploader/FileList","dijit/form/Button","dojox/form/uploader/plugins/HTML5"],function(
-        dojo,Dialog,Uploader,FileList,Button){
-
-        if(dojo.isIE <= 9){ // IE9 and below no workie
-            PWM_MAIN.showDialog({title:PWM_MAIN.showString("Title_Error"),text:PWM_CONFIG.showString("Warning_UploadIE9")});
-            return;
-        }
-
-        PWM_MAIN.showWaitDialog({loadFunction:function() {
-            console.log('uploading config file to url ' + uploadUrl);
-            PWM_MAIN.closeWaitDialog();
-            var idName = 'dialogPopup';
-            PWM_MAIN.clearDijitWidget(idName);
-            var theDialog = new Dialog({
-                id: idName,
-                title: 'Upload Configuration',
-                style: "width: 300px",
-                content: body
-            });
-            theDialog.show();
-            var fileMask = [
-                ["XML File", "*.xml"],
-                ["TXT File", "*.txt"]
-            ];
-            var uploader = new dojox.form.Uploader({
-                multiple: false,
-                name: "uploadFile",
-                label: 'Select File',
-                required: true,
-                fileMask: fileMask,
-                preventCache: true,
-                url: uploadUrl,
-                isDebug: true,
-                devMode: true
-            }, 'uploadFile');
-            uploader.startup();
-            var uploadButton = new Button({
-                label: 'Upload',
-                type: 'submit'
-            }, "uploadButton");
-            uploadButton.startup();
-            new FileList({
-                uploaderId: 'uploadFile'
-            }, "fileList");
-            dojo.connect(uploader, "onComplete", function (data) {
-                if (data['error'] == true) {
-                    PWM_MAIN.showDialog({title: PWM_MAIN.showString("Title_Error"), text: data['errorDetail']});
-                } else {
-                    PWM_MAIN.closeWaitDialog();
-                    PWM_MAIN.clearDijitWidget(idName);
-                    PWM_CONFIG.waitForRestart();
-                }
-            });
+    var uploadOptions = {};
+    uploadOptions['url'] = window.location.pathname + '?processAction=uploadConfig';
+    uploadOptions['title'] = 'Upload Configuration';
+    uploadOptions['nextFunction'] = function() {
+        PWM_MAIN.showWaitDialog({title:'Save complete, restarting application...',loadFunction:function(){
+            PWM_CONFIG.waitForRestart({location:'/'});
         }});
-    });
+    };
+    PWM_CONFIG.uploadFile(uploadOptions);
 };
 
 PWM_CONFIG.uploadLocalDB=function() {
-    var body = '<div id="uploadFormWrapper"><form action="ConfigGuide" enctype="multipart/form-data">';
-    body += '<div id="fileList"></div>';
-    body += '<input name="uploadFile" type="file" label="Select File" id="uploadFile"/>';
-    body += '<input type="submit" id="uploadButton" name="Upload"/>';
-    body += '</form></div><br/>';
-
-    var uploadUrl = window.location.pathname + '?processAction=importLocalDB&pwmFormID=' + PWM_GLOBAL['pwmFormID'];
-
-    PWM_MAIN.showConfirmDialog({text:PWM_CONFIG.showString('Confirm_UploadLocalDB'),okAction:function(){
-        PWM_MAIN.preloadAll(function(){
-            require(["dojo","dijit/Dialog","dojox/form/Uploader","dojox/form/uploader/FileList","dijit/form/Button","dojox/form/uploader/plugins/HTML5"],function(
-                dojo,Dialog,Uploader,FileList,Button){
-
-                if(dojo.isIE <= 9){ // IE9 and below no workie
-                    PWM_MAIN.showDialog({title:PWM_MAIN.showString("Title_Error"),text:PWM_CONFIG.showString("Warning_UploadIE9")});
-                    return;
-                }
-
-                PWM_MAIN.showWaitDialog({loadFunction:function() {
-                    console.log('uploading localdb file to url ' + uploadUrl);
-
-                    PWM_MAIN.closeWaitDialog();
-                    var idName = 'dialogPopup';
-                    PWM_MAIN.clearDijitWidget(idName);
-                    var theDialog = new Dialog({
-                        id: idName,
-                        title: 'Upload LocalDB Archive',
-                        style: "width: 300px",
-                        content: body
-                    });
-                    theDialog.show();
-                    var uploader = new dojox.form.Uploader({
-                        multiple: false,
-                        name: "uploadFile",
-                        label: 'Select File',
-                        required: true,
-                        url: uploadUrl,
-                        isDebug: true,
-                        devMode: true,
-                        preventCache: true
-                    }, 'uploadFile');
-                    uploader.startup();
-                    var uploadButton = new Button({
-                        label: 'Upload',
-                        type: 'submit'
-                    }, "uploadButton");
-                    uploadButton.startup();
-                    new FileList({
-                        uploaderId: 'uploadFile'
-                    }, "fileList");
-                    dojo.connect(uploader, "onComplete", function (data) {
-                        if (data['error'] == true) {
-                            PWM_MAIN.showDialog({title: PWM_MAIN.showString("Title_Error"), text: data['errorMessage'] + '  '  + data['errorDetail'],okAction:function(){
-                                PWM_MAIN.goto('/private/config/ConfigManager');
-                            }});
-                        } else {
-                            PWM_MAIN.closeWaitDialog();
-                            PWM_MAIN.clearDijitWidget(idName);
-                            PWM_CONFIG.waitForRestart();
-                        }
-                    });
-                    dojo.connect(uploader, "onBegin", function () {
-                        PWM_GLOBAL['inhibitHealthUpdate'] = true;
-                        PWM_GLOBAL['idle_suspendTimeout'] = true;
-                        PWM_MAIN.getObject('centerbody').style.display = 'none';
-
-                        PWM_MAIN.showWaitDialog({title:"Importing LocalDB Archive File..."});
-                    });
-                    dojo.connect(uploader, "onProgress", function (data) {
-                        var decimal = data['decimal'];
-                        require(["dijit/registry"],function(registry){
-                            var progressBar = registry.byId('progressBar');
-                            progressBar.set("maximum",100);
-                            progressBar.set("indeterminate",false);
-                            progressBar.set("value", decimal * 100);
-                        });
-                    });
+    PWM_MAIN.showConfirmDialog({
+        text:PWM_CONFIG.showString('Confirm_UploadLocalDB'),
+        okAction:function(){
+            var uploadOptions = {};
+            uploadOptions['url'] = 'ConfigManager?processAction=importLocalDB';
+            uploadOptions['title'] = 'Upload and Import LocalDB Archive';
+            uploadOptions['nextFunction'] = function() {
+                PWM_MAIN.showWaitDialog({title:'Save complete, restarting application...',loadFunction:function(){
+                    PWM_CONFIG.waitForRestart({location:'/'});
                 }});
-            });
-        });
-    }});
-
+            };
+            PWM_CONFIG.uploadFile(uploadOptions);
+        }
+    });
 };
 
 
@@ -369,26 +247,29 @@ PWM_CONFIG.uploadFile = function(options) {
     body += '<div id="fileList"></div>';
     body += '<input name="uploadFile" type="file" label="Select File" id="uploadFile"/>';
     body += '<input type="submit" id="uploadButton" name="Upload"/>';
-    body += '<br/></form></div><br/>';
+    body += '<br/></form></div><br/><br/>';
 
     var currentUrl = window.location.pathname;
     var uploadUrl = 'url' in options ? options['url'] : currentUrl;
+    var title = 'title' in options ? options['title'] : 'Upload File';
+
     uploadUrl = PWM_MAIN.addPwmFormIDtoURL(uploadUrl);
 
-    var nextFunction = 'nextFunction' in options ? options['nextFunction'] : function(){PWM_MAIN.goto(currentUrl)};
+    var nextFunction = 'nextFunction' in options ? options['nextFunction'] : function(data){
+        PWM_MAIN.showDialog({title: PWM_MAIN.showString("Title_Success"), text: data['successMessage'],okAction:function(){
+            PWM_MAIN.goto(currentUrl)
+        }});
+    };
 
-    var title = 'title' in options ? options['title'] : 'Upload File';
 
     var completeFunction = function(data){
         if (data['error'] == true) {
             var errorText = 'The file upload has failed.  Please try again or check the server logs for error information.';
             PWM_MAIN.showErrorDialog(data,{text:errorText,okAction:function(){
-                nextFunction();
+                location.reload();
             }});
         } else {
-            PWM_MAIN.showDialog({title: PWM_MAIN.showString("Title_Success"), text: data['successMessage'],okAction:function(){
-                nextFunction();
-            }});
+            nextFunction(data);
         }
     };