- Limit where persistent files can be saved.
This commit is contained in:
parent
d0a9891cdf
commit
fbfa990210
@ -385,11 +385,11 @@ namespace Novell.CASA.GUI
|
|||||||
Logger.DbgLog("GUI:CasaMain.Login() - BEGIN");
|
Logger.DbgLog("GUI:CasaMain.Login() - BEGIN");
|
||||||
|
|
||||||
if( true == IsMasterPasswordSet() )
|
if( true == IsMasterPasswordSet() )
|
||||||
{
|
{
|
||||||
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned true");
|
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned true");
|
||||||
|
|
||||||
if( false == miCASA.IsSecretPersistent(1,"") )
|
if( false == miCASA.IsSecretPersistent(1,"") )
|
||||||
{
|
{
|
||||||
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false");
|
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false");
|
||||||
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogLogin", null);
|
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogLogin", null);
|
||||||
gxmlTemp.Autoconnect (this);
|
gxmlTemp.Autoconnect (this);
|
||||||
@ -405,7 +405,7 @@ namespace Novell.CASA.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false");
|
Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false");
|
||||||
|
|
||||||
// did the daemon get restarted before the user created a master password?
|
// did the daemon get restarted before the user created a master password?
|
||||||
@ -713,7 +713,7 @@ namespace Novell.CASA.GUI
|
|||||||
string MICASA_PASSCODE_BY_MASTER_PASSWD_FILE = "/.miCASAPCByMPasswd";
|
string MICASA_PASSCODE_BY_MASTER_PASSWD_FILE = "/.miCASAPCByMPasswd";
|
||||||
string fileName = Common.GetUserPersistentDir(config) + MICASA_PASSCODE_BY_MASTER_PASSWD_FILE;
|
string fileName = Common.GetUserPersistentDir(config) + MICASA_PASSCODE_BY_MASTER_PASSWD_FILE;
|
||||||
|
|
||||||
Logger.DbgLog("GUI:CasaMain.IsMasterPasswordSet() - END");
|
Logger.DbgLog("GUI:CasaMain.IsMasterPasswordSet() - END");
|
||||||
return (File.Exists(fileName));
|
return (File.Exists(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1750,6 +1750,7 @@ namespace Novell.CASA.GUI
|
|||||||
public void okbuttonPreferences_clicked(object abj, EventArgs args)
|
public void okbuttonPreferences_clicked(object abj, EventArgs args)
|
||||||
{
|
{
|
||||||
Logger.DbgLog("GUI:CasaMain.okbuttonPreferences_clicked() - BEGIN");
|
Logger.DbgLog("GUI:CasaMain.okbuttonPreferences_clicked() - BEGIN");
|
||||||
|
bool bCloseDialog = true;
|
||||||
|
|
||||||
string[] storeID = new string[]{""};
|
string[] storeID = new string[]{""};
|
||||||
|
|
||||||
@ -1757,7 +1758,7 @@ namespace Novell.CASA.GUI
|
|||||||
Common.IS_MOZILLA = checkbuttonMozilla.Active;
|
Common.IS_MOZILLA = checkbuttonMozilla.Active;
|
||||||
Common.IS_GNOMEKEYRING = checkbuttonGnomeKeyring.Active;
|
Common.IS_GNOMEKEYRING = checkbuttonGnomeKeyring.Active;
|
||||||
Common.IS_KDEWALLET = checkbuttonKdeWallet.Active;
|
Common.IS_KDEWALLET = checkbuttonKdeWallet.Active;
|
||||||
dialogPreferences.Destroy();
|
|
||||||
|
|
||||||
/// FIREFOX
|
/// FIREFOX
|
||||||
if(Common.IS_FIREFOX)
|
if(Common.IS_FIREFOX)
|
||||||
@ -1841,12 +1842,18 @@ namespace Novell.CASA.GUI
|
|||||||
string sOldDir = Common.GetUserPersistentDir(config);
|
string sOldDir = Common.GetUserPersistentDir(config);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (MoveMiCASAFiles(sOldDir, sNewDir))
|
string sMoveMessage = MoveMiCASAFiles(sOldDir, sNewDir);
|
||||||
{
|
if (sMoveMessage.Equals("Success"))
|
||||||
// save off selected directory
|
{
|
||||||
Common.SetUserPersistentDir(config, sNewDir);
|
// save off selected directory
|
||||||
CommonGUI.DisplayMessage(Gtk.MessageType.Info, "Files moved from\r\n" + sOldDir + "\r\nto\r\n" + sNewDir);
|
Common.SetUserPersistentDir(config, sNewDir);
|
||||||
}
|
CommonGUI.DisplayMessage(Gtk.MessageType.Info, "Files moved from\r\n" + sOldDir + "\r\nto\r\n" + sNewDir);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CommonGUI.DisplayMessage(Gtk.MessageType.Warning, sMoveMessage);
|
||||||
|
bCloseDialog = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -1854,6 +1861,11 @@ namespace Novell.CASA.GUI
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.WriteConfig();
|
config.WriteConfig();
|
||||||
|
if (bCloseDialog)
|
||||||
|
{
|
||||||
|
dialogPreferences.Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
Logger.DbgLog("GUI:CasaMain.okbuttonPreferences_clicked() - END");
|
Logger.DbgLog("GUI:CasaMain.okbuttonPreferences_clicked() - END");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2225,8 +2237,13 @@ namespace Novell.CASA.GUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool MoveMiCASAFiles(string sOldDirectory, string sNewDirectory)
|
private string MoveMiCASAFiles(string sOldDirectory, string sNewDirectory)
|
||||||
{
|
{
|
||||||
|
if (sNewDirectory == null || sNewDirectory.Length == 0)
|
||||||
|
{
|
||||||
|
return "No persistent directory entered";
|
||||||
|
}
|
||||||
|
|
||||||
if ((sOldDirectory != null) && (sNewDirectory != null))
|
if ((sOldDirectory != null) && (sNewDirectory != null))
|
||||||
{
|
{
|
||||||
if (!sOldDirectory.Equals(sNewDirectory))
|
if (!sOldDirectory.Equals(sNewDirectory))
|
||||||
@ -2234,11 +2251,14 @@ namespace Novell.CASA.GUI
|
|||||||
// instruct our daemon/service to change the location
|
// instruct our daemon/service to change the location
|
||||||
ChangePersistentDir cpd = new ChangePersistentDir(sOldDirectory, sNewDirectory);
|
ChangePersistentDir cpd = new ChangePersistentDir(sOldDirectory, sNewDirectory);
|
||||||
cpd = (ChangePersistentDir)MiCasaRequestReply.Send(MiCasaRequestReply.VERB_CHANGE_PERSIST_DIR, cpd);
|
cpd = (ChangePersistentDir)MiCasaRequestReply.Send(MiCasaRequestReply.VERB_CHANGE_PERSIST_DIR, cpd);
|
||||||
if (cpd.GetErrorMessage().Equals("Success"))
|
if (cpd.GetErrorMessage().Equals("Success"))
|
||||||
return true;
|
return "Success";
|
||||||
|
else
|
||||||
|
return cpd.GetErrorMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2247,11 +2267,11 @@ namespace Novell.CASA.GUI
|
|||||||
{
|
{
|
||||||
PersistentPolicyDialog ppd = new PersistentPolicyDialog();
|
PersistentPolicyDialog ppd = new PersistentPolicyDialog();
|
||||||
ppd.ShowDialog();
|
ppd.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void on_mmiFindAndReplace_activate(object obj, EventArgs args)
|
public void on_mmiFindAndReplace_activate(object obj, EventArgs args)
|
||||||
{
|
{
|
||||||
objMiCasa.FindAndReplaceValues();
|
objMiCasa.FindAndReplaceValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -441,8 +441,15 @@ public class Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
internal static string GetUserName()
|
internal static string GetUserName()
|
||||||
{
|
{
|
||||||
return Environment.GetEnvironmentVariable("USERNAME");
|
if (Common.IS_LINUX)
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("USER");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return Environment.GetEnvironmentVariable("USERNAME");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user