bug 964: New error message if the user declines the dialogue. Also a little
authorMichael Tänzer <neo@nhng.de>
Tue, 24 Jul 2012 23:58:51 +0000 (01:58 +0200)
committerMichael Tänzer <neo@nhng.de>
Tue, 24 Jul 2012 23:58:51 +0000 (01:58 +0200)
bit of clean up

Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/keygen.php
www/keygenIE.js

index 1cb7738..b489640 100644 (file)
@@ -96,6 +96,10 @@ if (array_key_exists('HTTP_USER_AGENT',$_SERVER) &&
                <?=_('Could not generate certificate request. Probably you need to '.
                                'choose a different algorithm.')?>
        </p>
+       <p id="createRequestErrorConfirmDialogue" style="display:none">
+               <?=_('Could not generate certificate request. Please confirm the '.
+                               'dialogue if you are asked if you want to generate the key.')?>
+       </p>
        <p id="createRequestError" style="display:none">
                <?=_('Could not generate certificate request.')?>
        </p>
index e546f62..31baa25 100644 (file)
@@ -65,6 +65,7 @@
        var noActiveX = document.getElementById("noActiveX");
        var generatingKeyNotice = document.getElementById("generatingKeyNotice");
        var createRequestErrorChooseAlgorithm = document.getElementById("createRequestErrorChooseAlgorithm");
+       var createRequestErrorConfirmDialogue = document.getElementById("createRequestErrorConfirmDialogue");
        var createRequestError = document.getElementById("createRequestError");
        var invalidKeySizeError = document.getElementById("invalidKeySizeError");
        var unsupportedPlatformError = document.getElementById("unsupportedPlatformError");
                        }
                        
                        form.style.display = "";
-                       //algorithmParagraph.style.display = "none";
                        algorithm.disabled = true;
                        noActiveX.style.display = "none";
                } catch (e) {
                        if (getStepSigKeyLength()) {
                                keySize.setAttribute("step", getStepSigKeyLength());
                        }
-                       //keySize.setAttribute("value", alg.DefaultLength);
-                       //keySize.value = ""+alg.DefaultLength;
                        
                        // ugly, but buggy otherwise if done with text nodes
                        keySizeMin.innerHTML = getMinSigKeyLength();
                        }
                        
                        return getAlgorithmList();
-                       //return getKeySizeLimits();
                }
                
                
                                        csr.value = cenroll.createPKCS10("", "1.3.6.1.5.5.7.3.2");
                                        form.submit();
                                } catch (e) {
-                                       showError(createRequestError.innerHTML, e);
+                                       if (e.number === -2147023673) {
+                                               showError(createRequestErrorConfirmDialogue.innerHTML, e);
+                                       } else {
+                                               showError(createRequestError.innerHTML, e);
+                                       }
                                }
                                
                                generatingKeyNotice.style.display = "none";
                
                securityLevel.onchange = refreshSecurityLevel;
                provider.onchange = getAlgorithmList;
-               //provider.onchange = getKeySizeLimits;
                algorithm.onchange = getKeySizeLimits;
                genReq.onclick = createCSR;