Change Master Password feature added.
This commit is contained in:
parent
04e1ae02b0
commit
4dae137bc4
@ -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
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
///#######################################################################
|
||||
|
@ -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
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user