diff --git a/c_gui/CasaMain.cs b/c_gui/CasaMain.cs index 5e9abef0..0a09cbcf 100644 --- a/c_gui/CasaMain.cs +++ b/c_gui/CasaMain.cs @@ -57,13 +57,17 @@ public class CasaMain dialogConfirmRefresh, dialogSingleInstance, dialogLoginReprompt, - dialogShortPassword; + dialogShortPassword, + dialogResetMP; [Glade.Widget] Gtk.Entry entryMasterPassword1, entryMasterPassword2, entryMasterPassword3, - entryMasterPassword4; + entryMasterPassword4, + entryOldMP, + entryNewMP1, + entryNewMP2; [Glade.Widget] Gtk.CheckButton checkbuttonFirefox, @@ -172,6 +176,7 @@ public class CasaMain { MasterPasswordAuthentication(); + if (Common.IsTrayAvailable()) // && Common.IsArgSet(args, Common.ARG_SHOW_TRAY_ICON)) { try @@ -180,7 +185,8 @@ public class CasaMain mCasaTray = new CasaTray(); } catch{} - } + } + } else { @@ -950,6 +956,87 @@ public class CasaMain Logger.DbgLog("GUI:CasaMain.DeleteSecret() - END"); } + + ///####################################################################### + /// Reset Master Password CALLED VIA MAIN MENU + + /// + /// + /// + public void ResetMasterPassword(object obj, EventArgs args) + { + Logger.DbgLog("GUI:CasaMain.ResetMasterPassword() - BEGIN"); + + Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogResetMP", null); + gxmlTemp.Autoconnect (this); + dialogResetMP.TransientFor = windowMain; + entryOldMP.Text=""; + entryNewMP1.Text=""; + entryNewMP2.Text=""; + Logger.DbgLog("GUI:CasaMain.ResetMasterPassword() - END"); + } + + public void okbuttonResetMasterPWD_clicked(object abj, EventArgs args) + { + Logger.DbgLog("GUI:CasaMain.okbuttonResetMasterPWD_clicked() - BEGIN"); + + if (entryOldMP.Text == "") + { + DisplayError("You must enter you current Master Password"); + return; + } + + // check Current MP + if (entryOldMP.Text != "") + { + int rcode = miCASA.SetMasterPassword(1, entryOldMP.Text); + if (rcode != 0) + { + DisplayError("Current Master Password is not correct"); + return; + } + } + + if (entryNewMP1.Text.Length < 8) + { + Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogShortPassword", null); + gxmlTemp.Autoconnect (this); + return; + } + + if (entryNewMP1.Text != entryNewMP2.Text) + { + DisplayError("New Master Passwords do not match"); + return; + } + + if (miCASA.ChangeMasterPassword(entryOldMP.Text, entryNewMP1.Text)) + dialogResetMP.Destroy(); + else + DisplayError("Change failed"); + + Logger.DbgLog("GUI:CasaMain.okbuttonResetMasterPWD_clicked() - END"); + } + + public void cancelbuttonResetMasterPWD_clicked(object abj, EventArgs args) + { + dialogResetMP.Destroy(); + } + + private void DisplayError(String sErrorMessage) + { + MessageDialog md = new MessageDialog(windowMain, + Gtk.DialogFlags.Modal, + Gtk.MessageType.Warning, + Gtk.ButtonsType.Close, + sErrorMessage); + + md.Response +=new ResponseHandler(md_Response); + //md_ResponseCloseWindow + md.Show(); + + } + ///####################################################################### diff --git a/c_gui/Logger.cs b/c_gui/Logger.cs index ad7df952..769034ae 100644 --- a/c_gui/Logger.cs +++ b/c_gui/Logger.cs @@ -99,8 +99,8 @@ namespace Novell.CASA.GUI + ": Exception encountered - "); tsLog.AppendValues(message); - StackTrace st = new StackTrace(); - tsLog.AppendValues(st.ToString()); + StackTrace st1 = new StackTrace(); + tsLog.AppendValues(st1.ToString()); } #if DEBUG diff --git a/c_gui/images/casa-1.5.glade b/c_gui/images/casa-1.5.glade index 9f6c2499..25462add 100644 --- a/c_gui/images/casa-1.5.glade +++ b/c_gui/images/casa-1.5.glade @@ -52,7 +52,7 @@ True - + True gtk-new 1 @@ -74,7 +74,7 @@ - + True gtk-new 1 @@ -95,7 +95,7 @@ - + True gtk-new 1 @@ -121,7 +121,7 @@ - + True gtk-refresh 1 @@ -148,7 +148,7 @@ - + True gtk-dialog-authentication 1 @@ -169,7 +169,7 @@ - + True gtk-open 1 @@ -190,7 +190,7 @@ - + True gtk-delete 1 @@ -218,7 +218,7 @@ - + True gtk-quit 1 @@ -254,7 +254,7 @@ - + True gtk-zoom-fit 1 @@ -275,7 +275,7 @@ - + True gtk-jump-to 1 @@ -296,7 +296,7 @@ - + True gtk-copy 1 @@ -324,7 +324,7 @@ - + True gtk-delete 1 @@ -351,14 +351,14 @@ - + True - Persistent _Storage + Change Master Password True - + - + True gtk-revert-to-saved 1 @@ -379,7 +379,7 @@ - + True gtk-preferences 1 @@ -413,7 +413,7 @@ - + True gtk-file 1 @@ -434,7 +434,7 @@ - + True gtk-missing-image 1 @@ -484,7 +484,7 @@ - + True gtk-help 1 @@ -511,7 +511,7 @@ - + True gtk-dialog-info 1 @@ -6279,7 +6279,7 @@ by cilcking the Close button. True - The Master Password should be atleast eight characters in length. + The Master Password should be at least eight characters in length. False False GTK_JUSTIFY_LEFT @@ -6393,4 +6393,1692 @@ by cilcking the Close button. + + True + Change Master Password + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ON_PARENT + False + True + False + CASAicons.ico + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-help + True + GTK_RELIEF_NORMAL + True + -11 + + + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + True + -6 + + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + gtk-dialog-authentication + 6 + 0.5 + 0.5 + 0 + 0 + + + 4 + False + True + + + + + 4 + True + True + + + + + + True + False + 0 + + + + True + The Master Password is used to encrypt and +secure your persistent credentials. You are +prompted for the Master Password at startup. + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 4 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + 6 + True + 0 + 0.5 + GTK_SHADOW_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + 6 + True + 4 + 2 + False + 6 + 6 + + + + True + Current Master Password : + True + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + entryOldMP + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + New Master Password : + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + False + 0 + + True + * + False + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + False + 0 + + True + * + False + + + 1 + 2 + 1 + 2 + + + + + + + True + Reenter Master Password : + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + True + True + False + 0 + + True + * + False + + + 1 + 2 + 2 + 3 + + + + + + + Master Password Hint : + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + + + 0 + 1 + 3 + 4 + fill + + + + + + + True + True + True + 0 + + True + * + False + + + 1 + 2 + 3 + 4 + + + + + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + + + CASA Manager + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + 250 + 525 + True + True + CASAicons.ico + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + + + + True + False + 0 + + + + True + False + 0 + + + + True + + + + True + _File + True + + + + + + + + True + _New + True + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + True + New _Secret + True + + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + New _Key + True + + + + + True + gtk-new + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Refresh Stores + True + + + + + + True + gtk-refresh + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _Lock Secrets + True + + + + + True + gtk-dialog-authentication + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Unlock Secrets + True + + + + + True + gtk-open + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Destroy Secrets + True + + + + + True + gtk-delete + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _Exit + True + + + + + + True + gtk-quit + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Edit + True + + + + + + + + True + _View + True + + + + + + True + gtk-zoom-fit + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Link + True + + + + + True + gtk-jump-to + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Copy + True + + + + + True + gtk-copy + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _Delete + True + + + + + + True + gtk-delete + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Options + True + + + + + + + True + Persistent _Storage + True + + + + + True + gtk-revert-to-saved + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Preferences + True + + + + + True + gtk-preferences + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Debug + True + + + + + + + True + _Create Test Secrets + True + + + + + True + gtk-file + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + _Remove Test Secrets + True + + + + + True + gtk-missing-image + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + Enable _Logging + True + False + + + + + + + + + + + True + _Help + True + + + + + + + True + _Contents + True + + + + + True + gtk-help + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + _About CASA + True + + + + + True + gtk-dialog-info + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + 0 + True + True + + + + + 0 + False + False + + + + + + True + False + 0 + + + + True + casa-logo.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + 0 + False + True + + + + + + 8 + True + True + True + True + True + True + False + GTK_POS_TOP + True + False + + + + + True + False + 0 + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + True + True + True + False + True + + + + + 0 + True + True + + + + + + True + <b>:: Native Information ::</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + + + + + 0 + False + True + + + + + False + True + + + + + + True + False + 0 + + + + True + CASA_32.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <b>miCASA</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 6 + False + False + + + + + tab + + + + + + True + False + 0 + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + True + False + True + + + + + 0 + True + True + + + + + + True + <b>:: Native Information ::</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + + + + + 0 + False + True + + + + + False + True + + + + + + False + 0 + + + + True + firefox-logo.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <b>Firefox</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 6 + False + False + + + + + tab + + + + + + True + False + 0 + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + True + False + True + + + + + 0 + True + True + + + + + + True + <b>:: Native Information ::</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + + + + + 0 + False + True + + + + + False + True + + + + + + True + False + 0 + + + + True + mozilla-logo.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <b>Mozilla</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 6 + False + False + + + + + tab + + + + + + True + False + 0 + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + True + False + True + + + + + 0 + True + True + + + + + + True + <b>:: Native Information ::</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + + + + + 0 + False + True + + + + + False + True + + + + + + True + False + 0 + + + + True + kwallet-logo.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <b>KDE Wallet</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 6 + False + False + + + + + tab + + + + + + True + False + 0 + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + True + True + True + False + True + + + + + 0 + True + True + + + + + + True + <b>:: Native Information ::</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 6 + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + True + False + True + False + True + + + + + 0 + False + True + + + + + False + True + + + + + + True + False + 0 + + + + True + keyring-logo.png + 0.5 + 0.5 + 0 + 0 + + + 0 + False + True + + + + + + True + <b>GNOME Keyring</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 6 + False + False + + + + + tab + + + + + 0 + True + True + + + + + + True + True + + + 0 + False + False + GTK_PACK_END + + + + + +