Import/Export changes

This commit is contained in:
Jim Norman
2006-08-22 16:45:08 +00:00
parent 3e261ca152
commit f7ce95ae97
5 changed files with 91 additions and 23 deletions

View File

@@ -111,7 +111,12 @@ namespace Novell.CASA.GUI
m_config.WriteConfig();
// call our daemon to get the users secrets
ExportXMLSecrets exportSecrets = new ExportXMLSecrets(sMasterPWD, sEncryptString);
ExportXMLSecrets exportSecrets = new ExportXMLSecrets(sMasterPWD, sEncryptString, sFileName);
object obj = Novell.CASA.MiCasa.Communication.MiCasaRequestReply.Send(MiCasaRequestReply.VERB_EXPORT_SECRETS, null, null, null, exportSecrets);
/*
byte[] theSecrets = (byte[])Novell.CASA.MiCasa.Communication.MiCasaRequestReply.Send(MiCasaRequestReply.VERB_EXPORT_SECRETS, null, null, null, exportSecrets);
// write em out.
@@ -121,6 +126,7 @@ namespace Novell.CASA.GUI
fs.Write(theSecrets, 0, theSecrets.Length);
fs.Flush();
fs.Close();
*/
CommonGUI.DisplayMessage(MessageType.Info, "Secrets saved to: \r\n" + sFileName);

View File

@@ -13,6 +13,7 @@ namespace Novell.CASA.GUI
{
Config m_config = null;
public MiCasa m_objMiCasa = null;
string sFile = null;
byte[] buffer = null;
[Glade.Widget]
@@ -32,8 +33,7 @@ namespace Novell.CASA.GUI
{
String sHintDir = m_config.GetConfigSetting(CommonGUI.HINT_DIR, null);;
String sHintFilename = m_config.GetConfigSetting(CommonGUI.HINT_FILENAME, null);
string sFile = null;
FileChooser fc = new FileChooser(FileChooser.ACTION_OPEN);
sFile = fc.GetFile(sHintDir, sHintFilename);
@@ -71,7 +71,7 @@ namespace Novell.CASA.GUI
// check for clear text secrets
if (data.StartsWith("<?xml"))
{
ImportXMLSecrets addSecrets = new ImportXMLSecrets(null, buffer);
ImportXMLSecrets addSecrets = new ImportXMLSecrets(null, null, sFile);
MiCasaRequestReply.Send(MiCasaRequestReply.VERB_ADD_XML_SECRETS, null, null, null, addSecrets);
CommonGUI.DisplayMessage(Gtk.MessageType.Info, "Import complete");
}
@@ -134,7 +134,7 @@ namespace Novell.CASA.GUI
{
if (entryMasterPassword != null)
{
ImportXMLSecrets addSecrets = new ImportXMLSecrets(entryMasterPassword.Text, buffer);
ImportXMLSecrets addSecrets = new ImportXMLSecrets(entryMasterPassword.Text, null, sFile);
addSecrets = (ImportXMLSecrets)MiCasaRequestReply.Send(MiCasaRequestReply.VERB_ADD_XML_SECRETS, null, null, null, addSecrets);
if (dialogImport != null)