[Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc AdvancedInfo.js, 1.1, 1.2 ESC.js, 1.2, 1.3 GenericAuth.js, 1.2, 1.3 GenericAuth.xul, 1.1.1.1, 1.2 TRAY.js, 1.2, 1.3 config.xul, 1.2, 1.3 esc.css, 1.2, 1.3 esc.xul, 1.2, 1.3 settings.xul, 1.2, 1.3

Jack Magne (jmagne) fedora-directory-commits at redhat.com
Wed Sep 27 17:31:54 UTC 2006


Author: jmagne

Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27136

Modified Files:
	AdvancedInfo.js ESC.js GenericAuth.js GenericAuth.xul TRAY.js 
	config.xul esc.css esc.xul settings.xul 
Log Message:
Latest updates.


Index: AdvancedInfo.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AdvancedInfo.js	13 Sep 2006 18:01:01 -0000	1.1
+++ AdvancedInfo.js	27 Sep 2006 17:31:51 -0000	1.2
@@ -15,21 +15,21 @@
  * All rights reserved.
  * END COPYRIGHT BLOCK **/
 
+
+var gDiagnosticsDataText="";
+
 function ShowAdvancedInfo()
 {
-    var dump = window.arguments[0];
+    var textDump = window.arguments[0];
 
+    gDiagnosticsData=dump;
+    gDiagnosticsDataText=textDump;
 
-    var frame = window.document.getElementById("advanced-info");
+    var textbox = window.document.getElementById("advanced-info");
 
-    var doco = frame.contentDocument;
-
-    if(doco)
+    if(textbox)
     {
-        doco.open(); 
-        doco.write(dump);
-        doco.close();
-
+        textbox.setAttribute("value",textDump);
     }
 }
 


Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ESC.js	13 Sep 2006 17:56:49 -0000	1.2
+++ ESC.js	27 Sep 2006 17:31:51 -0000	1.3
@@ -32,8 +32,6 @@
 var gHiddenPageDone = 0;
 var gExternalUI = 0;
 
-var gDiagnosticsCopyString=null;
-
 loadStringBundle();
 
 //ESC constants
@@ -46,6 +44,11 @@
 const  ISSUER_TAG        = "IssuerName"; 
 const  SERVICE_INFO_TAG  = "ServiceInfo";
 
+const  UNINITIALIZED        = 1;
+const  UNINITIALIZED_NOAPPLET = 2;
+const  ESC_ENROLL_WIDTH  = 600;
+const  ESC_ENROLL_HEIGHT = 570;
+
 //Window names
 
 const ENROLL_WINDOW      = "esc.xul";
@@ -215,22 +218,33 @@
 
 }
 
+// Main function that oversees obtaining Phone Home Info from the Server
+
 function DoPhoneHome(keyType,keyID)
 {
   var callback = function (aResult) {
 
+    var issuer = "";
     if(aResult == true)
     {
+        issuer = GetCachedIssuer(keyID);       
+        if(!issuer)
+            issuer = getBundleString("unknownIssuer");
+        TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
         UpdateRowWithPhoneHomeData(keyType,keyID);
     }
     else
     {
-        launchCONFIG(keyType,keyID);
+        issuer = getBundleString("unknownIssuer");
+        TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+        //launchCONFIG(keyType,keyID);
     }
   }
 
   if(IsPhoneHomeCached(keyID))
   {
+      issuer = GetCachedIssuer(keyID);
+      TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
       return true;
   }
 
@@ -240,10 +254,10 @@
 
   if(home)
   {
-      homeRes = phoneHome(home,keyID,callback);
+      homeRes =  phoneHome(home,keyID,callback);
   }
 
-  if(!homeRes)
+  if(!home)
   {
       launchCONFIG(keyType,keyID);
   }
@@ -797,69 +811,136 @@
     var arr = GetAvailableCoolKeys();
     var coolkeyVersion = GetCoolKeyVersion();
 
-    var dump = "<html>";
-    dump += "<style> p { font-size: 9pt } </style>";
+    var textDump="";
+
+    textDump +=  getBundleString("diagnosticsReport") + "\n\n";
+
+    textDump += "***" + getBundleString("diagnosticsSystemInfo") + "***" + "\n\n";
+    var agent = getBundleString("diagnosticsSoftVersioInfo") + " " +  navigator.userAgent.toLowerCase() + "\n";
 
-    //dump += "<p><br>" + getBundleString("diagnosticsMessage") + "<br></p>";
+    textDump +=  " " + getBundleString("coolkeyComponentVersion");
+    textDump += " " + coolkeyVersion + "\n";
 
-    dump += "<p><br><b>" +  getBundleString("coolkeyComponentVersion") + "</b>" ;
-    dump += " " + coolkeyVersion ;
 
-    dump +=  "<br><b>" + getBundleString("coolkeyDetectedNumberKeys") + "</b>"; 
-    dump +=  " " +  arr.length + "</p>" ; 
+    textDump += " " + agent + "\n";
+
+    textDump += "***" + getBundleString("diagnosticsDetails") + "***" + "\n\n";
+
+    textDump += "  " +  getBundleString("coolkeyDetectedNumberKeys") + " ";
+
+    textDump +=   arr.length + "\n\n" ;
 
-    dump += "<p>";
     for(i = 0 ; i < arr.length ; i++)
     {
        keyID = arr[i][1];
        keyType = arr[i][0];
 
+       var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
+       var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
+
        var issuer = GetCachedIssuer(keyID);
        if(!issuer)
            issuer = getBundleString("unknownIssuer");
 
+       textDump += "***" + getBundleString("smartCardU") + " " + i + ":" + "***" + "\n\n";
+
+       textDump += "  " + getBundleString("appletVersion") + " " + appletVerMaj + "." + appletVerMin + "\n";
+
+
        var status =  GetStatusForKeyID(keyType, keyID);
 
-       dump += "<b>" + getBundleString("keyID") + "</b>" + " " +  keyID  + "<br>";
-       dump += "<b>" + getBundleString("status") + "</b>" + " " + status + "<br>";
+       textDump += "  " + getBundleString("keyID") + " " + " " +  keyID  + "\n";
+       textDump += "  " + getBundleString("status") + " " + " " + status + "\n";
+       textDump += "  " + getBundleString("issuer") + " " + " " + issuer + "\n";
 
-       dump += "<b>" + getBundleString("issuer") + "</b>" + " " + issuer + "<br>";
        var tpsURI = GetCachedTPSURL(keyID);
        var tpsUI  = GetCachedTPSUI(keyID);
+       var phoneHomeURI = GetCachedPhoneHomeURL(keyID);
+
+       if(!tpsURI)
+           tpsURI="";
+      
+       if(!tpsUI)
+           tpsUI = "";
+
+       if(!phoneHomeURI)
+           phoneHomeURI = ""; 
+
+       textDump += "  " + getBundleString("tpsPhoneHomeURL") + " " + " " + phoneHomeURI + "\n";
+       textDump += "  " + getBundleString("tpsURI") + " " + " " + tpsURI + "\n";
+       textDump += "  " +getBundleString("tpsUI") + " " + " " + tpsUI + "\n";
 
-       dump += "<b>" + getBundleString("tpsURI") + "</b>" + " " + tpsURI + "<br>";
-       dump += "<b>" + getBundleString("tpsUI") + "</b>" + " " + tpsUI + "<br>";
+       textDump += "\n";
+
+       var nicknames  = GetCoolKeyCertNicknames(keyType,keyID);
+       if(nicknames && nicknames.length)
+       {
+        textDump += "  " + getBundleString("certsOnToken")  + " \n\n";
+       }
+
+       if(nicknames)
+       {
+           var cert_info = null;
+           for (i = 0; i < nicknames.length ; i ++)
+           {
+                textDump += "    " + getBundleString("certificateNickname") + " " + nicknames[i] + " \n\n";
+
+                cert_info = GetCoolKeyCertInfo(keyType,keyID,nicknames[i]);
+
+                var cert_split = cert_info.split("\n");
+
+
+                if(cert_split.length)
+                {
+
+                    textDump += "      " + getBundleString("certIssuedTo") + " " + cert_split[0] + "\n";
+
+                    textDump += "      " + getBundleString("certIssuedBy") + " " + cert_split[1] + "\n";
+
+                    textDump += "      " + getBundleString("certValidityFrom") + " " + cert_split[2] + "\n";
+
+                    
+                    textDump += "      " + getBundleString("certValidityTo") + " " + cert_split[3] + "\n";
+
+                    textDump += "      " + getBundleString("certSerialNumber") + " " + cert_split[4] + "\n";
+
+
+                    textDump += "\n";
+                }
+
+           }
+       }
 
     }
 
-    dump += "</p>";
+    if(i <= 0)
+    {
+        textDump += "\n";
+    }
 
     var lines = null;
 
     var lines = ReadESCLog();
 
-    dump += "<hr><b><center>" + getBundleString("escLogEntries") + "</b></center>";
 
-    dump += "<p>";
+    textDump += "***" + getBundleString("escLogEntries") + "***"  + "\n";
+
 
     if(lines)
     {
         for(i = 0 ; i < lines.length ; i++)
         {
-             dump += lines[i] + "<br>";
+             textDump += lines[i] + "\n";
         }
 
     }
     else
     {
-         dump += getBundleString("noLogFileOrData");
-    }
 
-    dump += "</p>";
-
-    dump += "</html>";
+         textDump += getBundleString("noLogFileOrData");
+    }
 
-    var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",dump);
+    var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",textDump);
 
 }
 
@@ -1338,15 +1419,29 @@
      var detected_key_message = document.getElementById("detected-key-message");     
 
      var enroll_key_message = document.getElementById("enroll-key-message");
+
+     if(!enroll_key_message)
+         return;
+
      var unenrolled_key_heading = document.getElementById("unenrolled-key-heading");
 
+     if(!unenrolled_key_heading)
+        return;
+
+
+     var enroll_proceed_message = document.getElementById("enroll-proceed-message");
+
+     if(!enroll_proceed_message)
+        return;
      if(alreadyEnrolled)
      {
          unenrolled_key_heading.setAttribute("value",getBundleString("enrolledDetected"));
+         ChangeDescription(enroll_proceed_message,getBundleString("enrollAnyway"));
+     }
+     else
+     {
+         ChangeDescription(enroll_proceed_message,getBundleString("readyToProceed"));
      }
-
-     if(!unenrolled_key_heading)
-         return;
 
      var no_key_heading = document.getElementById("no-key-heading");
 
@@ -1407,7 +1502,9 @@
                  ShowItem(enroll_area);
                  HideItem(yes_key_area);
                  ShowItem(enroll_key_message);
-                 enrollBtn.setAttribute("oncommand","DoEnrollCoolKey()");
+
+                 enrollBtn.setAttribute("onclick","DoEnrollCoolKey();");
+
                  ShowItem(enrollBtn);
              }
              else
@@ -1420,7 +1517,7 @@
                  HideItem(yes_key_area);
                  HideItem(enroll_key_message);
                  HideItem(enrollBtn);
-                 UpdateESCSize(600,550);
+                 UpdateESCSize(ESC_ENROLL_WIDTH,ESC_ENROLL_HEIGHT);
 
              }
          }
@@ -1432,11 +1529,16 @@
 
              if(alreadyEnrolled)
              {
-                 detected_key_message.setAttribute("value",getBundleString("enrolledDetectedMessage"));
+                 ChangeDescription(detected_key_message,getBundleString("enrolledDetectedMessage"));
+             }
+             else
+             {
+                ChangeDescription(detected_key_message,getBundleString("unenrolledDetectedMessage"));
+
              } 
 
              ShowItem(detected_key_message);
-             enrollBtn.setAttribute("oncommand","DoShowFullEnrollmentUI()");
+             enrollBtn.setAttribute("onclick","DoShowFullEnrollmentUI();");
              ShowItem(enrollBtn);
          }
 
@@ -1502,19 +1604,19 @@
            return;
         }
 
-        if(pwstrength < 20)
+        if(pwstrength < 40)
         {
             qualityImage.setAttribute("src", "2-vweak.png");
             return;
         }
 
-        if(pwstrength >= 20 && pwstrength < 40)
+        if(pwstrength >= 40 && pwstrength < 50)
         {
             qualityImage.setAttribute("src","3-weak.png");
             return;
         }
 
-        if(pwstrength >=40 && pwstrength < 60)
+        if(pwstrength >=50 && pwstrength < 60)
         {
             qualityImage.setAttribute("src","4-fair.png");
             return;
@@ -1580,16 +1682,16 @@
    switch (status) {
        case 7: // PINResetInProgress
 
-           result = "Resetting Key Password..";
+           result = getBundleString("operationPINReset");
        break;
 
        case 5: // EnrollmentInProgress
-            result = "Enrolling Key..";
+            result = getBundleString("operationEnrollment");
 
        break;
 
        case 9: // FormatInProgress
-           result = "Formatting Key..";
+           result = getBundleString("operationFormat");
        break;
    }
 
@@ -1782,11 +1884,16 @@
         InsertCoolKeyIntoAdminBindingList(arr[i][0], arr[i][1]);
 
         if (!gCurrentSelectedRow)
+        {
             SelectRowByKeyID(arr[i][0], arr[i][1]);
+            UpdateAdminKeyDetailsArea(arr[i][0],arr[i][1]);
+        }
     }
 
     if(i > 0)
+    {
         UpdateESCSize();
+    }
 }
 
 function UpdateBindingTableAvailability()
@@ -1812,7 +1919,7 @@
   gEnrollmentPage = 1;
   UpdateCoolKeyAvailabilityForEnrollment();
   UpdateButtonStates();
-  showOrHideEscOnLaunch();
+  //showOrHideEscOnLaunch();
   window.setTimeout("showOrHideTabsUI()",2);
 }
 
@@ -1820,7 +1927,7 @@
 {
   UpdateBindingTableAvailability();
   UpdateButtonStates();
-  showOrHideEscOnLaunch();
+  //showOrHideEscOnLaunch();
 }
 
 function InitializeAdminBindingList()
@@ -1830,8 +1937,8 @@
 
  UpdateAdminBindingListAvailability();
  UpdateButtonStates();
- showOrHideEscOnLaunch();
- showOrHideTabsUI();
+ //showOrHideEscOnLaunch();
+ //showOrHideTabsUI();
 }
 
 //Window related functions
@@ -1844,7 +1951,8 @@
 
   // We do want notify events though
   var doPreserveNotify = true;
- 
+
+  SetMenuItemsText(); 
   TrayRemoveWindow(doPreserveNotify);
 }
 
@@ -1954,12 +2062,27 @@
     return result;
 }
 
-function SelectESCPage(keyUninitialized)
+function SelectESCPage(keyType,keyID,phoneHomeFailed)
 {
 
      if(!gHiddenPage)
        return;
 
+     var keyUninitialized = 0;
+     var keyStatus = GetCoolKeyStatus(keyType,keyID);
+
+     switch (keyStatus) {
+       case 1: //no applet
+           keyUninitialized = UNINITIALIZED_NOAPPLET; 
+       break;
+       case 2: // uninitialized 
+           keyUninitialized = UNINITIALIZED;
+       break;
+       case 4: // Enrolled 
+           keyUninitialized = 0;
+       break;
+   }
+
    //alert("SelectESCPage  initialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage);
 
    //Get the primary page windows if present
@@ -1967,7 +2090,7 @@
    var enrollWnd = IsPageWindowPresent(ENROLL_WINDOW);
    var adminWnd  = IsPageWindowPresent(ADMIN_WINDOW);
 
-   if(keyUninitialized)
+   if(keyUninitialized == UNINITIALIZED && !phoneHomeFailed)  //formatted uninitialized card
    {
 
        if(!TrayLoadedOK()) // We have no tray icon, launch both
@@ -1975,10 +2098,11 @@
 
              if(!adminWnd)
              {
-                  launchSETTINGS();
+   //               launchSETTINGS();
              }
 
        }
+
        if(enrollWnd)   //Enrollment window is  already up
        {
            enrollWnd.focus();
@@ -1992,9 +2116,8 @@
    else
    {
        //Launch admin page if factory mode is enabled
-       // or we are without the tray icon.
 
-       if(gFactoryMode)
+       if(gFactoryMode || phoneHomeFailed || keyUninitialized == UNINITIALIZED_NOAPPLET)  //no applet
        { 
 
            if(adminWnd)    // Handle case where admin page is already up
@@ -2069,6 +2192,8 @@
 function UpdateButtonStates()
 {
 
+return;
+
   var enroll_btn =   document.getElementById("enrollbtn");
   var reset_btn =   document.getElementById("resetpinbtn");
 
@@ -2268,6 +2393,8 @@
     if(!gAdminPage)
         return;
 
+    var isCool =  DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
+
     var noKey = 0;
 
     if(!keyType || !keyID)
@@ -2365,8 +2492,16 @@
 
        DisableItem(enrollbtn);
 
-       EnableItem(resetpinbtn);
-       EnableItem(formatbtn);
+       if(isCool)
+       {
+           EnableItem(resetpinbtn);
+           EnableItem(formatbtn);
+       }
+       else
+       {
+           DisableItem(resetpinbtn);
+           DisableItem(formatbtn);
+       }
 
        if(!isBusy)
            detailsKeyLabel.setAttribute("value",getBundleString("enrolledKey"));
@@ -2377,12 +2512,24 @@
    if(keyStatus == "UNINITIALIZED")
    {
          DisableItem(viewcertsbtn);
-         EnableItem(enrollbtn);
+
+         if(isCool)
+         {
+              EnableItem(enrollbtn);
+         }
+         else
+         {
+              DisableItem(enrollbtn);
+         }
+
          DisableItem(resetpinbtn);
          if(!isBusy)
            detailsKeyLabel.setAttribute("value",getBundleString("uninitializedKey"));
 
-         EnableItem(formatbtn);
+         if(isCool)
+             EnableItem(formatbtn);
+         else
+             DisableItem(formatbtn);
 
        return;
    }
@@ -2396,7 +2543,11 @@
        if(!isBusy)
            detailsKeyLabel.setAttribute("value",getBundleString("blankKey"));
 
-       EnableItem(formatbtn);
+       if(isCool)
+           EnableItem(formatbtn);
+       else
+           DisableItem(formatbtn);
+
        return;
    }
 
@@ -2940,7 +3091,7 @@
   var keyID = keyInfo[1];
 
   var screenname = null;
-  var pin = null;
+  var pin =  GetPINValue();
   var screennamepwd = null;
 
   if (GetCoolKeyIsEnrolled(keyType, keyID))
@@ -3053,7 +3204,6 @@
 
 function OnCoolKeyInserted(keyType, keyID)
 {
-
   var row = null;
 
   var uninitialized = 0;
@@ -3088,20 +3238,27 @@
           SelectRowByKeyID(keyType, keyID);
    }
 
-  DoPhoneHome(keyType,keyID);
+  var phoneHomeSuccess = 1;
+
+  if(DoGetCoolKeyIsReallyCoolKey(keyType, keyID))
+      phoneHomeSuccess = DoPhoneHome(keyType,keyID);
 
   ShowAllWindows();
 
-  SelectESCPage(uninitialized);
+  SelectESCPage(keyType,keyID,1 - phoneHomeSuccess);
 
   UpdateESCSize();
 
   if(gHiddenPage)
   {
       var issuer = GetCachedIssuer(keyID);
-      if(!issuer)
-         issuer = getBundleString("unknownIssuer");
-      TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+      if(!issuer )
+      {
+
+             issuer = getBundleString("unknownIssuer");
+
+      }
+      //TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
   }
 
 }
@@ -3195,6 +3352,9 @@
 
 function OnCoolKeyPINResetComplete(keyType, keyID)
 {
+  if(gHiddenPage)
+      return;
+
   var keyStatus = PolicyToKeyType(GetCoolKeyPolicy(keyType, keyID));
   var keyReqAuth = BoolToYesNoStr(GetCoolKeyRequiresAuth(keyType, keyID));
   var keyIsAuthed = BoolToYesNoStr(GetCoolKeyIsAuthed(keyType, keyID));
@@ -3724,6 +3884,23 @@
     return result;
 }
 
+function DoGetCoolKeyIsReallyCoolKey(keyType,keyID)
+{
+
+    try {
+      netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+      isCool =  netkey.GetCoolKeyIsReallyCoolKey(keyType, keyID);
+
+      //alert("isCool " + isCool);
+
+      return isCool;
+    } catch (e) {
+
+        return 0;
+    }
+
+}
+
 function DoCoolKeyGetIssuerUrl(keyType,keyID)
 {
     var url = null;
@@ -3749,6 +3926,19 @@
   return url;
 }
 
+function DoGetCoolKeyGetAppletVer(keyType, keyID , isMajor)
+{
+    var ver = -1;
+
+    try {
+      netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+      var ver  =  netkey.GetCoolKeyGetAppletVer(keyType, keyID,isMajor);
+    } catch (e) {
+      ver = -1;
+  }
+  return ver;
+
+}
 
 function CheckForFactoryMode()
 {
@@ -3769,7 +3959,8 @@
 
 function launchCertViewer()
 {
-   var wind =  window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+   var wind = window.openDialog("chrome://esc/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+//   var wind =  window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
 }
 
 function launchSETTINGS()
@@ -3850,6 +4041,24 @@
 
 //Utility DOM functions
 
+function ChangeDescription(theDesc,theNewText)
+{
+
+    if(!theDesc || !theNewText)
+        return;
+
+   RemoveAllChildNodes(theDesc);
+
+   var theLabel = document.createTextNode(theNewText);
+
+
+   theDesc.appendChild(theLabel);
+   
+   UpdateESCSize(); 
+
+
+}
+
 function HideItem(theItem)
 {
     if(theItem)
@@ -4223,3 +4432,54 @@
    }
 
 }
+
+
+//Utility function to sleep for a short time
+
+function Sleep(milliSeconds)
+{
+    var then = new Date(new Date().getTime() + milliSeconds ); while (new Date() < then) {}
+}
+
+
+function DoCopyAdvancedInfoToClipBoard()
+{
+    var textinfo = window.document.getElementById("advanced-info");
+
+
+    CopyDataToClipboard(gDiagnosticsDataText);
+}
+
+
+function CopyDataToClipboard(aDataText)
+{
+
+   if(!aDataText)
+       return;
+
+
+    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); 
+
+
+    if (!str) 
+       return false; 
+
+    str.data = aDataText; 
+
+    var trans = Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); 
+
+    if (!trans) 
+        return false; 
+
+    trans.setTransferData("text/unicode",str,str.data.length *2); 
+    var clipid = Components.interfaces.nsIClipboard; 
+
+    var clip = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid); 
+
+    if (!clip) 
+        return false; 
+
+    clip.setData(trans,null,clipid.kGlobalClipboard);
+    MyAlert(getBundleString("dataCopiedToClipboard") );
+
+}


Index: GenericAuth.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GenericAuth.js	13 Sep 2006 17:56:49 -0000	1.2
+++ GenericAuth.js	27 Sep 2006 17:31:51 -0000	1.3
@@ -25,6 +25,9 @@
 var gDescription = null;
 var gStringBundle = null;
 
+var gFormSubmitted = 0;
+
+
 loadStringBundle();
 
 function ConfirmPassword(password_element)
@@ -122,9 +125,13 @@
     return 1;
 }
 
-function FormSubmit()
+function FormSubmit(noValidate)
 {
-    var result = Validate();
+    var result = true;
+
+    if(!noValidate)
+        Validate();
+
     var thisParent = window.opener;
 
     if(!thisParent)
@@ -185,6 +192,7 @@
          }
 
     }
+     gFormSubmitted = 1;
      window.close(); 
 }
 
@@ -630,6 +638,18 @@
    }
 }
 
+function UiUnload()
+{
+    if(gFormSubmitted)
+    {
+        return;
+    }
+
+    var noValidate = 1;
+ 
+    FormSubmit(noValidate);
+}
+
 function GetRowsNodeFromGrid(theGrid)
 {
     if(!theGrid)


Index: GenericAuth.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- GenericAuth.xul	12 Jun 2006 23:39:51 -0000	1.1.1.1
+++ GenericAuth.xul	27 Sep 2006 17:31:51 -0000	1.2
@@ -23,6 +23,7 @@
     id="esc-auth-window"
     title="&genericAuthTitle;"
     onload="UiLoad();"
+    onunload="UiUnload();"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
 <stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>


Index: TRAY.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/TRAY.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TRAY.js	13 Sep 2006 17:56:49 -0000	1.2
+++ TRAY.js	27 Sep 2006 17:31:51 -0000	1.3
@@ -26,6 +26,7 @@
 var gWindNotify = null;
 
 
+
 loadStringBundle();
 
 //
@@ -368,6 +369,33 @@
 
 }
 
+function SetMenuItemsText()
+{
+
+  var manageKeys=getBundleString("menuManageKeys");
+
+  var exit= getBundleString("menuExit");
+
+  TrayChangeMenuItemText(0,manageKeys);
+  TrayChangeMenuItemText(1,exit);
+
+}
+
+function TrayChangeMenuItemText(aIndex, aText)
+{
+    if(gTray && gBaseWindow)
+    {
+        try {
+        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
+        gTray.setmenuitemtext(aIndex,aText);
+        gTray.showicon();
+        } catch(e) {
+alert("exception " + e);
+            return;
+        }
+
+   }
+}
 
 //String bundling related functions
 
@@ -388,3 +416,4 @@
     return str;
 }
 
+


Index: config.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/config.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- config.xul	13 Sep 2006 17:56:49 -0000	1.2
+++ config.xul	27 Sep 2006 17:31:51 -0000	1.3
@@ -23,8 +23,8 @@
     id="esc-window"
     title="&escTitle;"
     onload="InitializePhoneHomeConfigUI();"
-    width ="600"
-    height= "350"
+    width ="650"
+    height= "400"
     onunload="cleanup();"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 <stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
@@ -40,6 +40,19 @@
     <description class="messageText">
         &tpsConfigDesc; 
     </description>
+
+    <spacer class="verticalSpacerShort"/>
+    <description class="messageText">
+        &tpsConfigDesc1;
+    </description>
+    <spacer class="verticalSpacerShort"/>
+    <description class="messageText">
+        &tpsConfigDesc2;
+    </description>
+    <spacer class="verticalSpacerShort"/>
+    <description class="messageText">
+        &tpsConfigDesc3;
+    </description>
     <groupbox class="outerGroupBox" >
     <caption label="&editConfigValues;"/>
     <spacer flex="1" style="min-height: 10px" />
@@ -58,7 +71,7 @@
     </rows>
     </grid>
 
-    <hbox>
+    <hbox flex="1">
          <spacer flex ="1"/>
         <button label="&escOK;" oncommand="DoPhoneHomeConfigClose();" /> 
     </hbox>


Index: esc.css
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.css	13 Sep 2006 17:56:49 -0000	1.2
+++ esc.css	27 Sep 2006 17:31:51 -0000	1.3
@@ -87,7 +87,7 @@
 }
 
 .messageText {
-  font-size: 9pt;
+  font-size: 10pt;
   text-align: justify;
 
 }
@@ -313,6 +313,13 @@
   background-color: #ffffff;
 }
 
+.DiagnosicsTextBox {
+
+   width: 600px;
+   height: 725px;
+   border: black solid 4px;
+
+}
 
 .BorderedIFrame {
 
@@ -339,8 +346,14 @@
   width: 100px;
 }
 
+.largeWideBox {
+
+ min-width: 42em;
+
+}
+
 .mediumWideBox {
 
- min-width: 20em;
+ min-width: 18em;
 
 }


Index: esc.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.xul	13 Sep 2006 17:56:49 -0000	1.2
+++ esc.xul	27 Sep 2006 17:31:51 -0000	1.3
@@ -71,7 +71,7 @@
       </vbox>
       <vbox id="yes_key_box">
          <spacer flex="1" class="verticalSpacer"/>
-         <description class="messageText">
+         <description class="messageText" id="enroll-proceed-message">
              &readyToProceed;
          </description> 
 


Index: settings.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/settings.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- settings.xul	13 Sep 2006 17:56:49 -0000	1.2
+++ settings.xul	27 Sep 2006 17:31:51 -0000	1.3
@@ -24,7 +24,7 @@
     title="&escTitle;"
     onload="InitializeAdminBindingList()"
     onunload="cleanup()"
-    width ="720"
+    width ="730"
     height= "460"
     name="admin"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -47,7 +47,7 @@
                      <spacer flex="1"/>
                  </vbox>
      </hbox>
-     <groupbox flex ="1" orient="vertical" class="outerGroupBox">
+  <!--   <groupbox flex ="1" orient="vertical" class="outerGroupBox"> -->
          <vbox id="administer-message-id">
              <spacer flex="1"/>
              <description class="messageText">
@@ -55,14 +55,15 @@
              </description>
          </vbox>
          <hbox flex="1">
-             <groupbox flex="1" >
+             <groupbox flex="6" class="largeWideBox" >
                   <caption label="&pluggedInCards;" class="captionText"/>
                   <vbox id="admin-no-keys-area">
-                  <spacer flex ="1"/>
+              <!--    <spacer flex ="1"/>
                   <description class="messageText">
                       &adminNoKeysMessage;
-                  </description>
+                  </description> 
                   <spacer flex = "1"/>
+               -->
                   </vbox>
                   <listbox id="AdminBindingList" flex="2" >
                       <listcols>
@@ -74,9 +75,9 @@
                       </listcols>
                       <listhead>
                           <listheader />
-                          <listheader flex="1" class="headerText" label="&keyIssuer;"/>
-                          <listheader flex="1" class="headerText" label="&keyIssuedTo;"/>
-                          <listheader flex="1" class="headerText" label="&keyStatus;"/>
+                          <listheader flex="3" class="headerText" label="&keyIssuer;"/>
+                          <listheader flex="4" class="headerText" label="&keyIssuedTo;"/>
+                          <listheader flex="3" class="headerText" label="&keyStatus;"/>
                           <listheader flex="1" class="headerText" label="&keyProgress;"/>
                       </listhead>
                   </listbox>
@@ -132,21 +133,25 @@
 
                           <button class="buttonText" id="formatbtn" label="&doFormat;" oncommand="DoFormatCoolKey()" disabled="true" hidden = "false"/>
 
+                          <button class="buttonText" id="enrollbtn" label="&doEnroll;" oncommand="DoCollectPassword('enroll');" disabled="true" hidden="false"/>
+
                           <button class="buttonText"  id="resetpinbtn" label="&doResetPin;" oncommand="DoCollectPassword('resetpin');" disabled="true" hidden="false"/>
 
-                          <button class="buttonText" id="enrollbtn" label="&doEnroll;" oncommand="DoCollectPassword('enroll');" disabled="true" hidden="false"/>
 
-                          <button class="buttonText"  id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false"/>
+<!--                          <button class="buttonText"  id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false"/>
 
                           <button class="buttonText" id="advancedbtn" label="&advancedInfo;" disabled="true" hidden="false" oncommand="DoShowAdvancedInfo();"/>
-
+-->
                   </vbox> 
              </groupbox>
          </hbox>
         <hbox id = "enrollment_button_box" >
+            <button class="buttonText"  id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false"/>
+                          <button class="buttonText" id="advancedbtn" label="&advancedInfo;" disabled="true" hidden="false" oncommand="DoShowAdvancedInfo();"/>
+
             <spacer flex = "1"/>
             <button class="buttonText" id="closebtn" label ="&closeAdminLater;" oncommand="HideAdminPage();"/>
             <spacer class="horSpacerShort"/>
          </hbox>
-  </groupbox>
+  <!-- </groupbox> -->
 </window>




More information about the Fedora-directory-commits mailing list