Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv602
Modified Files:
ESC.js GenericAuth.xul advancedinfo.xul config.xul esc.css
esc.png esc.xul password.js security.xul settings.xul
Log Message:
Latest bug fixes.
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ESC.js 5 Apr 2007 18:39:52 -0000 1.13
+++ ESC.js 7 May 2007 23:49:23 -0000 1.14
@@ -229,9 +229,10 @@
var issuer = "";
if(aResult == true)
{
- issuer = GetCachedIssuer(keyID);
+ issuer = GetCoolKeyIssuer(keyType,keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
+ recordMessage("In DoPhoneHome callback success issuer " + issuer);
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" +
issuer +"\"" + " " +
getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
LogKeyInfo(keyType,keyID,"Key Inserted ...");
UpdateRowWithPhoneHomeData(keyType,keyID);
@@ -248,7 +249,11 @@
}
else
{
- issuer = getBundleString("unknownIssuer");
+
+ issuer = GetCoolKeyIssuer(keyType,keyID);
+ if(!issuer)
+ issuer = getBundleString("unknownIssuer");
+ recordMessage("Phone home callback failed , issuer " + issuer);
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" +
issuer +"\"" + " " +
getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
LogKeyInfo(keyType,keyID,"Key Inserted ...");
}
@@ -265,7 +270,7 @@
var phoneHomeURI = GetCachedPhoneHomeURL(keyID);
recordMessage("Phone home info cached...");
- issuer = GetCachedIssuer(keyID);
+ issuer = GetCoolKeyIssuer(keyType,keyID);
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" +
issuer +"\"" + " " +
getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
LogKeyInfo(keyType,keyID,"Key Inserted ...");
@@ -415,6 +420,11 @@
function InitializePhoneHomeConfigUI()
{
+ var uri_box = document.getElementById("phonehomeuri");
+
+ if(uri_box)
+ uri_box.focus();
+
window.sizeToContent();
}
@@ -666,8 +676,24 @@
issuer = GetCachedIssuer(keyID);
- if(!issuer)
- issuer = getBundleString("unknownIssuer");
+
+ // Now try to read off the certs if applicable
+
+ if(!issuer && (GetStatusForKeyID(keyType, keyID) ==
getBundleString("statusEnrolled")))
+ {
+ try {
+
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ issuer = netkey.GetCoolKeyIssuer(keyType,keyID);
+
+ } catch (e)
+ {
+ issuer = null;
+ }
+ }
+
+
+ if(!issuer)
+ issuer = getBundleString("unknownIssuer");
return issuer;
}
@@ -719,11 +745,16 @@
var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
- var issuer = GetCachedIssuer(keyID);
+ var issuer = GetCoolKeyIssuer(keyType,keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
- textDump += getBundleString("smartCardU") + " " + i +
":" + "\n\n";
+ var cardName = DoCoolKeyGetTokenName(keyType,keyID);
+
+ if(!cardName)
+ cardName = i;
+
+ textDump += getBundleString("smartCardU") + " " + cardName +
":" + "\n\n";
textDump += " " + getBundleString("appletVersion") + "
" + appletVerMaj + "." + appletVerMin + "\n";
@@ -1008,24 +1039,24 @@
{
var image_src = "";
- if(observeBusy && (keyStatus == "BUSY" ))
+ if(observeBusy && (keyStatus == getBundleString("statusBusy")))
{
return "throbber-anim5.gif";
}
- if(keyStatus == "UNAVAILABLE")
+ if(keyStatus == getBundleString("statusUnavailable"))
{
return "";
}
- if(keyStatus == "ENROLLED")
+ if(keyStatus == getBundleString("statusEnrolled"))
{
image_src = "enrolled-key";
}
else
{
- if(keyStatus == "UNINITIALIZED")
+ if(keyStatus == getBundleString("statusUninitialized"))
image_src = "initializecard";
else
- if(keyStatus == "NO APPLET")
+ if(keyStatus == getBundleString("statusNoApplet"))
image_src = "blank-card";
}
@@ -1205,6 +1236,7 @@
function UpdateEnrollmentArea(keyType,keyID,inserted,showFullUI,showExternalUI)
{
+
if(!gEnrollmentPage)
return;
@@ -1215,12 +1247,11 @@
{
alreadyEnrolled = true;
}
- var arr = GetAvailableCoolKeys();
- var numKeys = arr.length;
- //alert("inserted " + inserted + " showFulUI " + showFullUI +
" showExternalUI " + showExternalUI + " already enrolled " +
alreadyEnrolled);
+ var numUnenrolledKeys = DoGetNumUnenrolledCoolKeys();
+
+ //alert("inserted " + inserted + " showFulUI " + showFullUI +
" showExternalUI " + showExternalUI + " already enrolled " +
alreadyEnrolled + " numUnenrolledKeys " + numUnenrolledKeys);
- //If we already have external UI and keys left, don't mess it up
var ui_id = document.getElementById("esc-ui");
@@ -1232,7 +1263,7 @@
if(!inserted)
{
- if(!numKeys)
+ if(!numUnenrolledKeys)
{
ui_id.setAttribute("src",null);
}
@@ -1389,6 +1420,9 @@
var pw = document.getElementById("pintf").value;
var pwlength = 0;
+ var qualityMeter = document.getElementById("pass-progress-id");
+
+
if(pw)
pwlength = pw.length;
@@ -1422,6 +1456,11 @@
if ( pwstrength > 100 ) {
pwstrength = 100;
}
+ if(qualityMeter)
+ {
+ qualityMeter.setAttribute("value", pwstrength);
+
+ }
if(qualityImage)
{
if(pwlength==0)
@@ -1522,13 +1561,14 @@
break;
case 4: // Available
case 6: // UnblockInProgress
- case 7: // PINResetInProgress
case 8: // RenewInProgress
keyStatus = PolicyToKeyType(GetCoolKeyPolicy(keyType, keyID));
break;
- case 5: // EnrollmentInProgress
+ case 7: // PINResetInProgress
keyStatus = getBundleString("statusBusy");
break;
+ case 5: // EnrollmentInProgress
+ keyStatus = getBundleString("statusBusy");
break;
case 9: // FormatInProgress
keyStatus = getBundleString("statusBusy");
@@ -1604,7 +1644,7 @@
function UpdateCoolKeyAvailabilityForEnrollment()
{
//Here we only allow ONE key
- //Take the first one that shows up.
+ //Take the first unenrolled one that shows up.
var arr = GetAvailableCoolKeys();
@@ -1616,17 +1656,24 @@
var i=0;
- for (i=0; i < 1; i++)
+ for (i=0; i < arr.length; i++)
{
- var row = InsertCoolKeyIntoEnrollmentPage(arr[i][0],arr[i][1]);
+ var status = GetStatusForKeyID(arr[i][0],arr[i][1]);
- if(row)
- gCurrentSelectedRow = row;
+ if(status != getBundleString("statusEnrolled"))
+ {
+ var row = InsertCoolKeyIntoEnrollmentPage(arr[i][0],arr[i][1]);
- var keyInserted = 1;
- var showFullUI = 0;
+ if(row)
+ gCurrentSelectedRow = row;
+
+ var keyInserted = 1;
+ var showFullUI = 0;
- UpdateEnrollmentArea(arr[i][0],arr[i][1],keyInserted,showFullUI);
+ UpdateEnrollmentArea(arr[i][0],arr[i][1],keyInserted,showFullUI);
+
+ break;
+ }
}
UpdateESCSize();
@@ -1660,6 +1707,8 @@
{
UpdateESCSize();
}
+
+ window.focus();
}
function SetCurrentSelectedRowForEnrollment()
@@ -1703,6 +1752,9 @@
DoSetEnrolledBrowserLaunchState();
DoHandleEnrolledBrowserLaunch();
+
+ window.setTimeout('ShowWindow()',250);
+
}
//Window related functions
@@ -2039,11 +2091,15 @@
if(!gAdminPage)
return;
- var isCool = DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
+ var isCool = null;
+
+ //alert("blub " + " keyType " + keyType + " keyID " +
keyID);
+
+ isCool = DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
var noKey = 0;
- if(!keyType || !keyID)
+ if(!keyType && !keyID)
{
noKey = 1;
}
@@ -2053,7 +2109,6 @@
if(!noKey)
keyStatus = GetStatusForKeyID(keyType, keyID);
-
recordMessage("No Key: " + noKey + " status " + keyStatus);
var passwordArea = document.getElementById("password-area-id");
@@ -2101,11 +2156,6 @@
if(!viewcertsbtn)
return;
- //hack for CAC cards that now have no CUID reported
-
- if(!isCool && !noKey)
- keyStatus = "ENROLLED";
-
var image_src = SelectImageForKeyStatus(keyStatus,1,1);
recordMessage("image_src " + image_src);
@@ -2116,13 +2166,38 @@
ShowItem(detailsImage);
detailsImage.setAttribute("src", image_src);
}
+
+ // Now take care of the right click context menu that is
+ // Invisible at this point
+
+ var adminkeymenu = document.getElementById("adminkeymenu");
+ var menu_format = null;
+ var menu_enroll = null;
+ var menu_resetpassword = null;
+
+ if(adminkeymenu)
+ {
+ menu_format = document.getElementById("menu-format");
+ menu_enroll = document.getElementById("menu-enroll");
+ menu_resetpassword = document.getElementById("menu-resetpassword");
+
+ if(!menu_format || !menu_enroll || !menu_resetpassword)
+ {
+ menu_format = null;
+ menu_enroll = null;
+ menu_resetpassword = null;
+ adminkeymenu = null;
+ }
+ }
+
+ recordMessage("Obtained admin popup menu object.");
ShowItem(advancedbtn);
EnableItem(advancedbtn);
var isBusy = 0;
var operationLabel = null;
- if(keyStatus == "BUSY" || keyStatus == "UNAVAILABLE")
+ if(keyStatus == getBundleString("statusBusy") || keyStatus ==
getBundleString("statusUnavailable"))
isBusy = 1;
if(isBusy)
@@ -2132,9 +2207,15 @@
if(!keyStatus)
{
-
DisableItem(viewcertsbtn);
DisableItem(enrollbtn);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_enroll);
+ DisableItem(menu_resetpassword);
+ DisableItem(menu_format);
+ }
+
DisableItem(resetpinbtn);
DisableItem(formatbtn);
@@ -2144,21 +2225,44 @@
return;
}
- if(keyStatus == "ENROLLED")
+ if(keyStatus == getBundleString("statusEnrolled"))
{
+ var isLoginKey = IsKeyLoginKey(keyType,keyID);
EnableItem(viewcertsbtn);
DisableItem(enrollbtn);
+ if(adminkeymenu)
+ DisableItem(menu_enroll);
if(isCool)
{
+ if(adminkeymenu)
+ EnableItem(menu_resetpassword);
+
EnableItem(resetpinbtn);
- EnableItem(formatbtn);
+
+ if(!isLoginKey)
+ {
+ EnableItem(formatbtn);
+ if(adminkeymenu)
+ EnableItem(menu_format);
+ }
+ else
+ {
+ DisableItem(formatbtn);
+ if(adminkeymenu)
+ DisableItem(menu_format);
+ }
}
else
{
DisableItem(resetpinbtn);
DisableItem(formatbtn);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_format);
+ DisableItem(menu_resetpassword);
+ }
}
if(!isBusy)
@@ -2167,51 +2271,75 @@
return;
}
- if(keyStatus == "UNINITIALIZED")
+ if(keyStatus == getBundleString("statusUninitialized"))
{
DisableItem(viewcertsbtn);
if(isCool)
{
EnableItem(enrollbtn);
+ if(adminkeymenu)
+ EnableItem(menu_enroll);
}
else
{
+ if(adminkeymenu)
+ DisableItem(menu_enroll);
+
DisableItem(enrollbtn);
}
DisableItem(resetpinbtn);
+ if(adminkeymenu)
+ DisableItem(menu_resetpassword);
+
if(!isBusy)
-
detailsKeyLabel.setAttribute("value",getBundleString("uninitializedKey"));
+
detailsKeyLabel.setAttribute("value",getBundleString("statusUninitialized"));
if(isCool)
{
EnableItem(formatbtn);
-
+ if(adminkeymenu)
+ EnableItem(menu_format);
}
else
{
+ if(adminkeymenu)
+ DisableItem(menu_format);
+
DisableItem(formatbtn);
}
return;
}
- if(keyStatus == "NO APPLET")
+ if(keyStatus == getBundleString("statusNoApplet"))
{
DisableItem(viewcertsbtn);
DisableItem(enrollbtn);
DisableItem(resetpinbtn);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_enroll);
+ DisableItem(menu_resetpassword);
+ }
+
if(!isBusy)
-
detailsKeyLabel.setAttribute("value",getBundleString("blankKey"));
+
detailsKeyLabel.setAttribute("value",getBundleString("statusNoApplet"));
if(isCool)
{
+ if(adminkeymenu)
+ EnableItem(menu_format);
+
EnableItem(formatbtn);
}
else
{
+ if(adminkeymenu)
+ DisableItem(menu_format);
+
DisableItem(formatbtn);
}
@@ -2229,6 +2357,12 @@
if(operationLabel)
detailsKeyLabel.setAttribute("value",operationLabel);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_enroll);
+ DisableItem(menu_format);
+ DisableItem(menu_resetpassword);
+ }
}
}
@@ -2249,7 +2383,6 @@
}
function UpdateAdminListRow( keyType, keyID)
{
-
if(!gAdminPage)
return;
@@ -2262,6 +2395,8 @@
if(!listbox)
return;
+ var isLoginKey = IsKeyLoginKey(keyType,keyID);
+
var issuer = GetCoolKeyIssuer(keyType,keyID);
var issuedTo = GetCoolKeyIssuedTo(keyType,keyID);
var keyStatus = GetStatusForKeyID(keyType, keyID);
@@ -2278,7 +2413,13 @@
issuedToCell.setAttribute("label",issuedTo);
if(statusCell)
- statusCell.setAttribute("label",keyStatus);
+ {
+ if(!isLoginKey)
+ statusCell.setAttribute("label",keyStatus);
+ else
+
statusCell.setAttribute("label",getBundleString("statusLoggedIn"));
+
+ }
if(imageCell)
imageCell.setAttribute("image",SelectImageForKeyStatus(keyStatus,1,0));
@@ -2332,7 +2473,13 @@
return null;
status.setAttribute("class","rowLabelText");
- status.setAttribute("label",keyStatus);
+
+ var isLoginKey = IsKeyLoginKey(keyType,keyID);
+ if(!isLoginKey)
+ status.setAttribute("label",keyStatus);
+ else
+
status.setAttribute("label",getBundleString("statusLoggedIn"));
+
status.setAttribute("id",KeyToCellID(keyType,keyID,"status"));
var progressCell = InsertListCell(listrow);
@@ -2351,9 +2498,12 @@
progressMeter.setAttribute("value", "0%");
progressMeter.setAttribute("class","progressMeter");
+ HideItem(progressMeter);
}
listrow.setAttribute("onclick","DoSelectAdminListRow(this);");
+ listrow.setAttribute("ondblclick","launchCertViewerIfCerts();");
+ listrow.setAttribute("context","adminkeymenu");
adminListBox.appendChild(listrow);
return listrow;
@@ -2396,6 +2546,12 @@
{
SetProgressMeterValue(progMeterID, 0);
SetProgressMeterStatus(progMeterID, "");
+
+ var meter = document.getElementById(progMeterID);
+ if(meter)
+ HideItem(meter);
+
+
}
function KeyToProgressBarID(keyType, keyID)
@@ -2504,6 +2660,8 @@
var screennamepwd = null;
var tokencode = null;
+
+ var failed = 0;
if (type == "userKey")
{
@@ -2526,6 +2684,7 @@
if (!EnrollCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
{
+ failed = 1;
recordMessage("EnrollCoolKey failed.");
}
@@ -2533,7 +2692,11 @@
{
UpdateAdminListRow(keyType,keyID);
UpdateAdminKeyDetailsArea(keyType,keyID);
- UpdateAdminKeyAreaDetailsLabel(getBundleString("enrollingToken"));
+ if(!failed)
+ {
+ AdminToggleStatusProgress(1,keyType,keyID);
+ UpdateAdminKeyAreaDetailsLabel(getBundleString("enrollingToken"));
+ }
}
}
@@ -2558,16 +2721,20 @@
var pin = GetPINValue();
var screennamepwd = null;
+ var failed = 0;
+
if (GetCoolKeyIsEnrolled(keyType, keyID))
{
if (!ResetCoolKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
{
+ failed = 1;
recordMessage("ResetCoolKeyPIN failed.");
}
}
else
{
+ failed = 1;
MyAlert(getBundleString("errorEnrolledFirst"));
}
@@ -2575,7 +2742,12 @@
{
UpdateAdminListRow(keyType,keyID);
UpdateAdminKeyDetailsArea(keyType,keyID);
- UpdateAdminKeyAreaDetailsLabel(getBundleString("resettingTokenPIN"));
+
+ if(!failed)
+ {
+ AdminToggleStatusProgress(1,keyType,keyID);
+
UpdateAdminKeyAreaDetailsLabel(getBundleString("resettingTokenPIN"));
+ }
}
}
@@ -2590,6 +2762,7 @@
var keyType = keyInfo[0];
var keyID = keyInfo[1];
+ var failed = 0;
var globalType = GetCachedTokenType(keyID);
if(!type)
@@ -2609,6 +2782,7 @@
if (!FormatCoolKey(keyType, keyID, lType, screenname, pin,screennamepwd,tokencode))
{
+ failed = 1;
recordMessage("FormatCoolKey failed.");
}
@@ -2616,7 +2790,11 @@
{
UpdateAdminListRow(keyType,keyID);
UpdateAdminKeyDetailsArea(keyType,keyID);
- UpdateAdminKeyAreaDetailsLabel(getBundleString("formatingToken"));
+ if(!failed)
+ {
+ AdminToggleStatusProgress(1,keyType,keyID);
+ UpdateAdminKeyAreaDetailsLabel(getBundleString("formatingToken"));
+ }
}
}
function DoCancelOperation()
@@ -2677,18 +2855,25 @@
{
var phoneHomeSuccess = 1;
if(DoGetCoolKeyIsReallyCoolKey(keyType, keyID))
+ {
phoneHomeSuccess = DoPhoneHome(keyType,keyID);
+ }
+ else
+ {
+ var issuer = GetCoolKeyIssuer(keyType,keyID);
+ if(!issuer )
+ issuer = getBundleString("unknownIssuer");
+
+
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" +
issuer +"\"" + " " +
getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+
+ }
+
ShowAllWindows();
if(!CheckForSecurityMode())
{
SelectESCPage(keyType,keyID,1 - phoneHomeSuccess);
}
- var issuer = GetCachedIssuer(keyID);
- if(!issuer )
- {
- issuer = getBundleString("unknownIssuer");
- }
}
}
@@ -2699,7 +2884,6 @@
var row = GetRowForKey(keyType, keyID);
-
if(gHiddenPage)
{
if(curChildWindow)
@@ -2707,7 +2891,7 @@
curChildWindow.close();
curChildWindow = null;
}
- var issuer = GetCachedIssuer(keyID);
+ var issuer = GetCoolKeyIssuer(keyType,keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
TraySendNotificationMessage(getBundleString("keyRemoved"),"\"" +
issuer + "\"" + " " +
getBundleString("keyRemovedComputer"),1,4000,GetESCNotifyIconPath(keyType,keyID));
@@ -2723,9 +2907,17 @@
{
RemoveAdminRow(row);
if (row == gCurrentSelectedRow)
+ {
gCurrentSelectedRow = null;
-
- UpdateAdminKeyDetailsArea(null,null);
+ UpdateAdminBindingListAvailability();
+ }
+ else
+ {
+ if(DoGetNumCoolKeys() == 0)
+ {
+ UpdateAdminKeyDetailsArea(null,null);
+ }
+ }
}
}
@@ -2765,6 +2957,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
ClearProgressBar(KeyToProgressBarID(keyType, keyID));
@@ -2789,6 +2982,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
}
@@ -2812,6 +3006,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
}
@@ -2858,6 +3053,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
if(!CheckForSecurityMode())
@@ -3319,9 +3515,35 @@
return num;
}
+
+//Return how many unenrolled cards are plugged in.
+function DoGetNumUnenrolledCoolKeys()
+{
+ var num = 0;
+ var arr = GetAvailableCoolKeys();
+ if (arr && arr.length )
+ {
+ for (i=0; i < arr.length; i++)
+ {
+ var status = GetStatusForKeyID(arr[i][0],arr[i][1]);
+
+ if(status != getBundleString("statusEnrolled"))
+ num++;
+
+ }
+ }
+
+ return num;
+
+}
+
+
//Is this really a CoolKey and not a CAC card?
function DoGetCoolKeyIsReallyCoolKey(keyType,keyID)
{
+ if(!keyType && !keyID)
+ return 0;
+
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var isCool = netkey.GetCoolKeyIsReallyCoolKey(keyType, keyID);
@@ -3415,6 +3637,24 @@
return atr;
}
+
+//Get Token Name of card
+function DoCoolKeyGetTokenName(keyType,keyID)
+{
+ if(!keyType && !keyID)
+ return null;
+
+ var name = null;
+ try {
+
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ name = netkey.GetCoolKeyTokenName(keyType, keyID);
+ } catch (e) {
+ return name;
+ }
+
+ return name;
+}
+
//Get applet version of card
function DoGetCoolKeyGetAppletVer(keyType, keyID , isMajor)
{
@@ -3452,6 +3692,13 @@
MyAlert(usageStr);
}
+function ShowVersion()
+{
+ var verStr = getBundleString("coolkeyComponentVersion") +
"\n\n";
+
+ MyAlert(verStr + " " + GetCoolKeyVersion());
+
+}
//Is the security mode up?
function CheckForSecurityMode()
@@ -3492,6 +3739,33 @@
}
}
+//Launch cert viewer if key has certs
+
+function launchCertViewerIfCerts()
+{
+ var row = null;
+
+ if(gCurrentSelectedRow)
+ row = gCurrentSelectedRow;
+
+ if(!row)
+ return;
+
+ var theID = row.getAttribute("id");
+
+ if (!theID)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(theID);
+
+ var status = GetStatusForKeyID(keyInfo[0],keyInfo[1]);
+
+ if(status == getBundleString("statusEnrolled"))
+ {
+ launchCertViewer();
+ }
+}
+
//Launch page to view card's certificates
function launchCertViewer()
{
@@ -3507,7 +3781,6 @@
if(!adminWnd)
{
var wind =
window.open("chrome://esc/content/settings.xul","","chrome,resizable,centerscreen,dialog");
-
} else
{
adminWnd.focus();
@@ -3780,7 +4053,7 @@
function LogKeyInfo(aKeyType,aKeyID,aMessage)
{
- var issuer = GetCachedIssuer(aKeyID);
+ var issuer = GetCoolKeyIssuer(aKeyType,aKeyID);
var status = GetStatusForKeyID(aKeyType, aKeyID);
var atr = DoCoolKeyGetATR(aKeyType,aKeyID);
var tpsURI = GetCachedTPSURL(aKeyID);
@@ -4130,3 +4403,84 @@
if(consoleService)
consoleService.logStringMessage("esc: " + message + "\n");
}
+
+function GetEnvironmentVar(aVar)
+{
+ if(!aVar)
+ return null;
+
+ var environ = Components.classes["(a)mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+
+
+ var retVar = null;
+
+ if(environ)
+ retVar = environ.get(aVar);
+
+ //alert("var: " + aVar + " value: " + retVar);
+
+ return retVar;
+}
+
+function SetEnvironmentVar(aVar,aValue)
+{
+ if(!aVar || !aValue)
+ return ;
+
+ var environ = Components.classes["(a)mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+
+ if(environ)
+ retVar = environ.set(aVar,aValue);
+}
+
+function IsKeyLoginKey(keyType,keyID)
+{
+ var result = 0;
+
+ var token_name = DoCoolKeyGetTokenName(keyType,keyID);
+ var login_token_name = GetEnvironmentVar("PKCS11_LOGIN_TOKEN_NAME");
+
+ if(token_name == login_token_name)
+ {
+ result = 1;
+ }
+
+ return result;
+}
+
+function AdminToggleStatusProgress(aOn,keyType,keyID)
+{
+ if(!gAdminPage)
+ return;
+
+ var statusCell =
document.getElementById(KeyToCellID(keyType,keyID,"status"));
+
+ if(!statusCell)
+ return;
+
+ var progMeterID = KeyToProgressBarID(keyType, keyID);
+ if(!progMeterID)
+ return;
+
+ var meter = document.getElementById(progMeterID);
+
+ if(!meter)
+ return;
+
+ if(aOn)
+ {
+ HideItem(statusCell);
+ ShowItem(meter);
+ }
+ else
+ {
+ HideItem(meter);
+ ShowItem(statusCell);
+
+ var adminList = document.getElementById("AdminBindingList");
+ if(adminList)
+ adminList.focus();
+ }
+}
Index: GenericAuth.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- GenericAuth.xul 25 Oct 2006 04:03:35 -0000 1.3
+++ GenericAuth.xul 7 May 2007 23:49:23 -0000 1.4
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/"
type="text/css"?>
<?xml-stylesheet href="esc.css" type="text/css"?>
<!-- ***** BEGIN COPYRIGHT BLOCK *****
* This Program is free software; you can redistribute it and/or modify it under
Index: advancedinfo.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- advancedinfo.xul 25 Oct 2006 04:03:35 -0000 1.2
+++ advancedinfo.xul 7 May 2007 23:49:23 -0000 1.3
@@ -55,8 +55,8 @@
</groupbox>
<hbox >
<spacer flex = "1"/>
-<button id="copytocp" label = "©ToClipboard;"
oncommand="DoCopyAdvancedInfoToClipBoard();"/>
-<button id="closebtn" label="&closeNow;"
oncommand="window.close();" />
+<button id="copytocp" label = "©ToClipboard;"
oncommand="DoCopyAdvancedInfoToClipBoard();"
accesskey="&CopyClip.accesskey;"/>
+<button id="closebtn" label="&closeNow;"
oncommand="window.close();" accesskey="&Close.accesskey;" />
</hbox>
Index: config.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/config.xul,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- config.xul 25 Oct 2006 04:03:35 -0000 1.4
+++ config.xul 7 May 2007 23:49:23 -0000 1.5
@@ -67,14 +67,14 @@
<row pack="center">
<label class="titleText" value="&tpsURIHeader;"
/>
<textbox size="70" class="configTextBox"
id="phonehomeuri" value="" />
- <button class="mediumButon" id="testtpsurl"
label="&doTest;" oncommand="DoPhoneHomeTest();"/>
+ <button class="mediumButon" id="testtpsurl"
label="&doTest;" oncommand="DoPhoneHomeTest();"
accesskey="&Test.accesskey;"/>
</row>
</rows>
</grid>
<hbox flex="1">
<spacer flex ="1"/>
- <button label="&escOK;"
oncommand="DoPhoneHomeConfigClose();" />
+ <button label="&escOK;"
oncommand="DoPhoneHomeConfigClose();" accesskey="&OK.accesskey;"
/>
</hbox>
<spacer flex="1" style="min-height: 20px" />
</groupbox>
Index: esc.css
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.css,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- esc.css 9 Feb 2007 21:46:47 -0000 1.4
+++ esc.css 7 May 2007 23:49:23 -0000 1.5
@@ -40,7 +40,7 @@
#logoImage {
- list-style-image: url(logo.gif);
+ list-style-image: url(esc.png);
}
#cylonImage {
Index: esc.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.xul,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- esc.xul 9 Feb 2007 21:42:19 -0000 1.5
+++ esc.xul 7 May 2007 23:49:23 -0000 1.6
@@ -151,8 +151,8 @@
</groupbox>
<hbox id = "enrollment_button_box">
<spacer flex = "4"/>
- <button id="closebtn" label ="&closeNow;"
oncommand="HideEnrollmentPage()"/>
- <button id="enrollbtn" label = "&enrollKeyNow;"
oncommand="DoShowFullEnrollmentUI();" hidden="true"
disabled="false"/>
+ <button id="closebtn" label ="&closeNow;"
oncommand="HideEnrollmentPage()"
accesskey="&Close.accesskey;"/>
+ <button id="enrollbtn" label = "&enrollKeyNow;"
oncommand="DoShowFullEnrollmentUI();" hidden="true"
disabled="false" accesskey="&Enroll.accesskey;"/>
<spacer class="horSpacerShort"/>
</hbox>
</vbox>
Index: password.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/password.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- password.js 27 Sep 2006 17:30:36 -0000 1.2
+++ password.js 7 May 2007 23:49:23 -0000 1.3
@@ -16,6 +16,9 @@
* END COPYRIGHT BLOCK **/
var parentWindow = window.opener;
+var gStringBundle=null;
+
+loadStringBundle();
function doOperation()
{
@@ -57,16 +60,16 @@
if(reenterpintf_obj)
rpinVal = reenterpintf_obj.value;
- if (! pinVal && pintf_obj)
+ if (!pinVal && pintf_obj)
{
- MyAlert("You must provide a valid Token PIN!");
- return null;
+ MyAlert(getBundleString("errorProvideTokenPIN"));
+ return null;
}
- if ( pinVal != rpinVal && reenterpintf_obj)
+ if ( pinVal != rpinVal )
{
- MyAlert("The PIN values you entered don't match!");
- return null;
+ MyAlert(getBundleString("errorMatchPinValues"));
+ return null;
}
return pinVal;
@@ -75,4 +78,27 @@
function PasswordLoad()
{
window.sizeToContent();
+ var pintf_obj = document.getElementById("pintf");
+ if(pintf_obj)
+ pintf_obj.focus();
+}
+
+//String bundling related functions
+
+function loadStringBundle()
+{
+ gStringBundle = document.getElementById("esc_strings");
+}
+
+function getBundleString(string_id)
+{
+ var str = null;
+
+ if(!string_id || !gStringBundle)
+ return null;
+
+ str = gStringBundle.getString(string_id);
+
+ return str;
}
+
Index: security.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/security.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- security.xul 9 Feb 2007 21:49:03 -0000 1.1
+++ security.xul 7 May 2007 23:49:23 -0000 1.2
@@ -38,6 +38,6 @@
</groupbox>
<hbox >
<spacer flex="3"/>
- <button id="closebtn" label ="&closeNow;"
oncommand="window.close();"/>
+ <button id="closebtn" label ="&closeNow;"
oncommand="window.close();" accesskey="&Close.accesskey;"/>
</hbox>
</window>
Index: settings.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/settings.xul,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- settings.xul 9 Feb 2007 21:39:22 -0000 1.5
+++ settings.xul 7 May 2007 23:49:23 -0000 1.6
@@ -72,14 +72,14 @@
<listcol flex="1"/>
<listcol flex="1"/>
<listcol flex="1"/>
- <listcol flex="1"/>
+ <!-- <listcol flex="1"/> -->
</listcols>
<listhead>
<listheader />
<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;"/>
+ <!-- <listheader flex="1"
class="headerText" label="&keyProgress;"/> -->
</listhead>
</listbox>
</groupbox>
@@ -132,31 +132,34 @@
<spacer class="verticalSpacer"/>
</description>
- <button class="buttonText"
id="formatbtn" label="&doFormat;"
oncommand="DoFormatCoolKey('userKey')" disabled="true" hidden
= "false"/>
+ <button class="buttonText"
id="formatbtn" label="&doFormat;"
oncommand="DoFormatCoolKey('userKey')" disabled="true" hidden
= "false" accesskey="&Format.accesskey;"/>
- <button class="buttonText"
id="enrollbtn" label="&doEnroll;"
oncommand="DoCollectPassword('enroll');" disabled="true"
hidden="false"/>
+ <button class="buttonText"
id="enrollbtn" label="&doEnroll;"
oncommand="DoCollectPassword('enroll');" disabled="true"
hidden="false" accesskey="&Enroll.accesskey;"/>
- <button class="buttonText"
id="resetpinbtn" label="&doResetPin;"
oncommand="DoCollectPassword('resetpin');" disabled="true"
hidden="false"/>
+ <button class="buttonText"
id="resetpinbtn" label="&doResetPin;"
oncommand="DoCollectPassword('resetpin');" disabled="true"
hidden="false" accesskey="&ResetPin.accesskey;"/>
-
-<!-- <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();"/>
+ <button class="buttonText" id="viewcertsbtn"
label="&doViewCerts;" oncommand="launchCertViewer()"
disabled="true" hidden="false"
accesskey="&ViewCerts.accesskey;"/>
+ <button class="buttonText"
id="advancedbtn" label="&advancedInfo;" disabled="true"
hidden="false" oncommand="DoShowAdvancedInfo();"
accesskey="&Diagnostics.accesskey;"/>
<spacer flex = "1"/>
<checkbox id="enrolled_key_browser"
label="&dontLaunchBrowser;" checked="false"
oncommand="DoHandleEnrolledBrowserLaunch(); " hidden="true"
disabled="false" />
<spacer flex = "1"/>
- <button class="buttonText" id="closebtn" label
="&closeAdminLater;" oncommand="HideAdminPage();"/>
+ <button class="buttonText" id="closebtn" label
="&closeAdminLater;" oncommand="HideAdminPage();"
accesskey="&Close.accesskey;"/>
<spacer class="horSpacerShort"/>
</hbox>
<!-- </groupbox> -->
+
+ <popupset>
+ <menupopup id="adminkeymenu">
+ <menuitem label="&doFormat;" id="menu-format"
oncommand="DoFormatCoolKey('userKey');"/>
+ <menuitem label="&doEnroll;" id="menu-enroll"
oncommand="DoCollectPassword('enroll');"/>
+ <menuitem label="&doResetPin;" id="menu-resetpassword"
oncommand="DoCollectPassword('resetpin');"/>
+ </menupopup>
+</popupset>
</window>