[Fedora-directory-commits] console/src/com/netscape/management/client/ug PickerEditorResource.properties, 1.3, 1.4 ResEditorNTUser.java, 1.1.1.1, 1.2

Richard Allen Megginson rmeggins at fedoraproject.org
Tue Dec 16 23:32:04 UTC 2008


Author: rmeggins

Update of /cvs/dirsec/console/src/com/netscape/management/client/ug
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv1890/console/src/com/netscape/management/client/ug

Modified Files:
	PickerEditorResource.properties ResEditorNTUser.java 
Log Message:
Resolves: bug 158334
Bug Description: WinSync Console: Handling of logonHours and
accountExpires incorrect.
Reviewed by: nhosoi (Thanks!)
Files: new file ADUtil.java
Fix Description: Added code to convert from Windows FILETIME to Java
time.  Added special handling for the "Never Expires" value, which can
be the very large value or 0.  The console now displays "Never Expires"
or the actual human readable value for the time.
As far as Logon Hours, it's just really messed up.  I will open another
bug for that.
https://bugzilla.redhat.com/attachment.cgi?id=326573 - never expires
https://bugzilla.redhat.com/attachment.cgi?id=326574 - expires with date
Platforms tested: RHEL5
Flag Day: no
Doc impact: yes



Index: PickerEditorResource.properties
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ug/PickerEditorResource.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PickerEditorResource.properties	10 Dec 2008 02:53:19 -0000	1.3
+++ PickerEditorResource.properties	16 Dec 2008 23:32:01 -0000	1.4
@@ -387,6 +387,7 @@
 resourceEditor-errorText2=Assigning this value to a user will give this user privileged access.
 resourceEditor-errorText3=Do you really want to use this value?
 resourceEditor-errorTitle=Value Warning
+resourceEditor-NeverExpires=Never Expires
 CALPage-displayName=Licenses
 CALPage-ID=Licenses
 CALPage-Title=To facilitate tracking of all Client Access Licenses (CAL), please indicate whether


Index: ResEditorNTUser.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ug/ResEditorNTUser.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ResEditorNTUser.java	18 Jul 2005 00:34:23 -0000	1.1.1.1
+++ ResEditorNTUser.java	16 Dec 2008 23:32:01 -0000	1.2
@@ -489,7 +489,14 @@
         _tfWorkstationList.setText(_oldWorkstationList);
         
         _oldExpiredDate = observable.get(_NT_USER_ACCT_EXPIRED,0);
-        _lAccountExpired.setText(_oldExpiredDate);
+        Date dt = ADUtil.convertToJavaDateTime(_oldExpiredDate);
+        if (ADUtil.neverExpires(dt)) {
+            _lAccountExpired.setText(_resource.getString("resourceEditor", "NeverExpires"));
+        } else if (dt != null) {
+            _lAccountExpired.setText(dt.toString());
+        } else {
+            _lAccountExpired.setText("");
+        }
         _newExpiredDate = _oldExpiredDate;
     }
     
@@ -617,24 +624,19 @@
         } else if (e.getSource()==_bExpiredDate)
         {
             // expire date
-            String sFormat = "yyyyMMddHHmmss";
-            SimpleDateFormat formatter = new SimpleDateFormat(sFormat);
-            Date d = new Date();
-            if (!_newExpiredDate.equals(""))
-            {
-                ParsePosition p = new ParsePosition(0);
-                d = formatter.parse(_newExpiredDate,p);
-            }
+            Date dt = ADUtil.convertToJavaDateTime(_newExpiredDate);
             Calendar c = Calendar.getInstance();
-            c.setTime(d);
+            if (!ADUtil.neverExpires(dt) && (dt != null)) {
+                c.setTime(dt);
+            }
             DateTimePicker picker = new DateTimePicker(UtilConsoleGlobals.getActivatedFrame(),c);
             picker.show();
             if (!picker.isCancel())
             {
                 c = picker.getCalendar();
-                d = c.getTime();
-                _newExpiredDate = formatter.format(d);
-                _lAccountExpired.setText(_newExpiredDate);
+                dt = c.getTime();
+                _newExpiredDate = ADUtil.convertToFileTime(dt);
+                _lAccountExpired.setText(dt.toString());
             }
         }
     }




More information about the Fedora-directory-commits mailing list