This commit is contained in:
		| @@ -665,6 +665,11 @@ namespace Novell.CASA.GUI | |||||||
| 					break; | 					break; | ||||||
|     										 |     										 | ||||||
| 				case Common.STORE_FIREFOX:	 | 				case Common.STORE_FIREFOX:	 | ||||||
|  | 					if( false == objFirefox.IS_STORE_AGGREGATED ) | ||||||
|  | 					{ | ||||||
|  | 						objFirefox.AggregateStore(); | ||||||
|  | 						objFirefox.IS_STORE_AGGREGATED = true; | ||||||
|  | 					} | ||||||
| 					break; | 					break; | ||||||
|     				 |     				 | ||||||
| 				case Common.STORE_MOZILLA:	 | 				case Common.STORE_MOZILLA:	 | ||||||
| @@ -724,6 +729,14 @@ namespace Novell.CASA.GUI | |||||||
| 					break; | 					break; | ||||||
|     										 |     										 | ||||||
| 				case Common.STORE_FIREFOX:	 | 				case Common.STORE_FIREFOX:	 | ||||||
|  | 					if( 0 != objFirefox.tvSecretIDFirefox.Selection.CountSelectedRows() ) | ||||||
|  | 					{ | ||||||
|  | 						mmiNew.Sensitive = mmiNewKey.Sensitive = false; | ||||||
|  | 					} | ||||||
|  | 					else | ||||||
|  | 					{						 | ||||||
|  | 						mmiNew.Sensitive = mmiNewKey.Sensitive = false;						 | ||||||
|  | 					} | ||||||
| 					break; | 					break; | ||||||
|     				 |     				 | ||||||
| 				case Common.STORE_MOZILLA:	 | 				case Common.STORE_MOZILLA:	 | ||||||
| @@ -779,6 +792,15 @@ namespace Novell.CASA.GUI | |||||||
| 					break; | 					break; | ||||||
|     										 |     										 | ||||||
| 				case Common.STORE_FIREFOX:	 | 				case Common.STORE_FIREFOX:	 | ||||||
|  | 					if( 0 != objFirefox.tvSecretIDFirefox.Selection.CountSelectedRows() ) | ||||||
|  | 					{ | ||||||
|  | 						mmiView.Sensitive = true; | ||||||
|  | 						mmiDelete.Sensitive = mmiLink.Sensitive = mmiCopy.Sensitive = false;  | ||||||
|  | 					} | ||||||
|  | 					else | ||||||
|  | 					{ | ||||||
|  | 						mmiView.Sensitive = mmiLink.Sensitive = mmiCopy.Sensitive = mmiDelete.Sensitive = false; | ||||||
|  | 					} | ||||||
| 					break; | 					break; | ||||||
|     				 |     				 | ||||||
| 				case Common.STORE_MOZILLA:	 | 				case Common.STORE_MOZILLA:	 | ||||||
| @@ -1021,7 +1043,7 @@ namespace Novell.CASA.GUI | |||||||
| 					break; | 					break; | ||||||
|     										 |     										 | ||||||
| 				case Common.STORE_FIREFOX: | 				case Common.STORE_FIREFOX: | ||||||
| 					//objFirefox.ViewKeyValues(); | 					objFirefox.ViewKeyValues(); | ||||||
| 					break; | 					break; | ||||||
|     		 |     		 | ||||||
| 				case Common.STORE_MOZILLA: | 				case Common.STORE_MOZILLA: | ||||||
| @@ -1282,6 +1304,7 @@ namespace Novell.CASA.GUI | |||||||
| 			checkbuttonGnomeKeyring.Active=Common.IS_GNOMEKEYRING; | 			checkbuttonGnomeKeyring.Active=Common.IS_GNOMEKEYRING; | ||||||
| 			checkbuttonKdeWallet.Active=Common.IS_KDEWALLET; | 			checkbuttonKdeWallet.Active=Common.IS_KDEWALLET; | ||||||
| 						 | 						 | ||||||
|  | 			checkbuttonFirefox.Sensitive=Common.IS_FIREFOX_AVAILABLE; | ||||||
| 			checkbuttonKdeWallet.Sensitive=Common.IS_KDEWALLET_AVAILABLE; | 			checkbuttonKdeWallet.Sensitive=Common.IS_KDEWALLET_AVAILABLE; | ||||||
| 			checkbuttonGnomeKeyring.Sensitive=Common.IS_GNOMEKEYRING_AVAILABLE;						 | 			checkbuttonGnomeKeyring.Sensitive=Common.IS_GNOMEKEYRING_AVAILABLE;						 | ||||||
| 			 | 			 | ||||||
|   | |||||||
							
								
								
									
										450
									
								
								c_gui/Firefox.cs
									
									
									
									
									
								
							
							
						
						
									
										450
									
								
								c_gui/Firefox.cs
									
									
									
									
									
								
							| @@ -24,20 +24,468 @@ | |||||||
| namespace Novell.CASA.GUI { | namespace Novell.CASA.GUI { | ||||||
|  |  | ||||||
| using System; | using System; | ||||||
|  | using System.Collections; | ||||||
|  | using System.Collections.Specialized; | ||||||
| using Gtk; | using Gtk; | ||||||
| using Glade; | using Glade; | ||||||
|  | using Novell.CASA.MiCasa.Common; | ||||||
|  | using Novell.CASA.MiCasa.Communication; | ||||||
|  |  | ||||||
| public class Firefox : Store | public class Firefox : Store | ||||||
| {	 | {	 | ||||||
|  | 	Gtk.TreeStore 		tsSecretIDFirefox,  | ||||||
|  | 						tsNativeInfoFirefox,  | ||||||
|  | 						tsKeyValue; | ||||||
|  | 	 | ||||||
|  | 	CellRendererText    cellEditable; | ||||||
|  | 	 | ||||||
|  | 	ArrayList 			arrDeletedKeys = null; | ||||||
|  |  | ||||||
|  | 	public bool IS_STORE_AGGREGATED = false; | ||||||
|  | 	 | ||||||
|  | #region Glade Widgets | ||||||
|  | 	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	public Gtk.Window 	windowMain; | ||||||
|  | 	 | ||||||
|  | 	public Gtk.TreeView	tvSecretIDFirefox; | ||||||
|  |   	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	Gtk.TreeView 		tvKeyValue,  | ||||||
|  |   						tvNativeInfoFirefox; | ||||||
|  |   						  	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	Gtk.Dialog 			dialogNewSecret, | ||||||
|  | 						dialogManageSecret, | ||||||
|  | 						dialogConfirmDelete, | ||||||
|  | 						dialogLogin;  | ||||||
|  |   						  	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	Gtk.Menu 			menuRightClick; | ||||||
|  |   	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	Gtk.Entry 			entrySecretID, | ||||||
|  |   						entryKey, | ||||||
|  |   						entryValue, | ||||||
|  | 						entryMasterPassword3, | ||||||
|  | 						entryMasterPassword4, | ||||||
|  | 						entryDeleteSecretID; | ||||||
|  |   	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	Gtk.CheckButton		cbuttonShowPassword; | ||||||
|  |   	 | ||||||
|  | 	[Glade.Widget]  | ||||||
|  |   	Gtk.Label			label86, | ||||||
|  | 						label88; | ||||||
|  | 	 | ||||||
|  | 	[Glade.Widget] | ||||||
|  |   	Gtk.Button			buttonNewAdd, | ||||||
|  |   						buttonNewRemove;					 | ||||||
|  |   				  	 | ||||||
|  |   	[Glade.Widget]  | ||||||
|  |   	Gtk.MenuItem 		cmiNewSecret, | ||||||
|  | 						cmiNewKey, | ||||||
|  |   						cmiDelete, | ||||||
|  |   						cmiView, | ||||||
|  |   						cmiLink, | ||||||
|  |   						cmiCopy; | ||||||
|  |   						 | ||||||
|  | #endregion | ||||||
|  |  | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// CONSTRUCTOR		 | ||||||
|  | 	/// <summary>		 | ||||||
|  | 	///   | ||||||
|  | 	/// </summary> 	 	 	 | ||||||
|  |   	public Firefox() | ||||||
|  |   	{ | ||||||
|  |   		Logger.DbgLog("GUI:Firefox.Firefox() - BEGIN"); | ||||||
|  |   		 | ||||||
|  |   		/// SecretID TreeStore			 | ||||||
|  | 		tvSecretIDFirefox = (Gtk.TreeView)CasaMain.gxml.GetWidget("tvSecretIDFirefox"); | ||||||
|  | 		tsSecretIDFirefox = new TreeStore(typeof(string), typeof(string[]), typeof(string[]), typeof(string), typeof(string[]), typeof(string[]));		 | ||||||
|  | 		tvSecretIDFirefox.AppendColumn("Secret ID",new CellRendererText(),"text",0); | ||||||
|  | 		tvSecretIDFirefox.Model = tsSecretIDFirefox;		 | ||||||
|  | 		tvSecretIDFirefox.RowActivated 		+= new RowActivatedHandler(OntvSecretIDFirefoxRowActivated); | ||||||
|  | 		tvSecretIDFirefox.ButtonReleaseEvent 	+= new ButtonReleaseEventHandler(OnRightClicked); | ||||||
|  | 		tvSecretIDFirefox.CursorChanged 		+= new EventHandler(OnCursorChanged); | ||||||
|  | 		/// NativeInfo TreeStore			 | ||||||
|  | 		tvNativeInfoFirefox = (Gtk.TreeView)CasaMain.gxml.GetWidget("tvNativeInfoFirefox"); | ||||||
|  | 		tsNativeInfoFirefox = new TreeStore(typeof(string), typeof(string));		 | ||||||
|  | 		tvNativeInfoFirefox.AppendColumn("NativeKey",new CellRendererText(),"text",0); | ||||||
|  | 		tvNativeInfoFirefox.AppendColumn("NativeValue",new CellRendererText(),"text",1); | ||||||
|  | 		tvNativeInfoFirefox.Model = tsNativeInfoFirefox; | ||||||
|  | 		tvNativeInfoFirefox.ModifyBase(StateType.Normal,new Gdk.Color(0xff,0xff,0xe6)); | ||||||
|  | 				 | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.Firefox() - END");  	  	 | ||||||
|  |   	}  | ||||||
|  |   	 | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// AGGREGATE STORE		 | ||||||
|  | 	/// <summary>		 | ||||||
|  | 	///   | ||||||
|  | 	/// </summary> | ||||||
|   	public override void AggregateStore() |   	public override void AggregateStore() | ||||||
| 	{	 | 	{	 | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.AggregateStore() - BEGIN"); | ||||||
|  | 		 | ||||||
|  | 		try | ||||||
|  | 		{ | ||||||
|  | 			tsSecretIDFirefox.Clear();  	 | ||||||
|  | 			tsNativeInfoFirefox.Clear(); | ||||||
|  |   			StoreDataInterface.AggregateStore(Common.STORE_FIREFOX); | ||||||
|  |   			StoreDataInterface.ReadStore(Common.STORE_FIREFOX,ref tsSecretIDFirefox); | ||||||
|  |   		} | ||||||
|  |   		catch(Exception exp) | ||||||
|  |   		{ | ||||||
|  |   			Logger.DbgLog("GUI:Firefox.AggregateStore() - EXCEPTION" + exp.ToString()); | ||||||
|  |   		} | ||||||
|  |   		 | ||||||
|  |   		Logger.DbgLog("GUI:Firefox.AggregateStore() - END"); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// DISPLAY NATIVE INFO		 | ||||||
|  | 	/// <summary>		 | ||||||
|  | 	///   | ||||||
|  | 	/// </summary> | ||||||
|  |   	private void OnCursorChanged(object obj, EventArgs args) | ||||||
|  |   	{ | ||||||
|  |   		Logger.DbgLog("GUI:Firefox.OnCursorChanged() - BEGIN"); | ||||||
|  |   		 | ||||||
|  |   		TreeModel 	model; | ||||||
|  | 		TreeIter 	iter; | ||||||
|  | 		string 		selected	 = null;  		 | ||||||
|  | 		string[] 	NativeKeys	 = null, | ||||||
|  | 					NativeValues = null;  		 | ||||||
|  | 		 | ||||||
|  | 		if( tvSecretIDFirefox.Selection.GetSelected (out model, out iter) ) | ||||||
|  | 			selected = (string) model.GetValue(iter, 0); | ||||||
|  |  | ||||||
|  | 		if( (null != selected) && (selected.Length > 0) ) | ||||||
|  | 		{					 | ||||||
|  | 			tsNativeInfoFirefox.Clear(); | ||||||
|  | 			/// Populate NativeInfo | ||||||
|  | 			tsNativeInfoFirefox.AppendValues("Profile Name","= "+ model.GetValue(iter,3));			 | ||||||
|  | 			NativeKeys	= (string[]) model.GetValue(iter, 4); | ||||||
|  | 			NativeValues= (string[]) model.GetValue(iter, 5);			 | ||||||
|  | 			for( int i=0; i< NativeKeys.Length; i++ ) | ||||||
|  | 				if( (NativeValues[i] != null) && (NativeValues[i] != "") ) | ||||||
|  | 					tsNativeInfoFirefox.AppendValues(NativeKeys[i], "= "+NativeValues[i]);					 | ||||||
|  | 			tvNativeInfoFirefox.ShowAll(); | ||||||
|  | 		}  | ||||||
|  | 		 | ||||||
|  |   		Logger.DbgLog("GUI:Firefox.OnCursorChanged() - END"); | ||||||
|  |   	} | ||||||
|  |   	 | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// RIGHT-CLICK CONTEXT MENU 		 | ||||||
|  | 	/// <summary>		 | ||||||
|  | 	///   | ||||||
|  | 	/// </summary>	 | ||||||
|  | 	public void OnRightClicked(object obj, ButtonReleaseEventArgs args) | ||||||
|  | 	{		 | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.OnRightClicked() - BEGIN"); | ||||||
|  | 		 | ||||||
|  | 		if( 3 == args.Event.Button ) | ||||||
|  | 		{ | ||||||
|  | 			try | ||||||
|  | 			{ | ||||||
|  | 				Logger.DbgLog("GUI:Firefox.OnRightClicked() - Context menu opened.");			 | ||||||
|  | 				Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "menuRightClick", null); | ||||||
|  |         			gxmlTemp.Autoconnect (this);  | ||||||
|  | 				menuRightClick.Popup(null, null, null, IntPtr.Zero, 3, Gtk.Global.CurrentEventTime); | ||||||
|  | 				 | ||||||
|  | 				if( 0 != tvSecretIDFirefox.Selection.CountSelectedRows() ) | ||||||
|  | 					cmiNewSecret.Sensitive = cmiNewKey.Sensitive = cmiDelete.Sensitive = cmiLink.Sensitive = cmiCopy.Sensitive = false; | ||||||
|  | 				else | ||||||
|  | 					cmiNewSecret.Sensitive = cmiNewKey.Sensitive = cmiDelete.Sensitive = cmiLink.Sensitive = cmiCopy.Sensitive = cmiView.Sensitive = false;				 | ||||||
|  | 			}	 | ||||||
|  | 			catch(Exception exp) | ||||||
|  | 			{ | ||||||
|  | 				Logger.DbgLog("GUI:Firefox.OnRightClicked() - EXCEPTION" + exp.ToString());		 | ||||||
|  | 			}		 | ||||||
|  | 		} | ||||||
|  | 		 | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.OnRightClicked() - END");	 | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// VIEW KEY-VALUES		 | ||||||
|  | 	/// <summary>		 | ||||||
|  | 	///   | ||||||
|  | 	/// </summary> | ||||||
|  |   	public override void ViewKeyValues() | ||||||
|  | 	{					 | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.ViewKeyValues() - BEGIN"); | ||||||
|  | 		 | ||||||
|  | 		TreeModel 	model; | ||||||
|  | 		TreeIter 	iter; | ||||||
|  | 		string 		selected= null; | ||||||
|  | 		string[] 	keys    = null, | ||||||
|  | 					values  = null; | ||||||
|  | 		try | ||||||
|  | 		{ | ||||||
|  | 		 | ||||||
|  | 		if( tvSecretIDFirefox.Selection.GetSelected (out model, out iter) ) | ||||||
|  | 		{ | ||||||
|  | 			selected = (string)   model.GetValue(iter, 0); | ||||||
|  | 			keys	 = (string[]) model.GetValue(iter, 1); | ||||||
|  | 			values	 = (string[]) model.GetValue(iter, 2); | ||||||
|  | 			 | ||||||
|  | 			Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogManageSecret", null); | ||||||
|  | 	    		gxmlTemp.Autoconnect (this); | ||||||
|  | 			dialogManageSecret.TransientFor = (Gtk.Window)CasaMain.gxml.GetWidget("windowMain"); | ||||||
|  | 			dialogManageSecret.Title = "Firefox - Manage Secret"; | ||||||
|  | 			 | ||||||
|  | 			cellEditable = new CellRendererText(); | ||||||
|  | 			cellEditable.Editable = false; | ||||||
|  | 			//cellEditable.Edited += new EditedHandler(OnKeyValueEdited);		 | ||||||
|  | 			///			   KEY:0          VALUE:1         VALUE-DUP:2  	  DIRTY-BIT:3   LINK:4 			 | ||||||
|  | 			tsKeyValue = new TreeStore(typeof(string),typeof(string), typeof(string), typeof(bool), typeof(string)); | ||||||
|  | 			tvKeyValue.AppendColumn("Key",new CellRendererText(),"text",0); | ||||||
|  | 			tvKeyValue.AppendColumn("Value",cellEditable,"text",2); | ||||||
|  | 			tvKeyValue.AppendColumn("Linked", new CellRendererText(), "text", 4); | ||||||
|  | 			 | ||||||
|  | 			entrySecretID.Text=selected; | ||||||
|  | 							 | ||||||
|  | 			for( int i=0; i< keys.Length; i++ ) | ||||||
|  | 			{ | ||||||
|  | 				if( (null != keys[i]) && (null != values[i]) ) | ||||||
|  | 					tsKeyValue.AppendValues(keys[i], values[i], "********", false, "No"); | ||||||
|  | 				Console.WriteLine("Keys="+keys[i]+" , "+"Values="+values[i]);	 | ||||||
|  | 			} | ||||||
|  | 			tvKeyValue.Model = tsKeyValue; | ||||||
|  | 			//entryKey.HasFocus = true; | ||||||
|  | 			entryKey.Sensitive = entryValue.Sensitive = buttonNewAdd.Sensitive = buttonNewRemove.Sensitive = false; | ||||||
|  | 		} | ||||||
|  | 		} | ||||||
|  | 		catch(Exception exp) | ||||||
|  | 		{ | ||||||
|  | 			Logger.DbgLog("GUI:Firefox.ViewKeyValues() - EXCEPTION" + exp.ToString()); | ||||||
|  | 		} | ||||||
|  | 		 | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.ViewKeyValues() - END"); | ||||||
|  | 	} | ||||||
|  | 		 | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// ADD BUTTON CLICKED  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void on_buttonNewAdd_clicked(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// REMOVE BUTTON CLICKED  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void on_buttonNewRemove_clicked(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// MANAGE SECRET-ID DIALOG OK-BUTTON CLICKED  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void on_buttonManageOk_clicked(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		tsKeyValue.Dispose(); | ||||||
|  | 		dialogManageSecret.Destroy(); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// MANAGE SECRET-ID DIALOG CANCEL-BUTTON CLICKED  | ||||||
|  | 	/// </summary>													 | ||||||
|  | 	public void on_buttonManageCancel_clicked(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		tsKeyValue.Dispose(); | ||||||
|  | 		dialogManageSecret.Destroy(); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public void on_buttonhelpEditSecret_clicked(object obj, EventArgs args) | ||||||
|  |         { | ||||||
|  |                 Common.ShowHelpUrl("EditingSecrets.html"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// SHOW PASSWORD CHECK BUTTON CLICKED  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void on_cbuttonShowPassword_toggled(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		TreeViewColumn tvCol; | ||||||
|  | 		 | ||||||
|  | 		if( tvKeyValue.Model.IterNChildren() > 0 ) | ||||||
|  | 		if( true == cbuttonShowPassword.Active) | ||||||
|  | 		{ | ||||||
|  | 			Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogLogin", null); | ||||||
|  | 			gxmlTemp.Autoconnect (this); | ||||||
|  | 			dialogLogin.TransientFor = dialogManageSecret;         | ||||||
|  | 				 | ||||||
|  | 			label86.Text = "Enter your Master Password to view passwords"; | ||||||
|  | 			entryMasterPassword3.Text=""; | ||||||
|  | 			entryMasterPassword3.HasFocus = true; | ||||||
|  | 			label88.Hide(); | ||||||
|  | 			entryMasterPassword4.Hide(); | ||||||
|  | 			dialogLogin.Show();						 | ||||||
|  | 		} | ||||||
|  | 		else | ||||||
|  | 		{ | ||||||
|  | 			tvKeyValue.RemoveColumn(tvKeyValue.GetColumn(1)); | ||||||
|  | 			tvCol = new TreeViewColumn("Value", cellEditable, "text", 2); | ||||||
|  | 			tvKeyValue.InsertColumn(tvCol, 1); | ||||||
|  | 		}	 | ||||||
| 	 | 	 | ||||||
| 	} | 	} | ||||||
| 	 | 	 | ||||||
|   	public override void ViewKeyValues() | 	public void okbuttonLogin_clicked(object abj, EventArgs args) | ||||||
|  | 	{     | ||||||
|  | 		TreeViewColumn tvCol; | ||||||
|  | 		 | ||||||
|  | 		if( tvKeyValue.Model.IterNChildren() > 0 ) | ||||||
|  |  | ||||||
|  | 		if( 0 == miCASA.SetMasterPassword(0, entryMasterPassword3.Text) ) | ||||||
|  | 		{			 | ||||||
|  | 			tvKeyValue.RemoveColumn(tvKeyValue.GetColumn(1)); | ||||||
|  | 			tvCol = new TreeViewColumn("Value", cellEditable, "text", 1); | ||||||
|  | 			tvKeyValue.InsertColumn(tvCol, 1);			 | ||||||
|  | 			dialogLogin.Destroy();  		 | ||||||
|  | 		} | ||||||
|  | 		else | ||||||
|  | 		{ | ||||||
|  | 			// prompt user 						 | ||||||
|  | 			MessageDialog md=new MessageDialog(dialogLogin,Gtk.DialogFlags.Modal, | ||||||
|  | 			Gtk.MessageType.Warning, | ||||||
|  | 			Gtk.ButtonsType.Ok, | ||||||
|  | 			"Master Password incorrect"); | ||||||
|  |  | ||||||
|  | 			md.Response +=new ResponseHandler(md_Response2); | ||||||
|  | 			md.SetPosition(Gtk.WindowPosition.CenterOnParent);		 | ||||||
|  | 			md.Modal = true; | ||||||
|  | 			md.Show(); | ||||||
|  | 		}				 | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public void closebuttonLogin_clicked(object abj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		cbuttonShowPassword.Active = false; | ||||||
|  | 		dialogLogin.Destroy();   | ||||||
|  | 	} | ||||||
|  |   	 | ||||||
|  |   	public void OnDialogLoginDeleted(object obj, DeleteEventArgs args)  | ||||||
|  | 	{		    			 | ||||||
|  | 		cbuttonShowPassword.Active = false; | ||||||
|  | 		dialogLogin.Destroy(); | ||||||
|  | 		args.RetVal = true;        		 | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	public void on_helpbuttonAuthentication_clicked(object obj, EventArgs args) | ||||||
|  |         { | ||||||
|  |                 Common.ShowHelpUrl("CASAMasterPasswordAuthentication.htm"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  | 	public void on_entryMasterPassword3_activate(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		if( "" != entryMasterPassword3.Text ) | ||||||
|  | 			okbuttonLogin_clicked(obj, args); | ||||||
|  | 	} | ||||||
|  |      | ||||||
|  | 	public void on_entryMasterPassword4_activate(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		okbuttonLogin_clicked(obj, args); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	private void md_Response2(object o, ResponseArgs args) | ||||||
|  | 	{ | ||||||
|  | 		MessageDialog md = (MessageDialog)o; | ||||||
|  | 		if (md != null) | ||||||
|  | 		{ | ||||||
|  | 			md.Destroy();			 | ||||||
|  | 			entryMasterPassword3.Text=""; | ||||||
|  | 			entryMasterPassword3.HasFocus = true; | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	private void md_Response(object o, ResponseArgs args) | ||||||
|  | 	{ | ||||||
|  | 		MessageDialog md = (MessageDialog)o; | ||||||
|  | 		if (md != null) | ||||||
|  | 		{ | ||||||
|  | 			md.Destroy();			 | ||||||
|  | 		} | ||||||
|  | 	}	 | ||||||
|  | 	 | ||||||
|  | 		 | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// SECRET-ID DOUBLE CLICKED  | ||||||
|  | 	/// </summary> | ||||||
|  | 	private void OntvSecretIDFirefoxRowActivated( object obj, RowActivatedArgs args )  | ||||||
|  | 	{  | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.OntvSecretIDFirefoxRowActivated() - ViewKeyValues() called.");  | ||||||
|  | 		 | ||||||
|  | 		ViewKeyValues();					 | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// VIEW KEY-VALUES CALLED VIA MAIN-MENU/CONTEXT-MENU  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void OnViewActivated(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		Logger.DbgLog("GUI:Firefox.OnViewActivated() - ViewKeyValues() called."); | ||||||
|  | 		 | ||||||
|  | 		ViewKeyValues(); | ||||||
|  | 	} | ||||||
|  |   	 | ||||||
|  |   	public void on_buttonNewCancel_clicked(object obj, EventArgs args) | ||||||
|  | 	{		 | ||||||
|  | 		dialogNewSecret.Destroy(); | ||||||
|  | 	} | ||||||
|  | 	 | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// ADD NEW SECRET	 | ||||||
|  |     	/// <summary> | ||||||
|  | 	///  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void OnNewSecretActivated(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	///####################################################################### | ||||||
|  |     	/// ADD NEW KEY-VALUES TO EXISTING SECRET     | ||||||
|  |     	/// <summary> | ||||||
|  | 	///  | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void OnNewKeyActivated(object obj, EventArgs args) | ||||||
|  | 	{		 | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// DELETE SECRET     | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// DELETE Secret | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void OnDeleteActivated(object obj, EventArgs args) | ||||||
|  | 	{	 | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	///####################################################################### | ||||||
|  |     	/// LINK      | ||||||
|  | 	/// <summary> | ||||||
|  | 	/// LINK Key-Values | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void OnLinkActivated(object obj, EventArgs args) | ||||||
| 	{ | 	{ | ||||||
| 		 | 		 | ||||||
| 	} | 	} | ||||||
|  | 	 | ||||||
|  | 	///####################################################################### | ||||||
|  | 	/// COPY     | ||||||
|  |     	/// <summary> | ||||||
|  | 	/// COPY Key-Values | ||||||
|  | 	/// </summary> | ||||||
|  | 	public void OnCopyActivated(object obj, EventArgs args) | ||||||
|  | 	{ | ||||||
|  | 		 | ||||||
|  | 	}   | ||||||
|  | 	 | ||||||
| } | } | ||||||
| } | } | ||||||
| ///################################################################## | ///################################################################## | ||||||
|   | |||||||
| @@ -42,6 +42,7 @@ namespace Novell.CASA.GUI { | |||||||
| 		private const string CCFXML_ELEMENT_MICASA_KEYCHAIN	= "Keychain", | 		private const string CCFXML_ELEMENT_MICASA_KEYCHAIN	= "Keychain", | ||||||
| 							  CCFXML_ELEMENT_GKEYRING_KEYRING	= "Keyring", | 							  CCFXML_ELEMENT_GKEYRING_KEYRING	= "Keyring", | ||||||
| 							  CCFXML_ELEMENT_KWALLET_WALLET		= "Wallet", | 							  CCFXML_ELEMENT_KWALLET_WALLET		= "Wallet", | ||||||
|  | 							  CCFXML_ELEMENT_FIREFOX_PROFILE	= "Profile", | ||||||
| 							  CCFXML_ELEMENT_SECRET				= "Secret", | 							  CCFXML_ELEMENT_SECRET				= "Secret", | ||||||
| 							  CCFXML_ELEMENT_FOLDER				= "Folder", | 							  CCFXML_ELEMENT_FOLDER				= "Folder", | ||||||
| 							  CCFXML_ATTRIBUTE_FOLDERNAME		= "Name", | 							  CCFXML_ATTRIBUTE_FOLDERNAME		= "Name", | ||||||
| @@ -202,6 +203,11 @@ namespace Novell.CASA.GUI { | |||||||
| 				ccfPath = "//CCF/KWallet"; | 				ccfPath = "//CCF/KWallet"; | ||||||
| 				storeChainKey = CCFXML_ELEMENT_KWALLET_WALLET; | 				storeChainKey = CCFXML_ELEMENT_KWALLET_WALLET; | ||||||
| 			} | 			} | ||||||
|  | 			else if( storeIDentifier == Common.STORE_FIREFOX ) | ||||||
|  | 			{				 | ||||||
|  | 				ccfPath = "//CCF/FireFox"; | ||||||
|  | 				storeChainKey = CCFXML_ELEMENT_FIREFOX_PROFILE; | ||||||
|  | 			} | ||||||
| 			else | 			else | ||||||
| 				return( Common.STATUS_STORE_INVALIDSTOREID ); | 				return( Common.STATUS_STORE_INVALIDSTOREID ); | ||||||
|  |  | ||||||
| @@ -264,7 +270,8 @@ namespace Novell.CASA.GUI { | |||||||
| 								} | 								} | ||||||
| 								else if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_GKEYRING_TYPE) ) | 								else if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_GKEYRING_TYPE) ) | ||||||
| 								{ | 								{ | ||||||
| 									synchType = iterSecret.Current.Value; | 									//synchType = iterSecret.Current.Value; | ||||||
|  | 									typeID = iterSecret.Current.Value; | ||||||
| 								} | 								} | ||||||
| 								 | 								 | ||||||
| 							}while( iterSecret.Current.MoveToNextAttribute() ); | 							}while( iterSecret.Current.MoveToNextAttribute() ); | ||||||
| @@ -371,6 +378,16 @@ namespace Novell.CASA.GUI { | |||||||
| 						strNativeValueArray[Common.INDEX_NATIVEINFO_MODIFIEDTIME] = modifiedTime; | 						strNativeValueArray[Common.INDEX_NATIVEINFO_MODIFIEDTIME] = modifiedTime; | ||||||
| 						//Console.WriteLine("folderName="+folderName+"\n"+"typeID="+typeID+"\n"+"synch="+synch+"\n"+"synchType="+synchType+"\n"+"modifiedTime="+modifiedTime); | 						//Console.WriteLine("folderName="+folderName+"\n"+"typeID="+typeID+"\n"+"synch="+synch+"\n"+"synchType="+synchType+"\n"+"modifiedTime="+modifiedTime); | ||||||
| 						 | 						 | ||||||
|  | 						if( storeIDentifier == Common.STORE_FIREFOX ) | ||||||
|  | 						{ | ||||||
|  | 						Console.WriteLine("SDI:AppendValues: secretID="+secretID); | ||||||
|  | 						Console.WriteLine("SDI:AppendValues: strKeyArray0="+strKeyArray[0]); | ||||||
|  | 						Console.WriteLine("SDI:AppendValues: strValueArray0="+strValueArray[0]); | ||||||
|  | 						Console.WriteLine("SDI:AppendValues: strKeyArray1="+strKeyArray[1]); | ||||||
|  | 						Console.WriteLine("SDI:AppendValues: strValueArray1="+strValueArray[1]); | ||||||
|  | 						Console.WriteLine("SDI:AppendValues: strNativeKeyArray[TYPEID]="+strNativeValueArray[Common.INDEX_NATIVEINFO_TYPEID]); | ||||||
|  | 						} | ||||||
|  |  | ||||||
| 						ls.AppendValues(secretID,strKeyArray,strValueArray,storeID,strNativeKeyArray,strNativeValueArray); | 						ls.AppendValues(secretID,strKeyArray,strValueArray,storeID,strNativeKeyArray,strNativeValueArray); | ||||||
| 					 | 					 | ||||||
| 						//Re-Initialize for next iteration | 						//Re-Initialize for next iteration | ||||||
| @@ -390,7 +407,7 @@ namespace Novell.CASA.GUI { | |||||||
|  				Logger.DbgLog("GUI:StoreDataInterface.ReadStore() - EXCEPTION" + exp.ToString()); |  				Logger.DbgLog("GUI:StoreDataInterface.ReadStore() - EXCEPTION" + exp.ToString()); | ||||||
|  				return( Common.STATUS_STORE_READFAILED );	 |  				return( Common.STATUS_STORE_READFAILED );	 | ||||||
| 			} | 			} | ||||||
| 			ShowDocOnConsole("READ STORE:"); | 			//ShowDocOnConsole("READ STORE:"); | ||||||
| 			return( Common.STATUS_SUCCESS ); | 			return( Common.STATUS_SUCCESS ); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| @@ -835,13 +852,13 @@ namespace Novell.CASA.GUI { | |||||||
| 		/// </summary> | 		/// </summary> | ||||||
| 		public static void ShowDocOnConsole(string str) | 		public static void ShowDocOnConsole(string str) | ||||||
| 		{ | 		{ | ||||||
| #if DEBUG | //#if DEBUG | ||||||
| 			Console.WriteLine("\n#######################################################"); | 			Console.WriteLine("\n#######################################################"); | ||||||
| 			Console.WriteLine("   "+str); | 			Console.WriteLine("   "+str); | ||||||
| 			Console.WriteLine("\n#######################################################"); | 			Console.WriteLine("\n#######################################################"); | ||||||
| 			ccfDoc.Save(Console.Out); | 			ccfDoc.Save(Console.Out); | ||||||
| 			Console.WriteLine("\n#######################################################"); | 			Console.WriteLine("\n#######################################################"); | ||||||
| #endif | //#endif | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ namespace Novell.CASA.GUI { | |||||||
| 			 | 			 | ||||||
| 			try | 			try | ||||||
| 			{ | 			{ | ||||||
| 			 				 | 			Common.IS_FIREFOX_AVAILABLE = AD.IsStoreAvailable(Common.STORE_FIREFOX); 				 | ||||||
| 			Common.IS_KDEWALLET_AVAILABLE = AD.IsStoreAvailable(Common.STORE_KDEWALLET); | 			Common.IS_KDEWALLET_AVAILABLE = AD.IsStoreAvailable(Common.STORE_KDEWALLET); | ||||||
| 			Common.IS_GNOMEKEYRING_AVAILABLE = AD.IsStoreAvailable(Common.STORE_GNOMEKEYRING); | 			Common.IS_GNOMEKEYRING_AVAILABLE = AD.IsStoreAvailable(Common.STORE_GNOMEKEYRING); | ||||||
| 			 | 			 | ||||||
| @@ -95,7 +95,7 @@ namespace Novell.CASA.GUI { | |||||||
| 					storeIdGkeyring[kGkeyringStoreCounter++]=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId; | 					storeIdGkeyring[kGkeyringStoreCounter++]=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId; | ||||||
| 					Logger.DbgLog("GUI:StorePolicyInterface.Init() - GNOMEKEYRING policy = " + Common.IS_GNOMEKEYRING); | 					Logger.DbgLog("GUI:StorePolicyInterface.Init() - GNOMEKEYRING policy = " + Common.IS_GNOMEKEYRING); | ||||||
| 				} | 				} | ||||||
| 				else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_FIREFOX)) | 				else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_FIREFOX) && Common.IS_FIREFOX_AVAILABLE) | ||||||
| 				{ | 				{ | ||||||
| 					Common.IS_FIREFOX=true; | 					Common.IS_FIREFOX=true; | ||||||
| 					storeNameFirefox=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName; | 					storeNameFirefox=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName; | ||||||
|   | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user