- Bug 169353. Prompt user for Desktop Password when Master Password is not present.
This commit is contained in:
@@ -78,7 +78,8 @@ namespace Novell.CASA.GUI
|
||||
dialogShortPassword,
|
||||
dialogResetMP,
|
||||
dialogStillRunning,
|
||||
dialogFirefoxMP;
|
||||
dialogFirefoxMP,
|
||||
dialogDeletePersistentFiles;
|
||||
|
||||
[Glade.Widget]
|
||||
Gtk.Entry entryMasterPassword1,
|
||||
@@ -376,7 +377,7 @@ namespace Novell.CASA.GUI
|
||||
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false");
|
||||
|
||||
// did the daemon get restarted before the user created a master password?
|
||||
// if so, let's ask the user for there desktop password and set it if there's a cache file
|
||||
// if so, let's ask the user for their desktop password and set it if there's a cache file
|
||||
if (true == DoPersistentFilesExist())
|
||||
{
|
||||
Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogDesktopPassword", null);
|
||||
@@ -416,11 +417,8 @@ namespace Novell.CASA.GUI
|
||||
}
|
||||
|
||||
if (entryDesktopPassword1.Text.Equals(entryDesktopPassword2.Text))
|
||||
{
|
||||
|
||||
// validate entered desktop password - work in progress
|
||||
//if (miCASA.ValidateDesktopPwd(entryDesktopPassword1.Text))
|
||||
if (true)
|
||||
{
|
||||
if (miCASA.ValidateDesktopPwd(entryDesktopPassword1.Text))
|
||||
{
|
||||
// set the desktop password in micasa
|
||||
try
|
||||
@@ -445,7 +443,10 @@ namespace Novell.CASA.GUI
|
||||
}
|
||||
else
|
||||
{
|
||||
labelDesktopPasswordMessage.Text = "Your desktop password does not match";
|
||||
labelDesktopPasswordMessage.Text = "This password does not match previous one entered";
|
||||
// TODO: prompt user to retry, or delete their persistent files
|
||||
Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogDeletePersistentFiles", null);
|
||||
gxmlTemp.Autoconnect(this);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -457,6 +458,73 @@ namespace Novell.CASA.GUI
|
||||
}
|
||||
}
|
||||
|
||||
public void on_buttonStoreRetry_clicked(object obj, EventArgs args)
|
||||
{
|
||||
if (dialogDeletePersistentFiles != null)
|
||||
dialogDeletePersistentFiles.Destroy();
|
||||
}
|
||||
|
||||
|
||||
public void on_buttonStoreDelete_clicked(object obj, EventArgs args)
|
||||
{
|
||||
// delete .micasa files
|
||||
if (!DeleteMiCasaFiles())
|
||||
{
|
||||
DisplayError("Failed to delete all miCASA files.\r\nCheck you home directory for .miCASA* files.");
|
||||
return;
|
||||
};
|
||||
|
||||
// close this dialog
|
||||
if (dialogDeletePersistentFiles != null)
|
||||
dialogDeletePersistentFiles.Destroy();
|
||||
|
||||
// set desktop password and close dialogDeskPassword
|
||||
// set the desktop password in micasa
|
||||
try
|
||||
{
|
||||
Novell.CASA.miCASA.SetCredential(0,
|
||||
"Desktop",
|
||||
null,
|
||||
Novell.CASA.miCASA.USERNAME_TYPE_CN_F,
|
||||
GetLocalUsername(),
|
||||
entryDesktopPassword1.Text);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.DbgLog(e.ToString());
|
||||
}
|
||||
|
||||
if (dialogDesktopPassword != null)
|
||||
dialogDesktopPassword.Destroy();
|
||||
|
||||
MasterPasswordAuthentication();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private bool DeleteMiCasaFiles()
|
||||
{
|
||||
string[] faFiles = Directory.GetFiles(GetUserHomeDir(), ".miCASA*");
|
||||
bool bDeletedFiles = true;
|
||||
|
||||
for (int i=0; i<faFiles.Length; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.Delete(faFiles[i]);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.DbgLog(e.ToString());
|
||||
bDeletedFiles = false;
|
||||
}
|
||||
}
|
||||
|
||||
return bDeletedFiles;
|
||||
}
|
||||
|
||||
|
||||
public void on_helpbuttonDesktopPassword_clicked(object obj, EventArgs args)
|
||||
{
|
||||
Common.ShowHelpUrl("CASADesktopPassword.htm");
|
||||
|
||||
23037
c_gui/images/casa.glade
23037
c_gui/images/casa.glade
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
|
||||
|
||||
<glade-project>
|
||||
<name>Casa</name>
|
||||
<program_name>casa</program_name>
|
||||
<pixmaps_directory></pixmaps_directory>
|
||||
<gnome_support>FALSE</gnome_support>
|
||||
</glade-project>
|
||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
|
||||
|
||||
<glade-project>
|
||||
<name>Casa</name>
|
||||
<program_name>casa</program_name>
|
||||
<pixmaps_directory></pixmaps_directory>
|
||||
<gnome_support>FALSE</gnome_support>
|
||||
</glade-project>
|
||||
|
||||
Reference in New Issue
Block a user