major source structure and module name changes

This commit is contained in:
soochoi
2006-06-07 16:34:19 +00:00
parent 5c75241b4b
commit 1fa6f07e83
651 changed files with 0 additions and 0 deletions

80
gui/AssemblyInfo.cs Normal file
View File

@@ -0,0 +1,80 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using System.Reflection;
using System.Runtime.CompilerServices;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("CASAManager.exe")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Novell, Inc")]
[assembly: AssemblyProduct("CASA")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.6.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]

281
gui/CASAManager.csproj Normal file
View File

@@ -0,0 +1,281 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.10.3077"
SchemaVersion = "2.0"
ProjectGuid = "{A1A805D0-B400-4D11-A772-348CE13F1046}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "CASAManager"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "WinExe"
PreBuildEvent = ""
PostBuildEvent = ""
RootNamespace = ""
RunPostBuildEvent = "OnBuildSuccess"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "W32"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "false"
OutputPath = "Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "W32"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
NoStdLib = "false"
NoWarn = ""
Optimize = "true"
OutputPath = "Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
<Reference
Name = "System.Windows.Forms"
AssemblyName = "System.Windows.Forms"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Windows.Forms.dll"
/>
<Reference
Name = "System.Drawing"
AssemblyName = "System.Drawing"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
/>
<Reference
Name = "Novell.CASA.A-D"
Project = "{25D49F34-F655-4CCF-93F1-449243AF7A32}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Novell.CASA.Common"
Project = "{57CD94A2-5B4A-40C3-8189-CB760FB78357}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "Novell.CASA.miCASAWrapper"
Project = "{E21DD887-22F4-4935-9851-409715F663B0}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
Name = "pango-sharp"
AssemblyName = "pango-sharp"
HintPath = "..\..\..\..\..\..\GtkRun\2.8\lib\gtk-sharp\pango-sharp.dll"
/>
<Reference
Name = "atk-sharp"
AssemblyName = "atk-sharp"
HintPath = "..\..\..\..\..\..\GtkRun\2.8\lib\gtk-sharp\atk-sharp.dll"
/>
<Reference
Name = "gdk-sharp"
AssemblyName = "gdk-sharp"
HintPath = "..\..\..\..\..\..\GtkRun\2.8\lib\gtk-sharp\gdk-sharp.dll"
/>
<Reference
Name = "glade-sharp"
AssemblyName = "glade-sharp"
HintPath = "..\..\..\..\..\..\GtkRun\2.8\lib\gtk-sharp\glade-sharp.dll"
/>
<Reference
Name = "glib-sharp"
AssemblyName = "glib-sharp"
HintPath = "..\..\..\..\..\..\GtkRun\2.8\lib\gtk-sharp\glib-sharp.dll"
/>
<Reference
Name = "gtk-sharp"
AssemblyName = "gtk-sharp"
HintPath = "..\..\..\..\..\..\GtkRun\2.8\lib\gtk-sharp\gtk-sharp.dll"
/>
<Reference
Name = "Novell.CASA.CASAPolicy"
Project = "{636A9D7E-BFB5-4EB9-96F8-51FF85A98826}"
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AssemblyInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "CasaMain.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "CasaTray.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Common.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "CommonGUI.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Firefox.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "GnomeKeyring.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "KdeWallet.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Logger.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "MiCasa.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Mozilla.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Store.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "StoreDataInterface.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "StorePolicyInterface.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "TrayLib.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "images\CASA.bmp"
BuildAction = "Content"
/>
<File
RelPath = "images\casa.glade"
BuildAction = "None"
/>
<File
RelPath = "images\casa.gladep"
BuildAction = "None"
/>
<File
RelPath = "images\CASA_16.png"
BuildAction = "Content"
/>
<File
RelPath = "images\CASA_32.png"
BuildAction = "Content"
/>
<File
RelPath = "images\CASA_48.png"
BuildAction = "Content"
/>
<File
RelPath = "images\CASAiconsLocked.ico"
BuildAction = "Content"
/>
<File
RelPath = "images\casa-logo.png"
BuildAction = "Content"
/>
<File
RelPath = "images\firefox-logo.png"
BuildAction = "Content"
/>
<File
RelPath = "images\keyring-logo.png"
BuildAction = "Content"
/>
<File
RelPath = "images\kwallet-logo.png"
BuildAction = "Content"
/>
<File
RelPath = "images\micasa-logo.png"
BuildAction = "Content"
/>
<File
RelPath = "images\mozilla-logo.png"
BuildAction = "Content"
/>
<File
RelPath = "images\novell-logo.png"
BuildAction = "Content"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@@ -0,0 +1,48 @@
<VisualStudioProject>
<CSHARP LastOpenVersion = "7.10.3077" >
<Build>
<Settings ReferencePath = "D:\casa\extern\w32\gtk-sharp-2.0\;C:\GtkRun\2.8\lib\gtk-sharp\" >
<Config
Name = "Debug"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = "-debug"
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
<Config
Name = "Release"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
</Settings>
</Build>
<OtherProjectSettings
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
ProjectView = "ProjectFiles"
ProjectTrust = "0"
/>
</CSHARP>
</VisualStudioProject>

12
gui/CASAManager.desktop Normal file
View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Encoding=UTF-8
Name=Novell CASA Manager
GenericName=Novell Common Authenication Services Adapter (CASA)
Comment=Novell CASA Management Console v1.6
TryExec=CASAManager.sh
Exec=/usr/bin/CASAManager.sh
Icon=/usr/share/doc/packages/CASA/images/CASA_48.png
DocPath=/usr/share/doc/packages/CASA/help/en/Contents.htm
Terminal=false
Type=Application
Categories=Application;SystemSetup;X-Ximian-Toplevel

View File

@@ -0,0 +1,4 @@
<configuration>
<dllmap dll="gdk-x11-2.0" target="libgdk-x11-2.0.so.0"/>
<dllmap dll="libX11" target="libX11.so.6"/>
</configuration>

11
gui/CASAManager.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
HOST_ARCH=`uname -a | grep -c x86_64`
if [ $HOST_ARCH -gt 0 ]
then ARCH_LIB=64
else
ARCH_LIB=
fi
export MONO_PATH=/usr/lib$ARCH_LIB/
mono /usr/bin/CASAManager.exe &

2060
gui/CasaMain.cs Normal file

File diff suppressed because it is too large Load Diff

355
gui/CasaTray.cs Normal file
View File

@@ -0,0 +1,355 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using Gtk;
using Glade;
using System;
using System.IO;
using System.Diagnostics;
using System.Threading;
using Novell.CASA;
using Novell.CASA.MiCasa.Common;
using Novell.CASA.MiCasa.Communication;
namespace Novell.CASA.GUI
{
public class CasaTray
{
#if W32
private static System.Windows.Forms.NotifyIcon notifyIcon;
public static System.Drawing.Icon m_iconNormal;
public static System.Drawing.Icon m_iconLocked;
#endif
#if LINUX
Egg.TrayIcon icon;
EventBox eb;
private Gtk.Image m_imageLocked = new Image("images/CASA_16.png", IconSize.Menu);
private Gtk.Image m_imageUnlocked = new Image(Stock.Find, IconSize.Menu);
#endif
private static CasaMain mCasaMain = null;
private Menu popupMenu = null;
public CasaTray(CasaMain casaInstance)
{
mCasaMain = casaInstance;
Setup();
}
public CasaTray()
{
Setup();
}
private void Setup()
{
#if W32
Stream s = null;
notifyIcon = new System.Windows.Forms.NotifyIcon();
try
{
s = File.OpenRead("../images/CASAIcons.ico");
m_iconNormal = new System.Drawing.Icon(s);
notifyIcon.Icon = m_iconNormal;
}
catch (Exception e)
{
//MessageBox.Show("File 'notify.ico' cannot be found", "Error");
//Console.WriteLine(e.ToString());
//Console.WriteLine("File 'notify.ico' cannot be found");
Logger.DbgLog("GUI:CasaTray.Setup() EXCEPTION: \n" + e.ToString());
Logger.DbgLog("GUI:CasaTray.Setup(): File 'notify.ico' cannot be found");
return;
}
finally
{
if (s != null)
{
s.Close();
}
}
try
{
s = File.OpenRead("../images/CASAIconsLocked.ico");
m_iconLocked = new System.Drawing.Icon(s);
}
catch (Exception e)
{
//Console.WriteLine("File 'CASAIcons.ico' cannot be found");
Logger.DbgLog("GUI:CasaTray.Setup(): File 'CASAIcons.ico' cannot be found");
return;
}
finally
{
if (s != null)
{
s.Close();
}
}
//notifyIcon.Click +=new EventHandler(notifyIcon_Click);
notifyIcon.DoubleClick +=new EventHandler(notifyIcon_DoubleClick);
notifyIcon.MouseDown += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseDown);
notifyIcon.Visible = true;
UpdateTrayIcon(MiCASAStore.IsLocked());
#endif
#if LINUX
/* in order to receive signals, we need a eventbox, because Gtk.Image doesn't receive signals */
eb = new EventBox();
eb.Add(m_imageUnlocked); // using stock icon
// hooking event
eb.ButtonPressEvent += new ButtonPressEventHandler (this.OnImageClick);
icon = new Egg.TrayIcon("Test");
icon.Add(eb);
// showing the trayicon
icon.ShowAll();
#endif
}
private void ShowContextMenu()
{
if (popupMenu != null && popupMenu.Visible)
{
popupMenu.Destroy();
}
if (popupMenu == null || !popupMenu.Visible)
{
popupMenu = new Menu(); // creates the menu
MenuItem miSep = new MenuItem();
MenuItem miSep2 = new MenuItem();
MenuItem miSep3 = new MenuItem();
ImageMenuItem menuLaunchGUI = new ImageMenuItem ("Manage Secrets");
Image appimg = new Image(Stock.New, IconSize.Menu);
menuLaunchGUI.Image = appimg; // sets the menu item's image
menuLaunchGUI.Activated +=new EventHandler(menuLaunchGUI_Activated);
popupMenu.Add(menuLaunchGUI);
popupMenu.Add(miSep);
ImageMenuItem menuLockMiCasa = new ImageMenuItem ("Lock Secrets");
//appimg = new Image(Stock.Close, IconSize.Menu);
appimg = new Image("gtk-dialog-authentication", IconSize.Menu);
menuLockMiCasa.Image = appimg; // sets the menu item's image
menuLockMiCasa.Activated +=new EventHandler(menuLockMiCasa_Activated);
ImageMenuItem menuUnLockMiCasa = new ImageMenuItem ("Unlock Secrets");
appimg = new Image(Stock.Open, IconSize.Menu);
menuUnLockMiCasa.Image = appimg; // sets the menu item's image
menuUnLockMiCasa.Activated +=new EventHandler(menuLockMiCasa_Activated);
popupMenu.Add(menuLockMiCasa);
popupMenu.Add(menuUnLockMiCasa);
popupMenu.Add(miSep2);
ImageMenuItem menuDestroyMiCasa = new ImageMenuItem ("Destroy Secrets");
appimg = new Image(Stock.Delete, IconSize.Menu);
menuDestroyMiCasa.Image = appimg; // sets the menu item's image
menuDestroyMiCasa.Activated +=new EventHandler(menuDestroyMiCasa_Activated);
popupMenu.Add(menuDestroyMiCasa);
if (MiCASAStore.IsLocked())
{
menuLockMiCasa.Sensitive = false;
menuDestroyMiCasa.Sensitive = false;
}
else
{
menuUnLockMiCasa.Sensitive = false;
menuDestroyMiCasa.Sensitive = true;
}
ImageMenuItem menuOptionsMiCasa = new ImageMenuItem ("Preferences");
menuOptionsMiCasa.Sensitive = false;
popupMenu.Add(menuOptionsMiCasa);
popupMenu.Add(miSep3);
// creates a menu item with no image as default
ImageMenuItem menuPopup1 = new ImageMenuItem ("Exit");
appimg = new Image(Stock.Quit, IconSize.Menu);
menuPopup1.Image = appimg; // sets the menu item's image
popupMenu.Add(menuPopup1); // adds the menu item to the menu
// hooks a event when the user clicks the icon
menuPopup1.Activated += new EventHandler(this.OnPopupClick);
popupMenu.ShowAll(); // shows everything
// pops up the actual menu when the user right clicks
//popupMenu.Popup(null, null, null, IntPtr.Zero, args.Event.Button, args.Event.Time);
popupMenu.Popup();
}
}
private void OnImageClick (object o, ButtonPressEventArgs args) // handler for mouse click
{
if (args.Event.Button == 3) //right click
{
ShowContextMenu();
}
if (args.Event.Button == 1)
{
menuLaunchGUI_Activated(null, null);
}
}
private void OnPopupClick(object o, EventArgs args)
{
if (mCasaMain != null)
{
this.Destroy();
}
else
Application.Quit(); // quits the application when the users clicks the popup menu
}
#if W32
private void notifyIcon_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == System.Windows.Forms.MouseButtons.Right)
ShowContextMenu();
}
#endif
public void CasaManagerQuit()
{
//mCasaMain = null;
if (mCasaMain != null)
mCasaMain.Hide();
}
private void menuLaunchGUI_Activated(object sender, EventArgs e)
{
if (mCasaMain == null)
mCasaMain = new CasaMain(null);
else
{
mCasaMain.Show();
mCasaMain.Focus();
}
}
private void menuLockMiCasa_Activated(object sender, EventArgs e)
{
if (MiCASAStore.IsLocked())
{
//if( false == miCASA.IsSecretPersistent(1,"") )
CommonGUI cg = new CommonGUI();
cg.HandleUnlock(mCasaMain, this);
//UpdateTrayIcon(false);
}
else
{
MiCasaRequestReply.Send(MiCasaRequestReply.VERB_LOCK_STORE);
if (mCasaMain != null)
{
mCasaMain.LockGUI();
mCasaMain.RefreshStores();
}
UpdateTrayIcon(true);
}
}
/*
public bool IsMasterPasswordSet()
{
string MICASA_PASSCODE_BY_MASTER_PASSWD_FILE = "/.miCASAPCByMPasswd";
string fileName = Environment.GetEnvironmentVariable("HOME")+MICASA_PASSCODE_BY_MASTER_PASSWD_FILE;
return (File.Exists(fileName));
}
*/
private void notifyIcon_DoubleClick(object sender, EventArgs e)
{
//menuLockMiCasa_Activated(sender, e);
menuLaunchGUI_Activated(sender, e);
}
private void menuDestroyMiCasa_Activated(object sender, EventArgs e)
{
CommonGUI temp = new CommonGUI();
temp.menuDestroyMiCasa_Activated(mCasaMain, this);
}
internal void UpdateTrayIcon(bool StoreIsLocked)
{
#if W32
if (StoreIsLocked)
{
notifyIcon.Text = "miCASA - Locked";
notifyIcon.Icon = m_iconLocked;
}
else
{
notifyIcon.Text = "miCASA - Not Locked";
notifyIcon.Icon = m_iconNormal;
}
#endif
}
internal void Destroy()
{
if (mCasaMain != null)
mCasaMain.Dispose();
#if W32
notifyIcon.Dispose();
#endif
#if LINUX
// Does not work
icon.Dispose();
#endif
Application.Quit();
}
}
}

435
gui/Common.cs Normal file
View File

@@ -0,0 +1,435 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI {
using System;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Gtk;
using Glade;
public class Common
{
public const int STORE_MICASA = 0,
STORE_FIREFOX = 1,
STORE_MOZILLA = 2,
STORE_KDEWALLET = 3,
STORE_GNOMEKEYRING = 4;
public static bool IS_MICASA_AVAILABLE = true,
IS_FIREFOX_AVAILABLE = false,
IS_MOZILLA_AVAILABLE = false,
IS_KDEWALLET_AVAILABLE = false,
IS_GNOMEKEYRING_AVAILABLE = false;
public static bool IS_MICASA = true,
IS_FIREFOX = false,
IS_MOZILLA = false,
IS_KDEWALLET = false,
IS_GNOMEKEYRING = false;
public static bool IS_LINUX = false,
IS_WINDOWS = false;
public static string GladeFile = null,
DebugLogFile = null;
public static int MAX_LEN = 512;
public static string MICASA_PASSCODE_BY_DESKTOP_FILE = "/.miCASAPCByDesktop";
public static string MICASA_PASSCODE_BY_MP_FILE = "/.miCASAPCByMPasswd";
public static string MICASA_KEY_FILE = "/.miCASAKey";
public static string MICASA_PERSISTENCE_FILE = "/.miCASA";
public static string MICASA_VALIDATION_FILE = "/.miCASAValidate";
static Char[] SpecialCharacters = new Char[]{ '*', ':', '\'', '\\', '&', '=', '<', '>' };
/*static Char[] SpecialCharacters = new Char[]{ '`', '~', '@', '#', '$', '%',
'^', '&', '*', '(', ')',
'_', '=', '+', '|', '\\',
'{', '}', '[', ']', ':',
';', '\"', '\'', '<', '>',
',', '.', '?', '/', '!'};
*/
///##############################################################
/// SPI CONSTANTS
///
public static int MAX_STORES = 10;
public static string STORENAME_MICASA = "miCASA",
STORENAME_FIREFOX = "Firefox",
STORENAME_MOZILLA = "Mozilla",
STORENAME_KDEWALLET = "KDE Wallet",
STORENAME_GNOMEKEYRING = "GNOME Keyring";
///##############################################################
/// SDI CONSTANTS
///
//Operations
public static int OPERATION_ADD_SECRET = 0,
OPERATION_ADD_KEY = 1,
OPERATION_MODIFY_KEY = 2,
OPERATION_DELETE_SECRET = 3,
OPERATION_DELETE_KEY = 4;
//Limits
public static int MAX_ARRAY_ELEMENTS = 10;
public static int MAX_NATIVE_ELEMENTS = 8;
public static string NATIVEINFO_FOLDERNAME = "Folder Name";
public static string NATIVEINFO_TYPEID = "Type of Secret";
public static string NATIVEINFO_SYNC = "Syncronization Status";
public static string NATIVEINFO_SYNCTYPE = "Syncronization Type";
public static string NATIVEINFO_MODIFIEDTIME = "Last Modified Time";
public static int INDEX_NATIVEINFO_FOLDERNAME = 0,
INDEX_NATIVEINFO_TYPEID = 1,
INDEX_NATIVEINFO_SYNC = 2,
INDEX_NATIVEINFO_SYNCTYPE = 3,
INDEX_NATIVEINFO_MODIFIEDTIME = 4,
INDEX_NATIVEINFO_ACCESSEDTIME = 5,
INDEX_NATIVEINFO_CREATEDTIME = 6,
INDEX_NATIVEINFO_WALLETLASTACCESSEDTIME = 7;
public static string LINUX_HELP_PATH = "file:///usr/share/doc/packages/CASA/help/";
public static string WINDOWS_HELP_PATH = "..\\help\\";
///##############################################################
/// ARG CONSTANTS
///
public static string ARG_NO_TRAY_ICON = "-notray";
public static string ARG_SHOW_TRAY_ICON = "-tray";
public static string ARG_DEBUG = "-debug";
///#############################################################
///CasaIcons path
#if W32
public static string CASAICONS = "../images/CASAicons.ico";
#endif
#if LINUX
public static string CASAICONS = "/usr/share/doc/packages/CASA/images/CASAicons.ico";
#endif
///##############################################################
/// ERROR CODES
public static int STATUS_SUCCESS = 0,
STATUS_FAILURE = 1,
// POLICY STATUS CODE RANGE: 2 - 20
STATUS_POLICY_COULDNOTBESAVED = 2,
STATUS_POLICY_POLICYNOTFOUND = 3,
// STORE STATUS CODE RANGE: 21 - 40
STATUS_STORE_INVALIDSTOREID = 21,
STATUS_STORE_DATANOTFOUNDINSTORE = 22,
STATUS_STORE_UNSUPPORTEDOPERATION = 23,
STATUS_STORE_ADINITFAILED = 24,
STATUS_STORE_AGGREGATEFAILED = 25,
STATUS_STORE_READFAILED = 26,
STATUS_STORE_UPDATEFAILED = 27;
///##############################################################
/// STATIC ROUTINES
public static void ShowErrorDialog(Exception exp)
{
Console.WriteLine("CASA-EXCEPTION: " + exp.ToString());
}
public static void ShowErrorDialog(int errorCode)
{
Console.WriteLine("CASA-ERROR: " + errorCode);
}
///#######################################################################
/// READ PLATFORM
/// <summary>
/// Routine to read the operating system of the target machine.
/// IS_LINUX, IS_WINDOWS flags are set.
/// Path to Glade file is set in this routine.
/// </summary>
public static void ReadPlatform()
{
Logger.DbgLog("GUI:CasaMain.SetGladeFilePath() - BEGIN");
int platform = (int)Environment.OSVersion.Platform;
if ( (128 == platform) || (4 == platform) )
{
IS_LINUX = true;
GladeFile = "/usr/share/doc/packages/CASA/images/casa.glade";
if( !File.Exists(GladeFile) )
{
Logger.DbgLog("GUI:CasaMain.SetGladeFilePath() - ERROR: Glade file could not be found.");
//Gtk.Application.Quit();
Environment.Exit(-1);
}
Logger.DbgLog("GUI:CasaMain.SetGladeFilePath() - IS_LINUX = " + IS_LINUX);
}
else
{
IS_WINDOWS = true;
GladeFile = "..\\images\\casa.glade";
if( !File.Exists(GladeFile) )
{
Logger.DbgLog("GUI:CasaMain.SetGladeFilePath() - ERROR: Glade file could not be found.");
Environment.Exit(-1);
}
Logger.DbgLog("GUI:CasaMain.SetGladeFilePath() - IS_WINDOWS = " + IS_WINDOWS);
}
Logger.DbgLog("GUI:CasaMain.SetGladeFilePath() - END");
}
///#######################################################################
/// SINGLE INSTANCE CHECK
/// <summary>
/// MainWindow delete window handler
/// </summary>
public static bool CheckForSingleInstance()
{
bool bRet=false;;
if( true == IS_LINUX )
{
Process mgrProcess = null;
StreamReader sReader = null;
try
{
mgrProcess = new Process();
ProcessStartInfo mgrProcessStartInfo = new ProcessStartInfo("ps" );
mgrProcessStartInfo.Arguments = "Tuxh";
mgrProcessStartInfo.UseShellExecute = false;
mgrProcessStartInfo.RedirectStandardOutput = true;
mgrProcess.StartInfo = mgrProcessStartInfo;
mgrProcess.Start();
mgrProcess.WaitForExit();
sReader = mgrProcess.StandardOutput;
string str = sReader.ReadLine();
int num = 0;
while( str != null)
{
str = sReader.ReadLine();
if(str != null)
{
if(str.EndsWith("CASAManager.exe"))
{
num++;
}
}
}
if( num > 1 )
bRet = true;
else
bRet = false;
}
catch(Exception e)
{
Logger.DbgLog("GUI:CasaMain.CheckIfAnotherInstanceIsRunning() " + e.ToString());
bRet = false;
}
if(mgrProcess != null)
mgrProcess.Close();
if(sReader != null)
sReader.Close();
//return bRet;
}
else if( true == IS_WINDOWS )
{
#if DOTNET2
Process current = Process.GetCurrentProcess();
Process[] p = System.Diagnostics.Process.GetProcessesByName("CASAManager");
int i = 0;
foreach (Process proc in p)
{
if (proc.SessionId == current.SessionId)
i++;
}
if (i > 1)
bRet = true;
else
bRet = false;
#endif
}
return bRet;
}
public static bool IsTrayAvailable()
{
if (true == IS_LINUX)
return true;
else if (true == IS_WINDOWS)
return true;
else
return false;
}
public static bool IsArgSet(string[] args, string argToCheck)
{
if (args != null)
{
for (int i=0; i<args.Length; i++)
{
if (argToCheck.Equals(args[i].ToLower()))
return true;
}
}
return false;
}
private static string GetLocale()
{
if (IS_LINUX)
return "en/";
else
return "en\\";
}
private static string GetHelpPath()
{
if (IS_LINUX)
return LINUX_HELP_PATH;
else
return WINDOWS_HELP_PATH;
}
public static bool ShowHelpUrl(string sHelpFilename)
{
// get absolute path and locale
string sUrl = GetHelpPath() + GetLocale() + sHelpFilename;
return ShowUrl(sUrl);
}
public static bool ShowUrl(string url)
{
Process urlShowProcess = new Process();
if (Common.IS_LINUX)
{
String sCurrentDesktop = Environment.GetEnvironmentVariable("WINDOWMANAGER");
if (sCurrentDesktop != null && (sCurrentDesktop.IndexOf("kde") > 0))
urlShowProcess.StartInfo.FileName = "kde-open";
else
urlShowProcess.StartInfo.FileName = "gnome-open";
urlShowProcess.StartInfo.Arguments = url;
}
else
urlShowProcess.StartInfo.FileName = url;
try
{
urlShowProcess.Start();
urlShowProcess.WaitForExit();
}
catch (Exception e)
{
Logger.DbgLog(e.Message);
Logger.DbgLog(e.StackTrace);
return false;
}
if (urlShowProcess.ExitCode == 0)
return true;
else
return false;
}
public static void StartProcess(string sProcessPath, string sProcessArgs)
{
if (sProcessPath != null)
{
Process newProcess = new Process();
newProcess.StartInfo.FileName = sProcessPath;
if (sProcessArgs != null)
newProcess.StartInfo.Arguments = sProcessArgs;
try
{
newProcess.Start();
}
catch (Exception e)
{
Logger.DbgLog(e.Message);
Logger.DbgLog(e.StackTrace);
}
}
}
///#######################################################################
/// VALIDATE STRINGS FOR SPECIAL CHARACTERS
/// <summary>
/// Validate strings for special characters
/// </summary>
public static bool ValidateString(string sString)
{
if( -1 == sString.IndexOfAny(SpecialCharacters) )
return true;
else
return false;
}
internal static string GetUserHomeDir()
{
if (Common.IS_LINUX)
return Environment.GetEnvironmentVariable("HOME");
else
return Environment.GetEnvironmentVariable("USERPROFILE");
}
}
}
///##################################################################
/// END OF FILE
///##################################################################

275
gui/CommonGUI.cs Normal file
View File

@@ -0,0 +1,275 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using System;
using Gtk;
using Glade;
using Novell.CASA;
using Novell.CASA.MiCasa.Common;
using Novell.CASA.MiCasa.Communication;
#if W32
using Microsoft.Win32;
#endif
namespace Novell.CASA.GUI
{
/// <summary>
/// Summary description for CommonGUI.
/// </summary>
public class CommonGUI
{
[Glade.Widget]
Gtk.Label label86,
label88;
[Glade.Widget]
Gtk.Entry entryMasterPassword3,
entryMasterPassword4;
[Glade.Widget]
Gtk.Dialog dialogLogin;
Gtk.Window mainWindow = new Window("Test");
private CasaMain mCasaInstance = null;
private CasaTray mTrayInstance = null;
public CommonGUI()
{
//
// TODO: Add constructor logic here
//
}
/// <summary>
/// HandleUnlock dialog
/// </summary>
public void HandleUnlock(CasaMain managerInstance, CasaTray trayInstance)
{
mCasaInstance = managerInstance;
mTrayInstance = trayInstance;
//Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false");
#if W32
Glade.XML gxmlTemp = new Glade.XML ("../images/casa.glade", "dialogLogin", null);
#endif
#if LINUX
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogLogin", null);
#endif
gxmlTemp.Autoconnect (this);
dialogLogin.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");;
label86.Text = "Enter your Master Password to unlock your secrets.";
entryMasterPassword3.Text="";
label88.Hide();
entryMasterPassword4.Hide();
//dialogLogin.SetPosition(Gtk.WindowPosition.Center);
dialogLogin.Destroyed += new EventHandler(dialogLogin_Destroyed);
dialogLogin.Show();
}
public void on_helpbuttonAuthentication_clicked(object sender, EventArgs args)
{
Common.ShowHelpUrl("CASAMasterPasswordAuthentication.htm");
}
internal void menuDestroyMiCasa_Activated(CasaMain casaMain, CasaTray tray)
{
mCasaInstance = casaMain;
mTrayInstance = tray;
// prompt user
MessageDialog md=new MessageDialog(null,Gtk.DialogFlags.Modal,
Gtk.MessageType.Warning,
Gtk.ButtonsType.OkCancel,
"This will destroy all of your miCASA secrets.\r\nAre you sure?");
md.SetPosition(Gtk.WindowPosition.Center);
md.Response +=new ResponseHandler(md_Response);
md.Modal = true;
md.SetIconFromFile(Common.CASAICONS);
md.Show();
}
private void md_Response(object o, ResponseArgs args)
{
if (args.ResponseId.Equals(Gtk.ResponseType.Ok))
{
MiCasaRequestReply.Send(MiCasaRequestReply.VERB_REMOVE_ALL_SECRETS);
if (mCasaInstance != null)
mCasaInstance.objMiCasa.AggregateStore();
}
MessageDialog md = (MessageDialog)o;
if (md != null)
{
md.Destroy();
}
}
private void md_Response2(object o, ResponseArgs args)
{
MessageDialog md = (MessageDialog)o;
if (md != null)
{
md.Destroy();
}
}
public void okbuttonLogin_clicked(object abj, EventArgs args)
{
if( 0 == miCASA.SetMasterPassword(0, entryMasterPassword3.Text) )
{
// unlock it
MiCasaRequestReply.Send(MiCasaRequestReply.VERB_UNLOCK_STORE, entryMasterPassword3.Text);
dialogLogin.Destroy();
}
else
{
// prompt user
MessageDialog md=new MessageDialog(
mainWindow,Gtk.DialogFlags.Modal,
Gtk.MessageType.Warning,
Gtk.ButtonsType.Ok,
"Master Password entered is incorrect");
md.Response +=new ResponseHandler(md_Response2);
md.SetPosition(Gtk.WindowPosition.CenterOnParent);
md.Modal = true;
md.SetIconFromFile(Common.CASAICONS);
md.Show();
}
}
public void closebuttonLogin_clicked(object abj, EventArgs args)
{
dialogLogin.Destroy();
}
public void OnDialogLoginDeleted(object obj, DeleteEventArgs args)
{
dialogLogin.Destroy();
args.RetVal = true;
}
public void on_entryMasterPassword3_activate(object obj, EventArgs args)
{
if( true == entryMasterPassword4.Visible )
entryMasterPassword4.HasFocus = true;
else if( "" != entryMasterPassword3.Text )
okbuttonLogin_clicked(obj, args);
}
public void on_entryMasterPassword4_activate(object obj, EventArgs args)
{
okbuttonLogin_clicked(obj, args);
}
private void dialogLogin_Destroyed(object sender, EventArgs e)
{
bool bStoreLocked = MiCASAStore.IsLocked();
if (mCasaInstance != null)
{
if (bStoreLocked)
mCasaInstance.LockGUI();
else
mCasaInstance.UnlockGUI();
}
if (mTrayInstance != null)
{
if (bStoreLocked)
mTrayInstance.UpdateTrayIcon(true);
else
mTrayInstance.UpdateTrayIcon(false);
}
}
#if W32
internal static string ReadRegKey(RegistryKey rk, string sSubKey, string KeyName)
{
// Opening the registry key
// RegistryKey rk = Registry.Users;
// Open a subKey as read-only
RegistryKey sk1 = rk.OpenSubKey(sSubKey);
// If the RegistrySubKey doesn't exist -> (null)
if ( sk1 == null )
{
return null;
}
else
{
try
{
// If the RegistryKey exists I get its value
// or null is returned.
return (string)sk1.GetValue(KeyName.ToUpper());
}
catch (Exception e)
{
//ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
return null;
}
}
}
internal static void WriteRegKey(RegistryKey rk, string sSubKey, string KeyName, string sKeyValue)
{
RegistryKey sk1 = rk.OpenSubKey(sSubKey, true);
// If the RegistrySubKey doesn't exist -> (null)
if ( sk1 == null )
{
//return null;
}
else
{
try
{
// If the RegistryKey exists I get its value
// or null is returned.
sk1.SetValue(KeyName, sKeyValue);
sk1.Close();
}
catch (Exception e)
{
sk1.Close();
//ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
//Console.Write(e.ToString());
Logger.DbgLog("GUI:CommonGUI.WriteRegKey EXCEPTION: \n" + e.ToString());
//return null;
}
}
}
#endif
}
}

624
gui/Firefox.cs Normal file
View File

@@ -0,0 +1,624 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI {
using System;
using System.Collections;
using System.Collections.Specialized;
using Gtk;
using Glade;
using Novell.CASA.MiCasa.Common;
using Novell.CASA.MiCasa.Communication;
public class Firefox : Store
{
Gtk.TreeStore tsSecretIDFirefox,
tsNativeInfoFirefox,
tsKeyValue;
CellRendererText cellEditable;
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,
dialogLogin,
dialogConfirmDelete,
dialogSpecialCharacter;
[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.gxmlMain.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.gxmlMain.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()
{
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");
}
public override void ClearViewOnStore()
{
tsSecretIDFirefox.Clear();
tsNativeInfoFirefox.Clear();
}
///#######################################################################
/// 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 = 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.gxmlMain.GetWidget("windowMain");
dialogManageSecret.Title = "Firefox - Manage Secret";
cellEditable = new CellRendererText();
cellEditable.Editable = true;
cellEditable.Edited += new EditedHandler(OnKeyValueEdited);
//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");
}
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>
/// EDIT KEY-VALUE
/// </summary>
public void OnKeyValueEdited(object obj, EditedArgs args)
{
Logger.DbgLog("GUI:Firefox.OnKeyValueEdited() - BEGIN");
TreeModel model;
TreeIter iter;
object val;
string KeyName = null,
KeyValue = null;
string[] Keys = null,
Values = null;
try
{
tvKeyValue.Selection.GetSelected (out model, out iter);
val = tsKeyValue.GetValue(iter,0);
KeyName = val.ToString();
if( true == cbuttonShowPassword.Active )
val = tsKeyValue.GetValue(iter,1);
else
val = tsKeyValue.GetValue(iter,2);
KeyValue = val.ToString();
tvSecretIDFirefox.Selection.GetSelected (out model, out iter);
if( false == entrySecretID.Editable )
{
if( ("" != args.NewText) && (Common.MAX_LEN >= args.NewText.Length) && (KeyValue != args.NewText) )
{
if( Common.STATUS_SUCCESS == StoreDataInterface.UpdateStore(Common.STORE_FIREFOX, Common.OPERATION_MODIFY_KEY, KeyName, args.NewText, ref model, ref iter) )
{
Logger.DbgLog("GUI:Firefox.OnKeyValueEdited() - StoreDataInterface.UpdateStore() succeeded");
tvKeyValue.Selection.GetSelected (out model, out iter);
tsKeyValue.SetValue(iter, 1, args.NewText);
tsKeyValue.SetValue(iter, 2, "********");
tvSecretIDFirefox.Selection.GetSelected (out model, out iter);
Keys = (string[]) model.GetValue(iter, 1);
Values = (string[]) model.GetValue(iter, 2);
for( int i=0; i< Keys.Length; i++ )
{
if( Keys[i] == KeyName )
{
Values[i] = args.NewText;
tsSecretIDFirefox.SetValue(iter, 2, Values);
break;
}
}
//AggregateStore();
}
else
Logger.DbgLog("GUI:Firefox.OnKeyValueEdited() - ERROR: STATUS_STORE_UPDATEFAILED");
}
}
else if( (Common.MAX_LEN >= args.NewText.Length) )
{
tvKeyValue.Selection.GetSelected (out model, out iter);
tsKeyValue.SetValue(iter, 1, args.NewText);
tsKeyValue.SetValue(iter, 2, "********");
}
}
catch(Exception exp)
{
Logger.DbgLog("GUI:Firefox.OnKeyValueEdited() - EXCEPTION:" + exp.ToString());
}
Logger.DbgLog("GUI:Firefox.OnKeyValueEdited() - END");
}
/// <summary>
/// ADD BUTTON CLICKED
/// </summary>
public void on_buttonNewAdd_clicked(object obj, EventArgs args)
{
}
public void on_buttonSCClose_clicked(object obj, EventArgs args)
{
dialogSpecialCharacter.Destroy();
}
/// <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 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;
}
}
/// <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)
{
Logger.DbgLog("GUI:Firefox.OnDeleteActivated() - BEGIN");
if( 0 != tvSecretIDFirefox.Selection.CountSelectedRows() )
{
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogConfirmDelete", null);
gxmlTemp.Autoconnect (this);
dialogConfirmDelete.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");
dialogConfirmDelete.Title = "Firefox - Delete Secret";
TreeModel model;
TreeIter iter;
string selected = null;
if( tvSecretIDFirefox.Selection.GetSelected (out model, out iter) )
{
selected = (string) model.GetValue (iter, 0);
if( (null != selected) && (selected.Length > 0) )
entryDeleteSecretID.Text = selected;
}
}
Logger.DbgLog("GUI:Firefox.OnDeleteActivated() - END");
}
public void on_buttonYes_clicked(object obj, EventArgs args)
{
Logger.DbgLog("GUI:Firefox.on_buttonYes_clicked() - BEGIN");
TreeModel model;
TreeIter iter;
try
{
if( tvSecretIDFirefox.Selection.GetSelected (out model, out iter) )
{
if( Common.STATUS_SUCCESS == StoreDataInterface.UpdateStore(Common.STORE_FIREFOX, Common.OPERATION_DELETE_SECRET, "", "", ref model, ref iter) )
{
tsSecretIDFirefox.Remove(ref iter);
tvSecretIDFirefox.ColumnsAutosize();
tsNativeInfoFirefox.Clear();
dialogConfirmDelete.Destroy();
Logger.DbgLog("GUI:Firefox.on_buttonYes_clicked() - DELETE_SECRET_SUCCEEDED");
}
else
Logger.DbgLog("GUI:Firefox.on_buttonYes_clicked() - DELETE_SECRET_FAILED");
}
}
catch(Exception exp)
{
Logger.DbgLog("GUI:Firefox.on_buttonYes_clicked() - EXCEPTION:" + exp.ToString());
}
Logger.DbgLog("GUI:Firefox.on_buttonYes_clicked() - END");
}
public void on_buttonNo_clicked(object obj, EventArgs args)
{
dialogConfirmDelete.Destroy();
}
///#######################################################################
/// 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)
{
}
}
}
///##################################################################
/// END OF FILE
///##################################################################

1104
gui/GnomeKeyring.cs Normal file

File diff suppressed because it is too large Load Diff

1124
gui/KdeWallet.cs Normal file

File diff suppressed because it is too large Load Diff

148
gui/Logger.cs Normal file
View File

@@ -0,0 +1,148 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI
{
using System;
using System.Text;
using System.Diagnostics;
using System.IO;
using System.Threading;
using Gtk;
class Logger
{
private static string debugLog = null;
private static Stream debugStream= null;
private static Mutex dbgmutex = new Mutex();
static Gtk.TreeStore tsLog;
static Logger()
{
#if DEBUG
debugLog = GetHomeDir() + "/.CASAManager.logs";
// Set up for Debug
if( File.Exists( debugLog ) )
{
File.Delete( debugLog );
}
debugStream = File.Create(debugLog);
Debug.Listeners.Add(new TextWriterTraceListener(debugStream));
Debug.AutoFlush = true;
Debug.Indent();
Debug.WriteLine("Debug Log created");
#endif
}
public static void ActivateLogWindow(Gtk.TreeView tvLog)
{
tsLog = new TreeStore(typeof(string));
tvLog.Model = tsLog;
}
public static void StopLogWindow()
{
tsLog = null;
}
public static void logbreak()
{
dbgmutex.WaitOne();
Debug.WriteLine(" ") ;
Debug.WriteLine("----------------------------------------------------") ;
Debug.WriteLine(" ") ;
dbgmutex.ReleaseMutex();
}
// The log format is Time stamp :Component name: Error description
public static void DbgLog(string message)
{
if (tsLog != null)
{
tsLog.AppendValues(DateTime.Now.ToLongTimeString()
+ ":"
+ message);
}
#if DEBUG
dbgmutex.WaitOne();
Debug.Write(DateTime.Now.ToLongTimeString());
Debug.Write(" " + DateTime.Now.ToLongDateString());
Debug.Write(":");
Debug.WriteLine(message);
dbgmutex.ReleaseMutex();
#endif
}
public static void ExpLog(string message)
{
if (tsLog != null)
{
tsLog.AppendValues(DateTime.Now.ToLongTimeString()
+ ": Exception encountered - ");
tsLog.AppendValues(message);
StackTrace st1 = new StackTrace();
tsLog.AppendValues(st1.ToString());
}
#if DEBUG
dbgmutex.WaitOne();
Debug.Write(DateTime.Now.ToLongTimeString());
Debug.Write(" " + DateTime.Now.ToLongDateString());
Debug.Write(": Exception encountered - ");
Debug.WriteLine(message);
Debug.WriteLine(" ") ;
StackTrace st = new StackTrace();
Debug.WriteLine(st.ToString());
dbgmutex.ReleaseMutex();
#endif
}
static string GetHomeDir()
{
int platform = (int)Environment.OSVersion.Platform;
if ( (platform == 128) || ( platform == 4) )
{
return System.Environment.GetEnvironmentVariable("HOME");
}
else
{
return (System.Environment.GetEnvironmentVariable("HOMEDRIVE")) +
(System.Environment.GetEnvironmentVariable("HOMEPATH"));
}
}
}
}

135
gui/Makefile.am Normal file
View File

@@ -0,0 +1,135 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#######################################################################
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
CS_EXTRA_FLAGS = $(CSCFLAGS_DEBUG)
else
TARGET_CFG = Release
endif
SUBDIRS =
DIST_SUBDIRS =
EXTRA_DIST = $(CSFILES) *.sh CASAManager.* help/en/*.htm help/en/*.gif \
images/*.png images/*.ico images/*.glade* \
images/*.bmp
#EXTRA_DIST = $(CSFILES) help/en help/en/*.htm help/en/*.gif \
# images/*.png images/*.ico images/*.glade* \
# images/*.bmp
CASAROOT = ..
CASALIBDIR = $(CASAROOT)/$(LIB)/$(TARGET_CFG)
if LIB64
CASABINDIR = $(CASAROOT)/bin64
else
CASABINDIR = $(CASAROOT)/bin
endif
# handle Mono secondary dependencies
export MONO_PATH := $(MONO_PATH)
PLATFORMINDEPENDENTSOURCEDIR =
PLATFORMDEPENDENTSOURCEDIR = .
MODULE_NAME =CASAManager
MODULE_EXT =exe
CSFILES =$(srcdir)/AssemblyInfo.cs \
$(srcdir)/CasaMain.cs \
$(srcdir)/CasaTray.cs \
$(srcdir)/TrayLib.cs \
$(srcdir)/Firefox.cs \
$(srcdir)/GnomeKeyring.cs \
$(srcdir)/KdeWallet.cs \
$(srcdir)/Logger.cs \
$(srcdir)/MiCasa.cs \
$(srcdir)/Mozilla.cs \
$(srcdir)/Store.cs \
$(srcdir)/StoreDataInterface.cs \
$(srcdir)/StorePolicyInterface.cs \
$(srcdir)/CommonGUI.cs \
$(srcdir)/Common.cs
CSFILES_CSC := $(subst /,$(SEP),$(CSFILES))
CS_FLAGS = -pkg:gtk-sharp -pkg:glade-sharp -d:LINUX -nowarn:169
CS_RESOURCES =
CS_LIBS =$(CASALIBDIR)/Novell.CASA.Common.dll \
$(CASALIBDIR)/Novell.CASA.miCASAWrapper.dll \
$(CASALIBDIR)/Novell.CASA.A-D.dll \
$(CASALIBDIR)/Novell.CASA.CASAPolicy.dll
CS_LIBPATH = ../c_micasad/test/dependencies \
$(CASALIBDIR)
OBJDIR = ./$(TARGET_CFG)/$(LIB)
#OBJS = $(addprefix $(OBJDIR)/, $(CSFILES:%.dll=%.cs))
CUR_DIR := $(shell pwd)
all: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
#
# Pattern based rules.
#
vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cs $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(CSFILES)
$(CSC) $(CS_FLAGS) $(CS_EXTRA_FLAGS) $(CS_LIBPATH:%=-lib:%) $(CS_LIBS:%=/r:%) -out:$@ $(CSFILES_CSC)
cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(CASABINDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
#$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(OBJS)
# @echo [======== Linking $@ ========]
# $(LINK) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
# cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
[ -d $(CASABINDIR) ] || mkdir -p $(CASABINDIR)
[ -d $(CASABINDIR)/$(TARGET_CFG) ] || mkdir -p $(CASABINDIR)/$(TARGET_CFG)
install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/
uninstall-local:
cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
rmdir $(DESTDIR)$(libdir)
#installcheck-local: install
# $(mkinstalldirs) $(DESTDIR)$(libdir)
# $(INSTALL_PROGRAM) $(DESTDIR)$(libdir)
# cd $(DESTDIR)$(libdir); $(MONO)
clean-local:
if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi
distclean-local:
maintainer-clean-local:
rm -f Makefile.in

1271
gui/MiCasa.cs Normal file

File diff suppressed because it is too large Load Diff

49
gui/Mozilla.cs Normal file
View File

@@ -0,0 +1,49 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI {
using System;
using Gtk;
using Glade;
public class Mozilla : Store
{
public override void AggregateStore()
{
}
public override void ClearViewOnStore()
{
}
public override void ViewKeyValues()
{
}
}
}
///##################################################################
/// END OF FILE
///##################################################################

57
gui/Store.cs Normal file
View File

@@ -0,0 +1,57 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI {
using System;
using Gtk;
using Glade;
public abstract class Store
{
///#######################################################################
/// <summary>
/// Clears the TreeStore and invokes ReadStore() to aggregate
/// respective stores.
/// </summary>
public abstract void AggregateStore();
///#######################################################################
/// <summary>
/// Clears the TreeStore object for the
/// respective stores.
/// </summary>
public abstract void ClearViewOnStore();
///#######################################################################
/// <summary>
///
/// </summary>
public abstract void ViewKeyValues();
}
}
///##################################################################
/// END OF FILE
///##################################################################

889
gui/StoreDataInterface.cs Normal file
View File

@@ -0,0 +1,889 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI {
using System;
using System.IO;
using System.Collections;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
using GLib;
using Gtk;
using Novell.CASA.DataEngines;
public class StoreDataInterface
{
private static XmlDocument ccfDoc;
private static AD ad;
private const string CCFXML_ELEMENT_MICASA_KEYCHAIN = "Keychain",
CCFXML_ELEMENT_GKEYRING_KEYRING = "Keyring",
CCFXML_ELEMENT_KWALLET_WALLET = "Wallet",
CCFXML_ELEMENT_FIREFOX_PROFILE = "Profile",
CCFXML_ELEMENT_SECRET = "Secret",
CCFXML_ELEMENT_FOLDER = "Folder",
CCFXML_ATTRIBUTE_FOLDERNAME = "Name",
CCFXML_ELEMENT_TYPE = "Type",
CCFXML_ELEMENT_KEY = "Key",
CCFXML_ELEMENT_VALUE = "Value",
CCFXML_ELEMENT_TIME = "Time",
CCFXML_ELEMENT_TIME_ZONE = "Zone",
CCFXML_ELEMENT_TIME_CREATION = "Creation",
CCFXML_ELEMENT_TIME_MODIFIED = "Modified",
CCFXML_ELEMENT_TIME_ACCESSED = "Accessed",
CCFXML_ATTRIBUTE_ID = "ID",
CCFXML_ATTRIBUTE_MICASA_SYNCH = "Synch",
CCFXML_ATTRIBUTE_GKEYRING_TYPE = "Type",
CCFXML_ATTRIBUTE_WALLETLASTACCESSEDTIME = "LastAcctime";
///#######################################################################
/// INIT
/// <summary>
/// Initializes the CCF from miCASA-D
/// </summary>
public static int Init()
{
Logger.DbgLog("GUI:StoreDataInterface.StoreDataInterface() - BEGIN");
try
{
ccfDoc = new XmlDocument();
ad = new AD();
//Init CCF from a XML Document -FIXME: -Remove this
//ccfDoc.Load("ccfv3.xml");
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StoreDataInterface.Init() - EXCEPTION" + exp.ToString());
//Common.ShowErrorDialog( exp );
return( Common.STATUS_STORE_ADINITFAILED );
}
Logger.DbgLog("GUI:StoreDataInterface.StoreDataInterface() - END");
return( Common.STATUS_SUCCESS );
}
///#######################################################################
/// AGGREGATE A SPECIFIC STORE
/// <summary>
/// Initializes the CCF from miCASA-D
/// </summary>
public static int AggregateStore(int storeIDentifier)
{
Logger.DbgLog("GUI:StoreDataInterface.AggregateStore()");
try
{
return( ad.AggregateStore(ccfDoc, storeIDentifier) );
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StoreDataInterface.AggregateStore() - EXCEPTION" + exp.ToString());
return( Common.STATUS_STORE_AGGREGATEFAILED );
}
}
///#######################################################################
/// REFRESH ALL STORES
/// <summary>
/// Initializes the CCF from miCASA-D
/// </summary>
public static int RefreshAllStores()
{
Logger.DbgLog("GUI:StoreDataInterface.RefreshAllStores() - BEGIN");
try
{
ccfDoc = ad.Aggregate();
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StoreDataInterface.RefreshAllStores() - EXCEPTION" + exp.ToString());
return( Common.STATUS_STORE_AGGREGATEFAILED );
}
Logger.DbgLog("GUI:StoreDataInterface.RefreshAllStores() - END");
return( Common.STATUS_SUCCESS );
}
///#######################################################################
/// MASTER PASSWORD
/// <summary>
///
/// </summary>
public static bool IsMasterPasswordSet(int StoreID)
{
return( ad.IsMasterPasswordSet(StoreID) );
}
public static bool VerifyMasterPassword(string masterPassword, int StoreID)
{
return( ad.VerifyMasterPassword(masterPassword, StoreID) );
}
///#######################################################################
/// READ STORE
/// <summary>
/// Gets the GUI Data store
/// </summary>
public static int ReadStore(int storeIDentifier,ref Gtk.TreeStore ls)
{
Logger.DbgLog("GUI:StoreDataInterface.ReadStore()");
//Common Keys
string storeChainKey = CCFXML_ELEMENT_MICASA_KEYCHAIN;
//TreeStore structure
string secretID = null;
string[] strKeyArray = null;
string[] strValueArray = null;
string storeID = null;
string[] strNativeKeyArray = new string[Common.MAX_NATIVE_ELEMENTS];
string[] strNativeValueArray = new string[Common.MAX_NATIVE_ELEMENTS];
//Vars for ccf data
string folderName = null;
string typeID = null;
string modifiedTime = null;
string synch = null;
string synchType = null;
//Flags & Variables
bool bKey = false;
bool bEndOfSecret = false;
//bool bEndOfTime=false;
string ccfPath = null;
//Counters
int noOfSecretsFound = 0;
int noOfKeys = 0;
int noOfKeysFound = 0;
//Init Native Information TypeNames
strNativeKeyArray[Common.INDEX_NATIVEINFO_FOLDERNAME] = Common.NATIVEINFO_FOLDERNAME;
strNativeKeyArray[Common.INDEX_NATIVEINFO_TYPEID] = Common.NATIVEINFO_TYPEID;
strNativeKeyArray[Common.INDEX_NATIVEINFO_SYNC] = Common.NATIVEINFO_SYNC;
strNativeKeyArray[Common.INDEX_NATIVEINFO_SYNCTYPE] = Common.NATIVEINFO_SYNCTYPE;
strNativeKeyArray[Common.INDEX_NATIVEINFO_MODIFIEDTIME] = Common.NATIVEINFO_MODIFIEDTIME;
//Form the XPATH Query definitions
if( storeIDentifier == Common.STORE_MICASA )
{
ccfPath = "//CCF/miCASA";
storeChainKey = CCFXML_ELEMENT_MICASA_KEYCHAIN;
}
else if( storeIDentifier == Common.STORE_GNOMEKEYRING )
{
ccfPath = "//CCF/GK";
storeChainKey = CCFXML_ELEMENT_GKEYRING_KEYRING;
}
else if( storeIDentifier == Common.STORE_KDEWALLET )
{
ccfPath = "//CCF/KWallet";
storeChainKey = CCFXML_ELEMENT_KWALLET_WALLET;
}
else if( storeIDentifier == Common.STORE_FIREFOX )
{
ccfPath = "//CCF/FireFox";
storeChainKey = CCFXML_ELEMENT_FIREFOX_PROFILE;
}
else
return( Common.STATUS_STORE_INVALIDSTOREID );
try
{
XPathNavigator nav = ccfDoc.CreateNavigator();
XPathNodeIterator iter = null;
string ccfExtPath = null;
//Query on the CCF and point to the store
iter = nav.Select(ccfPath);
if( 0 == iter.Count )
return( Common.STATUS_STORE_DATANOTFOUNDINSTORE );
//Enumerate all store instances [storeID's-Keychain\Wallet\Profile\Keyring]
while( iter.MoveNext() )
{//Get Next Store instance. Ideally this should always be 1
//Get all descendants of this store. Ideally this should always be keychains
//So this should get all keychains of this store.
XPathNodeIterator iterSecret = iter.Current.SelectDescendants( XPathNodeType.Element,false );
while( iterSecret.MoveNext() )
{//Enumerate this Keychain\Wallet\Profile\Keyring
if( true == iterSecret.Current.HasAttributes )
{//Elements With attributes, get the attributes first before going to next sub element
if( iterSecret.Current.Name.Equals(storeChainKey) )
{//miCASA-KeyChain //GK-Keyring //KWallet-Wallet
iterSecret.Current.MoveToFirstAttribute();
do
{
//Keychain\Wallet\Profile\Keyring ID
if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_ID) )
{
storeID = iterSecret.Current.Value;
}
}while( iterSecret.Current.MoveToNextAttribute() );
iterSecret.Current.MoveToParent();
}
else if( iterSecret.Current.Name.Equals(CCFXML_ELEMENT_SECRET) )
{//miCASA-KeyChain-Secret:secretID
noOfSecretsFound++;
iterSecret.Current.MoveToFirstAttribute();
do
{
if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_ID) )
{
secretID = iterSecret.Current.Value;
}
else if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_MICASA_SYNCH) )
{
synch = iterSecret.Current.Value;
}
else if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_GKEYRING_TYPE) )
{
//synchType = iterSecret.Current.Value;
typeID = iterSecret.Current.Value;
}
}while( iterSecret.Current.MoveToNextAttribute() );
iterSecret.Current.MoveToParent();
//Now get more details about the secret
//End of secret is after read of all keys of the secret
{
XPathNodeIterator secIter;
ccfExtPath = "Key";
secIter = iterSecret.Current.Select(ccfExtPath);
noOfKeys = secIter.Count;
//Reinit arrays to the no of keys for this secret
strKeyArray = new string[noOfKeys];
strValueArray = new string[noOfKeys];
//Get Last Modified Time for the secret
ccfExtPath = CCFXML_ELEMENT_TIME + "/" + CCFXML_ELEMENT_TIME_MODIFIED;
secIter = iterSecret.Current.Select(ccfExtPath);
if( 0 != secIter.Count )
{
while( secIter.MoveNext() )
{//Enumerate the Time Nodes of this secret
if( secIter.Current.Name.Equals(CCFXML_ELEMENT_TIME_MODIFIED) )
{//miCASA-KeyChain-Secret-Key-Value-Time-modified
modifiedTime = secIter.Current.Value;
}
}
}
}
}
else if( iterSecret.Current.Name.Equals(CCFXML_ELEMENT_KEY) )
{//miCASA-KeyChain-Secret-Key:ID
iterSecret.Current.MoveToFirstAttribute();
do
{
if( (iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_ID)) && (noOfKeysFound<=noOfKeys) )
{
bKey = true;
strKeyArray[noOfKeysFound] = iterSecret.Current.Value; //KeyName
}
}while( iterSecret.Current.MoveToNextAttribute() );
iterSecret.Current.MoveToParent();
}
else if( iterSecret.Current.Name.Equals(CCFXML_ELEMENT_FOLDER) )
{//Folder:
iterSecret.Current.MoveToFirstAttribute();
do
{
if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_FOLDERNAME) )
{//Folder:Name
folderName = iterSecret.Current.Value;
}
}while( iterSecret.Current.MoveToNextAttribute() );
iterSecret.Current.MoveToParent();
}
else if( iterSecret.Current.Name.Equals(CCFXML_ELEMENT_TYPE) )
{//Type:
iterSecret.Current.MoveToFirstAttribute();
do
{
if( iterSecret.Current.LocalName.Equals(CCFXML_ATTRIBUTE_ID) )
{//Type:ID
typeID = iterSecret.Current.Value;
}
}while( iterSecret.Current.MoveToNextAttribute() );
iterSecret.Current.MoveToParent();
}
}//Elements Without attributes,Get element values and then go to next subelement
else if( iterSecret.Current.Name.Equals(CCFXML_ELEMENT_VALUE) )
{//miCASA-KeyChain-Secret-Key-Value:<Value>
if( true == bKey )
{
//Update Corresponding KeyValue
strValueArray[noOfKeysFound++] = iterSecret.Current.Value; //KeyValue
bKey = false;
//Are alll keys read? If so its the end of the secret
if( noOfKeysFound == noOfKeys )
bEndOfSecret = true;
}
}
//Update this Secret to the GUI Store
if( true == bEndOfSecret )
{
//Updating TreeStore Native Array structure
strNativeValueArray = new string[Common.MAX_NATIVE_ELEMENTS];
strNativeValueArray[Common.INDEX_NATIVEINFO_FOLDERNAME] = folderName;
strNativeValueArray[Common.INDEX_NATIVEINFO_TYPEID] = typeID;
strNativeValueArray[Common.INDEX_NATIVEINFO_SYNC] = synch;
strNativeValueArray[Common.INDEX_NATIVEINFO_SYNCTYPE] = synchType;
strNativeValueArray[Common.INDEX_NATIVEINFO_MODIFIEDTIME] = modifiedTime;
//Console.WriteLine("folderName="+folderName+"\n"+"typeID="+typeID+"\n"+"synch="+synch+"\n"+"synchType="+synchType+"\n"+"modifiedTime="+modifiedTime);
ls.AppendValues(secretID,strKeyArray,strValueArray,storeID,strNativeKeyArray,strNativeValueArray);
//Re-Initialize for next iteration
secretID = "";
noOfKeysFound = 0;
noOfKeys = 0;
bKey = false;
//bTime=false;- For Use Later
bEndOfSecret = false;
}
}
}
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StoreDataInterface.ReadStore() - EXCEPTION" + exp.ToString());
return( Common.STATUS_STORE_READFAILED );
}
//ShowDocOnConsole("READ STORE:");
return( Common.STATUS_SUCCESS );
}
///#######################################################################
/// UPDATE STORE: ADD NEW secret/keyvalue, MODIFY keyvalue, DELETE secret
/// <summary>
/// Supported Update Functionalities - on miCASA Store only
/// </summary>
public static int UpdateStore(int storeIDentifier,int operation,string keyID,string valueToBeModfied,ref TreeModel model,ref TreeIter iter)
{
Logger.DbgLog("GUI:StoreDataInterface.UpdateStore()");
//TreeStore row elements
string storeChainKey = null;
string SecretID = null;
string keyChainID = null;
string[] strKeyArray = new string[Common.MAX_ARRAY_ELEMENTS];
string[] strValueArray = new string[Common.MAX_ARRAY_ELEMENTS];
string[] strNativeValueArray = new string[Common.MAX_NATIVE_ELEMENTS];
//XPATH query strings
string ccfRootStorePath = null;
string ccfKeyChainPath = null;
string ccfSecretPath = null;
//Intialization of New Secret\Key elements
XmlElement newKeychainElement = ccfDoc.CreateElement(CCFXML_ELEMENT_MICASA_KEYCHAIN);
XmlElement newSecretElement = ccfDoc.CreateElement(CCFXML_ELEMENT_SECRET);
XmlElement newKeyElement = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
//Reading and Initialzing from the passed iter object
SecretID = (string) model.GetValue (iter, 0);
strKeyArray = (string[]) model.GetValue (iter, 1);
strValueArray = (string[]) model.GetValue (iter, 2);
keyChainID = (string) model.GetValue (iter, 3);
strNativeValueArray = (string[]) model.GetValue (iter, 5);
try
{
//Form the query to reach to an element for modify\delete\add
if( Common.STORE_MICASA == storeIDentifier )
{
storeChainKey = CCFXML_ELEMENT_MICASA_KEYCHAIN;
ccfRootStorePath = "//CCF/miCASA";
if( Common.OPERATION_MODIFY_KEY == operation || Common.OPERATION_DELETE_KEY == operation )
{
ccfSecretPath = "//CCF/miCASA/Keychain[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']/Key[@ID='" + keyID + "']";
}
else if( Common.OPERATION_DELETE_SECRET == operation )
{
ccfKeyChainPath = "//CCF/miCASA/Keychain[@ID='" + keyChainID + "']";
ccfSecretPath = "Secret[@ID='" + SecretID + "']";
}
else if( Common.OPERATION_ADD_SECRET == operation )
{
ccfKeyChainPath = "//CCF/miCASA/Keychain[@ID='" + keyChainID + "']";
ccfSecretPath = "//CCF/miCASA/Keychain[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']";
//Create the Secret element
newSecretElement = ccfDoc.CreateElement(CCFXML_ELEMENT_SECRET);
newSecretElement.SetAttribute(CCFXML_ATTRIBUTE_ID,SecretID);
newSecretElement.SetAttribute(CCFXML_ATTRIBUTE_MICASA_SYNCH,"NSL");
//Add all keys from strKeyArray to the new secret
for( int i=0; i< strKeyArray.Length; i++)
{
XmlElement newKey = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
newKey.SetAttribute(CCFXML_ATTRIBUTE_ID,strKeyArray[i]);
XmlElement newValue = ccfDoc.CreateElement(CCFXML_ELEMENT_VALUE);
newValue.InnerText = strValueArray[i];
newKey.AppendChild(newValue);
newSecretElement.AppendChild(newKey);
}
//Time
XmlElement newTime = ccfDoc.CreateElement(CCFXML_ELEMENT_TIME);
XmlElement newZone = ccfDoc.CreateElement(CCFXML_ELEMENT_TIME_ZONE);
newZone.InnerText = "IST";
newTime.AppendChild(newZone);
XmlElement newCreateTime = ccfDoc.CreateElement(CCFXML_ELEMENT_TIME_CREATION);
newCreateTime.InnerText = "1234";
newTime.AppendChild(newCreateTime);
XmlElement newModifiedTime = ccfDoc.CreateElement(CCFXML_ELEMENT_TIME_MODIFIED);
newModifiedTime.InnerText = "5678";
newTime.AppendChild(newModifiedTime);
XmlElement newAccessedTime = ccfDoc.CreateElement(CCFXML_ELEMENT_TIME_ACCESSED);
newAccessedTime.InnerText = "9012";
newTime.AppendChild(newAccessedTime);
newSecretElement.AppendChild(newTime);
//Create the keychain element
newKeychainElement = ccfDoc.CreateElement(storeChainKey);
newKeychainElement.SetAttribute(CCFXML_ATTRIBUTE_ID,keyChainID);
newKeychainElement.AppendChild(newSecretElement);
}
else if( Common.OPERATION_ADD_KEY == operation )
{
ccfKeyChainPath = "//CCF/miCASA/Keychain[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']";
ccfSecretPath = "";
//Create the Key element
newKeyElement = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
newKeyElement.SetAttribute(CCFXML_ATTRIBUTE_ID,keyID);
XmlElement newValue = ccfDoc.CreateElement(CCFXML_ELEMENT_VALUE);
newValue.InnerText = valueToBeModfied;
newKeyElement.AppendChild(newValue);
}
}
else if( Common.STORE_GNOMEKEYRING == storeIDentifier )
{
storeChainKey = CCFXML_ELEMENT_GKEYRING_KEYRING;
ccfRootStorePath = "//CCF/GK";
if( Common.OPERATION_MODIFY_KEY == operation || Common.OPERATION_DELETE_KEY == operation )
{
ccfSecretPath = "//CCF/GK/Keyring[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']/Key[@ID='" + keyID + "']";
//Console.WriteLine("OPERATION_MODIFY_KEY-OR-OPERATION_DELETE_KEY:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
}
else if( Common.OPERATION_DELETE_SECRET == operation )
{
ccfKeyChainPath = "//CCF/GK/Keyring[@ID='" + keyChainID + "']";
ccfSecretPath = "Secret[@ID='" + SecretID + "']";
//Console.WriteLine("OPERATION_DELETE_SECRET:ccfKeyChainPath:"+ccfKeyChainPath);//FIXME:Remove this line
//Console.WriteLine("OPERATION_DELETE_SECRET:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
}
else if( Common.OPERATION_ADD_SECRET == operation )
{
string typeID = strNativeValueArray[Common.INDEX_NATIVEINFO_TYPEID];
string walletLastAccessedTime = strNativeValueArray[Common.INDEX_NATIVEINFO_WALLETLASTACCESSEDTIME];
ccfKeyChainPath = "//CCF/GK/Keyring[@ID='" + keyChainID + "']";//Default keyChainID:CASAKeyring
ccfSecretPath = "//CCF/GK/Keyring[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']";
//Console.WriteLine("OPERATION_ADD_SECRET:ccfKeyChainPath:"+ccfKeyChainPath);//FIXME:Remove this line
//Console.WriteLine("OPERATION_ADD_SECRET:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
//Create the Secret element
newSecretElement = ccfDoc.CreateElement(CCFXML_ELEMENT_SECRET);
newSecretElement.SetAttribute(CCFXML_ATTRIBUTE_ID,SecretID);
newSecretElement.SetAttribute(CCFXML_ATTRIBUTE_GKEYRING_TYPE,typeID); //Default typeID:Password
//Add all keys from strKeyArray to the new secret
for( int i=0; i< strKeyArray.Length; i++)
{
XmlElement newKey = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
newKey.SetAttribute(CCFXML_ATTRIBUTE_ID,strKeyArray[i]);
XmlElement newValue = ccfDoc.CreateElement(CCFXML_ELEMENT_VALUE);
newValue.InnerText = strValueArray[i];
newKey.AppendChild(newValue);
newSecretElement.AppendChild(newKey);
}
//Create the keychain element
newKeychainElement = ccfDoc.CreateElement(storeChainKey);
newKeychainElement.SetAttribute(CCFXML_ATTRIBUTE_ID,keyChainID);
//newKeychainElement.SetAttribute(CCFXML_ATTRIBUTE_WALLETLASTACCESSEDTIME,walletLastAccessedTime);
newKeychainElement.AppendChild(newSecretElement);
}
else if( Common.OPERATION_ADD_KEY == operation )
{
ccfKeyChainPath = "//CCF/GK/Keyring[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']";
ccfSecretPath = "";
//Create the Key element
newKeyElement = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
newKeyElement.SetAttribute(CCFXML_ATTRIBUTE_ID,keyID);
XmlElement newValue = ccfDoc.CreateElement(CCFXML_ELEMENT_VALUE);
newValue.InnerText = valueToBeModfied;
newKeyElement.AppendChild(newValue);
}
}
else if( Common.STORE_KDEWALLET == storeIDentifier )
{
string folderName = strNativeValueArray[Common.INDEX_NATIVEINFO_FOLDERNAME];
string typeID = strNativeValueArray[Common.INDEX_NATIVEINFO_TYPEID];
storeChainKey = CCFXML_ELEMENT_KWALLET_WALLET;
ccfRootStorePath = "//CCF/KWallet";
if( Common.OPERATION_MODIFY_KEY == operation || Common.OPERATION_DELETE_KEY == operation )
{
ccfSecretPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']/Secret[@ID='" + SecretID + "']/Key[@ID='" + keyID + "']";
//Console.WriteLine("OPERATION_MODIFY_KEY-OR-OPERATION_DELETE_KEY:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
}
else if( Common.OPERATION_DELETE_SECRET == operation )
{
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']";
ccfSecretPath = "Secret[@ID='" + SecretID + "']";
//Console.WriteLine("OPERATION_DELETE_SECRET:ccfKeyChainPath:"+ccfKeyChainPath);//FIXME:Remove this line
//Console.WriteLine("OPERATION_DELETE_SECRET:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
}
else if( Common.OPERATION_ADD_SECRET == operation )
{
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']";
ccfSecretPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']/Secret[@ID='" + SecretID + "']";
//Console.WriteLine("OPERATION_ADD_SECRET:ccfKeyChainPath:"+ccfKeyChainPath);//FIXME:Remove this line
//Console.WriteLine("OPERATION_ADD_SECRET:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
//Create the Secret element
newSecretElement = ccfDoc.CreateElement(CCFXML_ELEMENT_SECRET);
newSecretElement.SetAttribute(CCFXML_ATTRIBUTE_ID,SecretID);
//Add all keys from strKeyArray to the new secret
for( int i=0; i< strKeyArray.Length; i++)
{
XmlElement newKey = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
newKey.SetAttribute(CCFXML_ATTRIBUTE_ID,strKeyArray[i]);
XmlElement newValue = ccfDoc.CreateElement(CCFXML_ELEMENT_VALUE);
newValue.InnerText = strValueArray[i];
newKey.AppendChild(newValue);
newSecretElement.AppendChild(newKey);
}
}
else if( Common.OPERATION_ADD_KEY == operation )
{
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']/Secret[@ID='" + SecretID + "']";
ccfSecretPath = "";
//Create the Key element
newKeyElement = ccfDoc.CreateElement(CCFXML_ELEMENT_KEY);
newKeyElement.SetAttribute(CCFXML_ATTRIBUTE_ID,keyID);
XmlElement newValue = ccfDoc.CreateElement(CCFXML_ELEMENT_VALUE);
newValue.InnerText = valueToBeModfied;
newKeyElement.AppendChild(newValue);
}
}
else if( Common.STORE_FIREFOX == storeIDentifier )
{
storeChainKey = CCFXML_ELEMENT_FIREFOX_PROFILE;
ccfRootStorePath = "//CCF/FireFox";
if( Common.OPERATION_MODIFY_KEY == operation || Common.OPERATION_DELETE_KEY == operation )
{
ccfSecretPath = "//CCF/FireFox/Profile[@ID='" + keyChainID + "']/Secret[@ID='" + SecretID + "']/Key[@ID='" + keyID + "']";
//Console.WriteLine("OPERATION_MODIFY_KEY-OR-OPERATION_DELETE_KEY:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
}
else if( Common.OPERATION_DELETE_SECRET == operation )
{
ccfKeyChainPath = "//CCF/FireFox/Profile[@ID='" + keyChainID + "']";
ccfSecretPath = "Secret[@ID='" + SecretID + "']";
//Console.WriteLine("OPERATION_DELETE_SECRET:ccfKeyChainPath:"+ccfKeyChainPath);//FIXME:Remove this line
//Console.WriteLine("OPERATION_DELETE_SECRET:ccfSecretPath:"+ccfSecretPath);//FIXME:Remove this line
}
}
else
return( Common.STATUS_STORE_UNSUPPORTEDOPERATION );
//Execution of the query's
if( Common.OPERATION_MODIFY_KEY == operation )
{
//For Modify operation get to the Node in the tree which needs to be modified
XmlNode root = ccfDoc.DocumentElement;
XmlNodeList keylist = root.SelectNodes(ccfSecretPath);
foreach ( XmlNode key in keylist )
{
key.ChildNodes[0].InnerText=valueToBeModfied ;
//Console.WriteLine("EXECUTING OPERATION_MODIFY_KEY:Modifying"+ccfSecretPath);//FIXME:Remove this line
ad.SetSecret(key.ParentNode,operation,storeIDentifier);
}
}
else if( Common.OPERATION_DELETE_SECRET == operation )
{
//Delete the specific secret from the keychain
XmlNode root = ccfDoc.DocumentElement;
XmlNodeList keychainNodeList = root.SelectNodes(ccfKeyChainPath);
foreach( XmlNode keychain in keychainNodeList )
{
XmlNodeList secretNodelist = keychain.SelectNodes(ccfSecretPath);
foreach ( XmlNode secret in secretNodelist )
{
//Console.WriteLine("EXECUTING OPERATION_DELETE_SECRET:Deleting"+ccfSecretPath);//FIXME:Remove this line
ad.Remove(secret,storeIDentifier);
}
}
}
else if( Common.OPERATION_DELETE_KEY == operation )
{
//For Modify operation get to the Node in the tree which needs to be modified
XmlNode root = ccfDoc.DocumentElement;
XmlNodeList keylist = root.SelectNodes(ccfSecretPath);
foreach ( XmlNode key in keylist )
{
XmlNode keyParentNode = key.ParentNode;
key.ParentNode.RemoveChild(key);
//Console.WriteLine("EXECUTING OPERATION_DELETE_KEY:Deleting"+ccfSecretPath);//FIXME:Remove this line
//ad.SetSecret(keyParentNode,storeIDentifier);
ad.SetSecret(keyParentNode,Common.OPERATION_MODIFY_KEY,storeIDentifier);
}
}
else if( Common.OPERATION_ADD_SECRET == operation )
{
//ShowDocOnConsole("BEFORE CALL TO SETSECRET");//FIXME:Remove this
if(( Common.STORE_MICASA == storeIDentifier )||( Common.STORE_GNOMEKEYRING == storeIDentifier ))
{
//Add a new secret to the keychain
XmlNode root = ccfDoc.DocumentElement;
XmlNodeList keychainNodeList = root.SelectNodes(ccfKeyChainPath);
//Console.WriteLine("ADD_SECRET:ccfKeyChainPath="+ccfKeyChainPath);//FIXME:Remove this line
if( (null == keychainNodeList) || (0 == keychainNodeList.Count) )
{//No root keychain path for this wallet. Hence New Keychain to be created
//Expected path to be existing in CCF is eg://CCF/miCASA
keychainNodeList = root.SelectNodes(ccfRootStorePath);
XmlNode miCASANode = keychainNodeList.Item(0);
if( null != miCASANode )
{
//Console.WriteLine("ADD_SECRET:Appending to ccfRootStorePath="+ccfRootStorePath);//FIXME:Remove this line
miCASANode.AppendChild(newKeychainElement);
//ShowDocOnConsole("AFTER APENDING TO miCASANode");//FIXME:Remove this
//Console.WriteLine("ADD_SECRET:ccfSecretPath="+ccfSecretPath);//FIXME:Remove this line
keychainNodeList = root.SelectNodes(ccfSecretPath);
XmlNode SecretNode = keychainNodeList.Item(0);
//Console.WriteLine("EXECUTING OPERATION_ADD_SECRET:Adding"+ccfSecretPath);//FIXME:Remove this line
ad.SetSecret(SecretNode,operation,storeIDentifier);
}
}
else
{//Root keychain path exists for this wallet
//Console.WriteLine("ADD_SECRET:Appending to ccfKeyChainPath="+ccfKeyChainPath);//FIXME:Remove this line
XmlNode keychain = keychainNodeList.Item(0);
keychain.AppendChild(newSecretElement);
XmlNode lastChild = keychain.LastChild;
//ShowDocOnConsole("BEFORE CALL TO SETSECRET");//FIXME:Remove this
//Console.WriteLine("EXECUTING OPERATION_ADD_SECRET:Adding Secret to existing keychain");//FIXME:Remove this line
int errCode=ad.SetSecret(lastChild,operation,storeIDentifier);
//Console.WriteLine("OPERATION_ADD_SECRET Returned:errCode"+errCode);//FIXME:Remove this line
}
}//Common.STORE_MICASA \ STORE_GNOMEKEYRING
else
if( Common.STORE_KDEWALLET == storeIDentifier )
{
string folderName = strNativeValueArray[Common.INDEX_NATIVEINFO_FOLDERNAME];
string typeID = strNativeValueArray[Common.INDEX_NATIVEINFO_TYPEID];
XmlNode root = ccfDoc.DocumentElement;
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']"; //CASAwallet
XmlNodeList keychainNodeList = root.SelectNodes(ccfKeyChainPath);
if( (null == keychainNodeList) || (0 == keychainNodeList.Count) )
{//Wallet:CASAwallet does not exist. Hence create all
XmlElement folder;
XmlElement type;
newKeychainElement = ccfDoc.CreateElement(storeChainKey);//Wallet
newKeychainElement.SetAttribute(CCFXML_ATTRIBUTE_ID,keyChainID);
folder = ccfDoc.CreateElement(CCFXML_ELEMENT_FOLDER);
folder.SetAttribute(CCFXML_ATTRIBUTE_FOLDERNAME,folderName);
type = ccfDoc.CreateElement(CCFXML_ELEMENT_TYPE);
type.SetAttribute(CCFXML_ATTRIBUTE_ID,typeID);
//Join all of them
type.AppendChild(newSecretElement);
folder.AppendChild(type);
newKeychainElement.AppendChild(folder);
//Append the keychain to the root
keychainNodeList = root.SelectNodes(ccfRootStorePath);
XmlNode rootNode = keychainNodeList.Item(0);
if( null != rootNode )
rootNode.AppendChild(newKeychainElement);
}
else
{//Wallet:CASAwallet exists. Hence check for folder
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']"; //Passwords
XmlNodeList keychainFolderNodeList = root.SelectNodes(ccfKeyChainPath);
if( (null == keychainFolderNodeList) || (0 == keychainFolderNodeList.Count) )
{//folderName:Password does not exist. Hence create folder & type
XmlElement folder;
XmlElement type;
folder = ccfDoc.CreateElement(CCFXML_ELEMENT_FOLDER);
folder.SetAttribute(CCFXML_ATTRIBUTE_FOLDERNAME,folderName);
type = ccfDoc.CreateElement(CCFXML_ELEMENT_TYPE);
type.SetAttribute(CCFXML_ATTRIBUTE_ID,typeID);
//Append secret to type
type.AppendChild(newSecretElement);
//Append type to folder
folder.AppendChild(type);
//Append folder to the existing keychainNodeList
XmlNode keychainNode = keychainNodeList.Item(0);
if( null != keychainNode )
keychainNode.AppendChild(folder);
}
else
{//Wallet:CASAwallet & folder exists. Hence check for type
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']"; //Maps
XmlNodeList keychainTypeNodeList = root.SelectNodes(ccfKeyChainPath);
if( (null == keychainTypeNodeList) || (0 == keychainTypeNodeList.Count) )
{//type:Maps does not exist. Hence create folder & type
XmlElement type;
type = ccfDoc.CreateElement(CCFXML_ELEMENT_TYPE);
type.SetAttribute(CCFXML_ATTRIBUTE_ID,typeID);
//Append Secret to type
type.AppendChild(newSecretElement);
//Append type to the existing keychainFolderNodeList
XmlNode keychainFolderNode = keychainFolderNodeList.Item(0);
if( null != keychainFolderNode )
keychainFolderNode.AppendChild(type);
}
}
}
//Invoke setsecret
//ShowDocOnConsole("AFTER ADD to CCF");//FIXME:Remove this
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']/Type[@ID='" + typeID + "']";
root = ccfDoc.DocumentElement;
//Console.WriteLine("ADD_SECRET:ccfSecretPath="+ccfSecretPath);//FIXME:Remove this line
//Console.WriteLine("ADD_SECRET:ccfKeyChainPath="+ccfKeyChainPath);//FIXME:Remove this line
XmlNodeList secretNodeList = root.SelectNodes(ccfKeyChainPath);
XmlNode SecretNode = secretNodeList.Item(0);
SecretNode.AppendChild(newSecretElement); //Add the new Secret
XmlNode lastChild = SecretNode.LastChild; //Get The newly added secret
if(lastChild!=null)
{
//Console.WriteLine("EXECUTING OPERATION_ADD_SECRET:Adding"+ccfSecretPath);//FIXME:Remove this line
ad.SetSecret(lastChild,operation,storeIDentifier); //and set it
}
}//STORE_KDEWALLET
}
else if( Common.OPERATION_ADD_KEY == operation )
{
//Add a new KN\KV to the keychain-Secret
//Console.WriteLine("EXECUTING OPERATION_ADD_KEY:Adding"+ccfKeyChainPath);//FIXME:Remove this line
XmlNode root = ccfDoc.DocumentElement;
XmlNodeList keyNodeList = root.SelectNodes(ccfKeyChainPath);
XmlNode keyNode=keyNodeList.Item(0);
XmlNode lastChild = keyNode.LastChild;
keyNode.InsertBefore(newKeyElement,lastChild);
//ShowDocOnConsole("JUST BEFORE CALL TO SETSECRET-ADDKEY");//FIXME:Remove this
//int errcode=ad.SetSecret(keyNode,Common.OPERATION_ADD_SECRET,storeIDentifier);
int errcode=ad.SetSecret(keyNode,Common.OPERATION_MODIFY_KEY,storeIDentifier);
//ShowDocOnConsole("SetSecret returned errcode="+errcode);//FIXME:Remove this
}
}
catch(Exception exp)
{
//Console.WriteLine("Exception"+exp.ToString());//FIXME:Remove this line
Logger.DbgLog("GUI:StoreDataInterface.UpdateStore() - EXCEPTION" + exp.ToString());
return( Common.STATUS_STORE_UPDATEFAILED );
}
return( Common.STATUS_SUCCESS );
}
///#######################################################################
/// DUMP THE XML CCF ON CONSOLE
/// <summary>
/// Print Doc to the console for verification
/// </summary>
public static void ShowDocOnConsole(string str)
{
#if DEBUG
Console.WriteLine("\n#######################################################");
Console.WriteLine(" "+str);
Console.WriteLine("\n#######################################################");
ccfDoc.Save(Console.Out);
Console.WriteLine("\n#######################################################");
#endif
}
}
}
///###########################################################################
/// END OF FILE
///###########################################################################

326
gui/StorePolicyInterface.cs Normal file
View File

@@ -0,0 +1,326 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
namespace Novell.CASA.GUI {
using System;
using System.Collections;
using Novell.CASA.CASAPolicy;
using Novell.CASA.DataEngines;
using Novell.CASA;
public class StorePolicyInterface
{
private static AggregationPol aggPol;
private static string storeNameFirefox = null;
private static string[] storeIdFirefox = new string[Common.MAX_STORES];
private static int kFireFoxStoreCounter = 0;
private static string storeNameMozilla = null;
private static string[] storeId_mozilla = new string[Common.MAX_STORES];
private static int kMozillaStoreCounter = 0;
private static string storeNameKwallet = null;
private static string[] storeIdKwallet = new string[Common.MAX_STORES];
private static int kWalletStoreCounter = 0;
private static string storeNameGkeyring = null;
private static string[] storeIdGkeyring = new string[Common.MAX_STORES];
private static int kGkeyringStoreCounter = 0;
///#######################################################################
/// INIT
/// <summary>
/// Init AggregationPolicy to the respective attributes
/// </summary>
public static int Init()
{
Logger.DbgLog("GUI:StorePolicyInterface.Init() - BEGIN");
try
{
Common.IS_FIREFOX_AVAILABLE = AD.IsStoreAvailable(Common.STORE_FIREFOX);
Common.IS_KDEWALLET_AVAILABLE = AD.IsStoreAvailable(Common.STORE_KDEWALLET);
Common.IS_GNOMEKEYRING_AVAILABLE = AD.IsStoreAvailable(Common.STORE_GNOMEKEYRING);
aggPol = (AggregationPol) ICASAPol.GetPolicy(CASAPolType.AGGREGATION_POL);
if( null == aggPol )
{
Logger.DbgLog("GUI:StorePolicyInterface.Init() - No Aggregation Policy Found.");
return( Common.STATUS_POLICY_POLICYNOTFOUND );
}
ArrayList stores = aggPol.StoreList;
IEnumerator enumerator = stores.GetEnumerator();
while( enumerator.MoveNext() )
{
if( ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_KDEWALLET) && Common.IS_KDEWALLET_AVAILABLE)
{
Common.IS_KDEWALLET = true;
storeNameKwallet = ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName;
storeIdKwallet[kWalletStoreCounter++] = ((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId;
Logger.DbgLog("GUI:StorePolicyInterface.Init() - miCASA policy = " + Common.IS_MICASA);
}
else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_GNOMEKEYRING) && Common.IS_GNOMEKEYRING_AVAILABLE)
{
Common.IS_GNOMEKEYRING=true;
storeNameGkeyring=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName;
storeIdGkeyring[kGkeyringStoreCounter++]=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId;
Logger.DbgLog("GUI:StorePolicyInterface.Init() - GNOMEKEYRING policy = " + Common.IS_GNOMEKEYRING);
}
else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_FIREFOX) && Common.IS_FIREFOX_AVAILABLE)
{
Common.IS_FIREFOX=true;
storeNameFirefox=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName;
storeIdFirefox[kFireFoxStoreCounter++]=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId;
Logger.DbgLog("GUI:StorePolicyInterface.Init() - FIREFOX policy = " + Common.IS_FIREFOX);
}
else if(((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName.Equals(Common.STORENAME_MOZILLA))
{
Common.IS_MOZILLA=true;
storeNameMozilla=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreName;
storeId_mozilla[kMozillaStoreCounter++]=((Novell.CASA.CASAPolicy.Store)(enumerator.Current)).StoreId;
Logger.DbgLog("GUI:StorePolicyInterface.Init() - MOZILLA policy = " + Common.IS_MOZILLA);
}
}
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StorePolicyInterface.Init() - EXCEPTION" + exp.ToString());
//Common.ShowErrorDialog(exp);
return( Common.STATUS_POLICY_POLICYNOTFOUND );
}
Logger.DbgLog("GUI:StorePolicyInterface.Init() - END");
return( Common.STATUS_SUCCESS );
}
///#######################################################################
/// IS AGGREGATION POLICY ENABLED FOR STORE ?
/// <summary>
/// Reports whether the aggregation policy is set for the store.
/// </summary>
public static bool IsAggregationPolicyEnabledFor(int storeIDentifier)
{
Logger.DbgLog("GUI:StorePolicyInterface.isAggregationPolicyEnabledFor()");
if( Common.STORE_MICASA == storeIDentifier )
return( Common.IS_MICASA );
else if( Common.STORE_KDEWALLET == storeIDentifier )
return( Common.IS_KDEWALLET );
else if( Common.STORE_GNOMEKEYRING == storeIDentifier )
return( Common.IS_GNOMEKEYRING );
else if( Common.STORE_FIREFOX == storeIDentifier )
return( Common.IS_FIREFOX );
else if( Common.STORE_MOZILLA == storeIDentifier )
return( Common.IS_MOZILLA );
else
{
Logger.DbgLog("GUI:StorePolicyInterface.isAggregationPolicyEnabledFor() - STATUS_POLICY_POLICYNOTFOUND");
//Common.ShowErrorDialog(Common.STATUS_POLICY_POLICYNOTFOUND);
return( false );
}
}
///#######################################################################
/// GET LIST OF STORE IDs FOR A STORE
/// <summary>
/// Get Aggregation Policy - storeId
/// </summary>
public static string[] GetAggregationPolicyStoreIDFor(int storeIDentifier)
{
Logger.DbgLog("GUI:StorePolicyInterface.getAggregationPolicyStoreIDFor()");
if( Common.STORE_KDEWALLET == storeIDentifier )
return( storeIdKwallet );
else if( Common.STORE_GNOMEKEYRING == storeIDentifier )
return( storeIdGkeyring );
else if( Common.STORE_FIREFOX == storeIDentifier )
return( storeIdFirefox );
else if( Common.STORE_MOZILLA == storeIDentifier )
return( storeId_mozilla );
else
{
Logger.DbgLog("GUI:StorePolicyInterface.getAggregationPolicyStoreIDFor() - STATUS_POLICY_POLICYNOTFOUND");
//Common.ShowErrorDialog(Common.STATUS_POLICY_POLICYNOTFOUND);
return( null );
}
}
///#######################################################################
/// SET AGGREGATION POLICY FOR A STORE
/// <summary>
/// Set Aggregation Policy for a perticular store.
/// </summary>
public static void SetAggregationPolicy(int storeIDentifier,bool status,string[] storeId,int numberOfStoreIds)
{
Logger.DbgLog("GUI:StorePolicyInterface.SetAggregationPolicy()");
try
{
if( storeIDentifier == Common.STORE_KDEWALLET )
{
Common.IS_KDEWALLET=status;
storeNameKwallet=Common.STORENAME_KDEWALLET;
storeIdKwallet=storeId;
kWalletStoreCounter=numberOfStoreIds;
}
else if( storeIDentifier == Common.STORE_GNOMEKEYRING )
{
Common.IS_GNOMEKEYRING=status;
storeNameGkeyring=Common.STORENAME_GNOMEKEYRING;
storeIdGkeyring=storeId;
kGkeyringStoreCounter=numberOfStoreIds;
}
else if( storeIDentifier == Common.STORE_MOZILLA )
{
Common.IS_MOZILLA=status;
storeNameMozilla=Common.STORENAME_MOZILLA;
storeId_mozilla=storeId;
kMozillaStoreCounter=numberOfStoreIds;
}
else if( storeIDentifier == Common.STORE_FIREFOX )
{
Common.IS_FIREFOX=status;
storeNameFirefox=Common.STORENAME_FIREFOX;
storeIdFirefox=storeId;
kFireFoxStoreCounter=numberOfStoreIds;
}
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StorePolicyInterface.SetAggregationPolicy() - EXCEPTION" + exp.ToString());
//Common.ShowErrorDialog(exp);
}
}
///#######################################################################
/// SAVE AGGREGATION POLICY
/// <summary>
/// Save Aggregation Policy
/// </summary>
public static int SaveAggregationPolicy()
{
Logger.DbgLog("GUI:StorePolicyInterface.SaveAggregationPolicy()");
ArrayList storeList = new ArrayList();
Novell.CASA.CASAPolicy.Store store = null;
if( true == Common.IS_KDEWALLET )
{
for(int i=0; i < kWalletStoreCounter; i++)
{
store = new Novell.CASA.CASAPolicy.Store(storeNameKwallet,storeIdKwallet[i]);
storeList.Add(store);
}
}
if( true == Common.IS_GNOMEKEYRING )
{
for(int i=0; i < kGkeyringStoreCounter; i++)
{
store = new Novell.CASA.CASAPolicy.Store(storeNameGkeyring,storeIdGkeyring[i]);
storeList.Add(store);
}
}
if( true == Common.IS_FIREFOX )
{
for(int i=0; i < kFireFoxStoreCounter; i++)
{
store = new Novell.CASA.CASAPolicy.Store(storeNameFirefox,storeIdFirefox[i]);
storeList.Add(store);
}
}
if( true == Common.IS_MOZILLA )
{
for(int i=0; i < kMozillaStoreCounter; i++)
{
store = new Novell.CASA.CASAPolicy.Store(storeNameMozilla,storeId_mozilla[i]);
storeList.Add(store);
}
}
AggregationPol aggPol = new AggregationPol(storeList);
if( true == ICASAPol.SetPolicy(aggPol) )
return( Common.STATUS_SUCCESS );
else
{
Logger.DbgLog("GUI:StorePolicyInterface.SaveAggregationPolicy() - STATUS_POLICY_COULDNOTBESAVED");
//Common.ShowErrorDialog(Common.STATUS_POLICY_COULDNOTBESAVED);
return( Common.STATUS_POLICY_COULDNOTBESAVED );
}
}
///#######################################################################
/// SET MASTER PASSWORD
/// <summary>
/// Set Master Password for miCASA persistent store
/// </summary>
public static void SetMasterPassword(string passWord)
{
Logger.DbgLog("GUI:StorePolicyInterface.SetMasterPassword()");
try
{
Novell.CASA.miCASA.SetMasterPassword(0,passWord);
}
catch(Exception exp)
{
Logger.DbgLog("GUI:StorePolicyInterface.SetMasterPassword() - EXCEPTION" + exp.ToString());
//Common.ShowErrorDialog(exp);
}
}
}
}
///###########################################################################
/// END OF FILE
///###########################################################################

265
gui/TrayLib.cs Normal file
View File

@@ -0,0 +1,265 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
using System;
using System.Runtime.InteropServices;
using Gtk;
using Gdk;
namespace Egg
{
public class TrayIcon : Plug
{
int stamp;
Orientation orientation;
int selection_atom;
int manager_atom;
int system_tray_opcode_atom;
int orientation_atom;
IntPtr manager_window;
FilterFunc filter;
public TrayIcon (string name)
{
Title = name;
stamp = 1;
orientation = Orientation.Horizontal;
AddEvents ((int)EventMask.PropertyChangeMask);
filter = new FilterFunc (ManagerFilter);
}
protected override void OnRealized ()
{
base.OnRealized ();
Display display = Screen.Display;
IntPtr xdisplay = gdk_x11_display_get_xdisplay (display.Handle);
selection_atom = XInternAtom (xdisplay, "_NET_SYSTEM_TRAY_S" + Screen.Number.ToString (), false);
manager_atom = XInternAtom (xdisplay, "MANAGER", false);
system_tray_opcode_atom = XInternAtom (xdisplay, "_NET_SYSTEM_TRAY_OPCODE", false);
orientation_atom = XInternAtom (xdisplay, "_NET_SYSTEM_TRAY_ORIENTATION", false);
UpdateManagerWindow ();
//Screen.RootWindow.AddFilter (filter);
}
protected override void OnUnrealized ()
{
if (manager_window != IntPtr.Zero)
{
Gdk.Window gdkwin = Gdk.Window.LookupForDisplay (Display, (uint)manager_window);
//gdkwin.RemoveFilter (filter);
}
//Screen.RootWindow.RemoveFilter (filter);
base.OnUnrealized ();
}
private void UpdateManagerWindow ()
{
IntPtr xdisplay = gdk_x11_display_get_xdisplay (Display.Handle);
if (manager_window != IntPtr.Zero)
{
Gdk.Window gdkwin = Gdk.Window.LookupForDisplay (Display, (uint)manager_window);
//gdkwin.RemoveFilter (filter);
}
XGrabServer (xdisplay);
manager_window = XGetSelectionOwner (xdisplay, selection_atom);
if (manager_window != IntPtr.Zero)
XSelectInput (xdisplay, manager_window, EventMask.StructureNotifyMask | EventMask.PropertyChangeMask);
XUngrabServer (xdisplay);
XFlush (xdisplay);
if (manager_window != IntPtr.Zero)
{
Gdk.Window gdkwin = Gdk.Window.LookupForDisplay (Display, (uint)manager_window);
//gdkwin.AddFilter (filter);
SendDockRequest ();
GetOrientationProperty ();
}
}
private void SendDockRequest ()
{
SendManagerMessage (SystemTrayMessage.RequestDock, manager_window, Id, 0, 0);
}
private void SendManagerMessage (SystemTrayMessage message, IntPtr window, uint data1, uint data2, uint data3)
{
XClientMessageEvent ev = new XClientMessageEvent ();
IntPtr display;
ev.type = XEventName.ClientMessage;
ev.window = window;
ev.message_type = (IntPtr)system_tray_opcode_atom;
ev.format = 32;
ev.ptr1 = gdk_x11_get_server_time (GdkWindow.Handle);
ev.ptr2 = (IntPtr)message;
ev.ptr3 = (IntPtr)data1;
ev.ptr4 = (IntPtr)data2;
ev.ptr5 = (IntPtr)data3;
display = gdk_x11_display_get_xdisplay (Display.Handle);
gdk_error_trap_push ();
XSendEvent (display, manager_window, false, EventMask.NoEventMask, ref ev);
gdk_error_trap_pop ();
}
private FilterReturn ManagerFilter (IntPtr xevent, Event evnt)
{
//TODO: Implement;
return FilterReturn.Continue;
}
private void GetOrientationProperty ()
{
//TODO: Implement;
}
[DllImport ("gdk-x11-2.0")]
static extern IntPtr gdk_x11_display_get_xdisplay (IntPtr display);
[DllImport ("gdk-x11-2.0")]
static extern IntPtr gdk_x11_get_server_time (IntPtr window);
[DllImport ("gdk-x11-2.0")]
static extern void gdk_error_trap_push ();
[DllImport ("gdk-x11-2.0")]
static extern void gdk_error_trap_pop ();
[DllImport ("libX11", EntryPoint="XInternAtom")]
extern static int XInternAtom(IntPtr display, string atom_name, bool only_if_exists);
[DllImport ("libX11")]
extern static void XGrabServer (IntPtr display);
[DllImport ("libX11")]
extern static void XUngrabServer (IntPtr display);
[DllImport ("libX11")]
extern static int XFlush (IntPtr display);
[DllImport ("libX11")]
extern static IntPtr XGetSelectionOwner (IntPtr display, int atom);
[DllImport ("libX11")]
extern static IntPtr XSelectInput (IntPtr window, IntPtr display, EventMask mask);
[DllImport ("libX11", EntryPoint="XSendEvent")]
extern static int XSendEvent(IntPtr display, IntPtr window, bool propagate, EventMask event_mask, ref XClientMessageEvent send_event);
}
[Flags]
internal enum EventMask
{
NoEventMask = 0,
KeyPressMask = 1<<0,
KeyReleaseMask = 1<<1,
ButtonPressMask = 1<<2,
ButtonReleaseMask = 1<<3,
EnterWindowMask = 1<<4,
LeaveWindowMask = 1<<5,
PointerMotionMask = 1<<6,
PointerMotionHintMask = 1<<7,
Button1MotionMask = 1<<8,
Button2MotionMask = 1<<9,
Button3MotionMask = 1<<10,
Button4MotionMask = 1<<11,
Button5MotionMask = 1<<12,
ButtonMotionMask = 1<<13,
KeymapStateMask = 1<<14,
ExposureMask = 1<<15,
VisibilityChangeMask = 1<<16,
StructureNotifyMask = 1<<17,
ResizeRedirectMask = 1<<18,
SubstructureNotifyMask = 1<<19,
SubstructureRedirectMask= 1<<20,
FocusChangeMask = 1<<21,
PropertyChangeMask = 1<<22,
ColormapChangeMask = 1<<23,
OwnerGrabButtonMask = 1<<24
}
internal enum SystemTrayMessage
{
RequestDock,
BeginMessage,
CancelMessage
}
internal enum SystemTrayOrientation
{
Horz,
Vert
}
[StructLayout(LayoutKind.Sequential)]
internal struct XClientMessageEvent
{
internal XEventName type;
internal IntPtr serial;
internal bool send_event;
internal IntPtr display;
internal IntPtr window;
internal IntPtr message_type;
internal int format;
internal IntPtr ptr1;
internal IntPtr ptr2;
internal IntPtr ptr3;
internal IntPtr ptr4;
internal IntPtr ptr5;
}
internal enum XEventName
{
KeyPress = 2,
KeyRelease = 3,
ButtonPress = 4,
ButtonRelease = 5,
MotionNotify = 6,
EnterNotify = 7,
LeaveNotify = 8,
FocusIn = 9,
FocusOut = 10,
KeymapNotify = 11,
Expose = 12,
GraphicsExpose = 13,
NoExpose = 14,
VisibilityNotify = 15,
CreateNotify = 16,
DestroyNotify = 17,
UnmapNotify = 18,
MapNotify = 19,
MapRequest = 20,
ReparentNotify = 21,
ConfigureNotify = 22,
ConfigureRequest = 23,
GravityNotify = 24,
ResizeRequest = 25,
CirculateNotify = 26,
CirculateRequest = 27,
PropertyNotify = 28,
SelectionClear = 29,
SelectionRequest = 30,
SelectionNotify = 31,
ColormapNotify = 32,
ClientMessage = 33,
MappingNotify = 34,
TimerNotify = 100,
LASTEvent
}
}

View File

@@ -0,0 +1,64 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Adding New Secrets</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">CASA enables you to manually create new secrets or to
manage secrets that have been previously created by programs that integrate
with CASA. To manually create a new secret, use the following procedure:</p>
<ol>
<li>In CASA Manager, click File &gt; New &gt; New Secret.</li>
<li>Type the identifying name of the new secret in the Secret ID field, such
as, Example Secret.</li>
<li>Type the name of the key and its value in the Key and Value fields,
such as, Key: Password, and Value: testpassword.
The asterisk (*) is the only restricted character in both the Key and Value fields.</li>
<li>Click the + button to add the newly formed Key-Value pair for the
new secret. </li>
<li>By default, to safeguard secrets, values are shown as asterisks (*).
To show values in clear text, select Show Values in Clear Text and
enter your master password to enable a single instance display
of the value in the Value field.</li>
<li>Click OK to add the new secret, with its corresponding Key-Value pair,
to the credential store. The secret will now display in the Secret-ID window,
indicating that it has been added to the miCASA credential store.</li>
</ol>
<p>See also <a href="EditingSecrets.html" target="_parent">Editing Secrets</a>.</p>
<p><img border="0" src="AddingNewSecrets.png" width="398" height="428"></p>
<p>&nbsp;</p>
<!--This adds space before first level 1 heading-->
<div class="margintop3"></div>
<span class="head3">Refreshing Credentials Stores</span>
<p class="margintop2">Refresh Stores in CASA Manager is used to reload all Secrets from the configured stores.
You can refresh the view of supported stores by pressing F5, or by choosing File->Refresh Stores from the menu.
The miCASA store is supported on Windows* and Linux*. KDE Wallet and GNOME*
Keyring are additional stores supported in Linux*.</p>
<p class="margintop2">
<img border="0" src="RefreshCredentialStores.png" width="303" height="159"></p>
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div></div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,45 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<!-- #BeginEditable "doctitle" -->
<title>Novell&reg; CASA Manager</title>
<!-- #EndEditable -->
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url(help_zcc_bg.gif) repeat-x 0% 0% }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<!--Begin Content -->
<div class="head3b">Entering your workstation password</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">You are prompted for your workstation password if the CASA
service is restarted and before you have set your master password.</p>
<p>Your desktop password and master password are used to encypt your secrets
and store them on your computer. When you login to the computer, CASA will decrypt
the saved secrets using your desktop password and make them available for
applications integrated with CASA.
If your desktop password changes, you must run CASA Manager and enter your master
password before CASA can decrypt your saved secrets.</p>
<p><b>Important:</b> To prevent unauthorized access to your credential stores,
always create confidential passwords that are not easily discovered.</p>
<!--End Content -->
<br>
<div class="ruleabove"></div></div>
</body>
</html>

View File

@@ -0,0 +1,61 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<!-- #BeginEditable "doctitle" -->
<title>Novell&reg; CASA Manager</title>
<!-- #EndEditable -->
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Setting Master Password</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">When you start CASA Manager the first time, you are prompted to
create or enter a master password. You are prompted for your master password when
displaying the values of secrets. The master password must be at least eight characters
long.</p>
<p>Your desktop password and master password are used to encypt your secrets
and store them on your computer. When you login to the computer, CASA will decrypt
the saved secrets using your desktop password and make them available for
applications integrated with CASA.
If your desktop password changes, you must run CASA Manager and enter your master
password before CASA can decrypt your saved secrets.</p>
<p>You can change the master password by using the following procedure from the main CASA Manager
screen:</p>
<ol>
<li>Click Options &gt; Change Master Password.</li>
<li>Enter your current master password, Enter your new master password, re-enter
your new master password, then click OK.</li>
</ol>
<p><img border="0" src="SettingMasterPassword.png" width="369" height="269"></p>
<p><b>Important:</b> To prevent unauthorized access to your credential stores,
always create confidential passwords that are not easily discovered.</p>
<!--End Content -->
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

64
gui/help/en/Contents.htm Normal file
View File

@@ -0,0 +1,64 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<div class="head3b">Contents</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">Common Authentication Services Adapter (CASA) is the
common cross-platform foundation for authentication and single sign-on
services for Novell<6C> Linux* Desktop and Microsoft* Windows* operating systems.
Applications that integrate CASA can securely authenticate and cache
credentials for single sign-on purposes. CASA Manager is the graphical user
interface that enables you to access and manage the authentication credentials
(secrets) of the programs and services installed on any of these platforms. It
provides you a single place to manage credentials for KDE* Wallet, GNOME* Keyring and Firefox* Password Manager stores.</p>
<p class="margintop2">This Help file contains the following topics:</p>
<ul>
<li><a href="AddNewSecrets.htm" target="_blank">Adding New Secrets</a></li>
<li><a href="DestroyingSecrets.htm" target="_blank">Destroying Secrets</a></li>
<li><a href="EditingSecrets.html" target="_blank">Editing Secrets</a></li>
<li><a href="LinkingSecrets.htm" target="_blank">Linking Secrets</a></li>
<li><a href="UnlockSecrets.htm" target="_blank">Locking and Unlocking Secrets</a></li>
<li><a href="Persistent_Storage.htm" target="_blank">Persistent Storage</a></li>
<li><a href="Preferences.htm" target="_blank">Setting CASA Preferences</a></li>
<li><a href="CASAMasterPasswordAuthentication.htm" target="_blank">Setting
Master Password</a></li>
<li><a href="ViewSecrets.htm" target="_blank">Viewing Secrets</a></li>
<!--End Content -->
<br>
</ul>
<p><b>Important:</b> Because CASA Manager collects and displays security credentials
from secure applications running on your system, this software should not
be used in any public environment where security might be compromised. In
addition, because CASA is integrated with your workstation login and other
resident applications that require authentication credentials, you should
create confidential passwords that are not easily broken in order to prevent
unauthorized access.</p>
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,40 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<div class="head3b">Destroying Secrets</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">Use the following procedure to clear your cache and destroy
all credentials that are stored in the miCASA store:
<ul>
<li>Click File &gt; Destroy Secrets, then click OK.</li>
</ul>
Your secrets are restored manually by creating new
secrets or by using applications that are integrated with CASA.<p>
<img border="0" src="DestroyingSecrets.png" width="331" height="145"></p>
</p>
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,52 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Editing Secrets</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">You edit a secret by adding new Key-Value pairs or changing
existing Key-Value pairs:<br>
</p>
<ol>
<li>In the main Secret-ID window, double-click the secret you want to edit.<br>
</li>
<li>Type a second password key and corresponding password value (for example,
Password2 and testpassword2) in the Key and Value fields, then click the
+ button. <br>
In this example, from the new Password2 key, the value is encrypted and
displays as asterisks. To show the value in clear text, click Show Values
in Clear Text, then enter your master password.<br>
</li>
<li>To edit the password value, click the Value field in the Key-Value pairs
window, type your new value, then click OK. The new password value is saved
in the miCASA credential store.<br>
After they are created, Secret ID names cannot be edited.</li>
</ol>
<p><img border="0" src="EditingSecrets.png" width="398" height="414"></p>
<!--End Content -->
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -0,0 +1,63 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Linking Secrets</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">You can link two or more secrets so that their respective
passwords or key values are synchronized simultaneously. For example, you
can link the password of one secret to the password of another secret, all of the
keys with one secret to each other, or any combination to synchronize management
of all your secrets. </p>
<p class="margintop2">Currently, CASA provides only the ability to link keys
within the miCASA store. Link secrets by using the Link feature from the
CASA Manager:</p>
<ol>
<li>Press the F2 key or click Edit &gt; Link to open the Manage Secrets and
Key-Value pairs window.</li>
<li>Double-click the Key field to open the Link management
window. This utility enables you to link the keys of any secrets contained
in your miCASA store.
<li>Click the Secret-ID component you want to link.</li>
<li>Click the Key you want to link,
then click the + Button to link the selected Key-Value pair.</li>
<li>Repeat Step 4 to add and link as many secrets as you want. The status
of your linked secrets is displayed in the Existing Linked Keys window.</li>
<li>To verify if a secret is linked, view its status in the Key-Value pairs
window. The Link field displays either Yes or No. Verify by following any
one of these steps:<br>
* Double-click the secret. <br>
* Right-click the secret &gt; Click View.<br>
* Press F2.</li>
<li>To unlink selected secrets, click any of the Secret-ID components listed
in the Existing Linked Keys window, then click the &#151; button. The selected
secret is deleted from the Existing Linked Keys window.</li>
</ol>
<p><img border="0" src="LinkingSecrets.png" width="467" height="590"></p>
<!--End Content -->
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,44 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Persistent Storage</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">CASA automatically saves your secrets on your computer
and retrieves them the next time you login. Your secrets are encrypted using
the password used for login, as well as the master password required to use
CASA Manager. When the desktop password changes, you will need to enter your
master password to decrypt your saved secrets.
See also <a href="CASAMasterPasswordAuthentication.htm" target="_parent">Setting
Master Password</a>.</p>
<p class="margintop2">
<img border="0" src="PersistentStorage.png" width="318" height="215"></p>
<!--This adds space before first level 1 heading-->
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,46 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<!-- #BeginEditable "doctitle" -->
<title>Novell&reg; CASA Manager</title>
<!-- #EndEditable -->
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Preferences</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">This option is active only when CASA is installed in a
Linux* environment. Linux provides support for miCASA, KDE* Wallet, GNOME*
Keyring, and Firefox* Password Manager, or all four credential stores. </p>
<p class="margintop2">Use the following procedure to specify which credential
stores you want to use:</p>
<ol>
<li>From the CASA Manager page, Click Options &gt; Preferences</li>
<li>Select which credential stores you wish to use (KDE Wallet, GNOME
Keyring, Firefox Password Manager).</li>
</ol>
<p>In Windows*, miCASA is the only credential store available, so references
to KDE Wallet, GNOME Keyring and Firefox Password Manager are inactive.
<p><img border="0" src="Preferences.png" width="295" height="180"><p>&nbsp;<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

BIN
gui/help/en/Preferences.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,43 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Locking and Unlocking Secrets</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">To prevent individuals and other applications from viewing
or manipulating your secrets, CASA enables you to lock secrets, which temporarily
disables the functionality of CASA.</p>
<ol>
<li>Click File &gt; Lock Secrets. The credential store tab (miCASA) and cached
secrets are dimmed when CASA is locked. </li>
<li>To unlock and restore functionality to CASA:</li>
<li>Click File &gt; Unlock Secrets.</li>
<li>Enter your master password.</li>
</ol>
<!--End Content -->
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A"><u>Legal Notices</u></font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

View File

@@ -0,0 +1,43 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent">
<div class="head1">CASA - Common Authentication Services Adapter</div><br>
<!--Begin Content -->
<div class="head3b">Viewing Secret Values</div>
<!--Remove this section if you do not need introductory text for this topic -->
<p class="margintop2">You can view the Key-Value pairs of all secrets cached
in the miCASA credential store.</p>
<ol>
<li>In the main Secret-ID window, click the secret you want to view.</li>
<li>Click Edit &gt; View or Press F2.</li>
<li>By default, the key values are encrypted and displayed as asterisks. To
show the value in clear text, click Show Values in Clear Text, then enter
your master password.</li>
</ol>
<p><img border="0" src="ViewingSecrets.png" width="398" height="414"></p>
<!--End Content -->
<div class="smalltext" style="width: 757; height: 24">
<p align="center"><font color="#4A4A4A">A trademark symbol (<28>, TM, etc.) denotes a Novell trademark.
An asterisk (*) denotes a third-party trademark. For information on trademarks,
see </font> <a
href="legal_notices_en.html"><font color="#4A4A4A">Legal Notices</font></a><font color="#4A4A4A">.</font></div>
<p></p>
<div class="ruleabove"></div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
gui/help/en/h1_help_zcc.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

BIN
gui/help/en/help_zcc_bg.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

157
gui/help/en/hf_style.css Normal file
View File

@@ -0,0 +1,157 @@
a { color: #039; text-decoration: underline }
body { color: black; font-family: "Trebuchet MS", Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: white }
th, tr, td, table { font-family: "Trebuchet MS", Arial, Helvetica, Geneva, Swiss, SunSans-Regular }
p, li, ol, ul, td { font-size: 0.9em }
td label { font-size: 0.85em }
label { font-size: 0.765em; }
h1 { font-weight: bold; font-size: 1.3em; line-height: 1.3em; margin-bottom: 0.6em }
h2 { font-weight: bold; font-size: 1.2em; line-height: 1.2em; margin-bottom: 0.4em }
h3 { font-weight: bold; font-size: 1em; line-height: 1.1em; margin-bottom: 0.2em }
h4 { font-weight: bold; font-size: 0.85em; line-height: 1em; margin-bottom: 0.1em }
img.floatright { float: right }
img.margin1 { margin: 1px }
img.margin2 { margin: 2px }
img.margin4 { margin: 4px }
img.margin5r { margin-right: 5px }
img.margin5l { margin-left: 5px }
img.margin6 { margin: 6px }
img.margin8 { margin: 8px }
img.margin10 { margin: 10px }
img.margin10r { margin-right: 10px }
img.margin10l { margin-left: 10px; margin-right: 5px }
span.tab1u { color: black; }
span.tab2u { text-decoration: underline }
span.tab2s { text-decoration: underline }
.activitycolor { background-color: #e8e887 }
.allcaps { color: black; font-style: normal; font-weight: 500; font-size: 0.7em; text-transform: uppercase; letter-spacing: 0.2em }
.errorlink { color: #c82727; font-weight: normal; margin-top: 2px }
.linktrialversion { color: #c82727; font-style: normal; font-weight: normal; font-size: 0.85em; text-decoration: underline }
.errorhead { color: #c82727; font-style: normal; font-weight: 800; font-size: 1.2em; line-height: 1.5em; margin-bottom: 0.7em }
.formcolumnhead1 { color: black; font-weight: bold; font-size: 0.7em; text-align: center }
.formhead1 { color: white; font-weight: bold; font-size: 1em; background-color: #458ab9; text-align: left; text-indent: 0.2em; letter-spacing: 0.05em; vertical-align: middle; padding: 0.2em }
.formhead2 { color: white; font-weight: bold; font-size: 0.8em; line-height: 1.1em; background-color: #458ab9; text-align: left; text-indent: 0.5em; letter-spacing: 0.1em; vertical-align: middle }
.menuhead1 { color: white; font-weight: 600; font-size: 0.7em; line-height: 1em; background-color: #458ab9; text-align: center; text-transform: uppercase; letter-spacing: 0.1em; vertical-align: middle; padding: 0.2em }
.formhead1b { color: white; font-weight: bold; font-size: 1em; line-height: 1.2em; background-color: #458ab9; text-align: left; text-indent: 0.5em; vertical-align: middle }
.formdescriptext { color: #4d6d8b; font-size: 0.8em; margin-left: 1em }
.formdescriptextml0 { color: #4d6d8b; font-size: 0.8em }
.instructions { color: #4d6d8b; font-size: 0.8em }
.head1 { color: black; font-weight: bold; font-size: 1.3em; line-height: 1.3em; margin-bottom: 0.6em }
.head1a { color: #663; font-weight: bold; font-size: 1.3em; line-height: 1.3em; margin-bottom: 0.6em; margin-left: 1em }
.head1b { color: black; font-weight: bold; font-size: 1.3em; line-height: 1.3em }
.head1r { color: #e10000; font-weight: normal; font-size: 1.3em }
.head1w { color: white; font-weight: bold; font-size: 1.3em; line-height: 1.3em }
.head2 { color: black; font-weight: bold; font-size: 1.2em; margin-top: 0.4em; margin-bottom: 1.2em }
.head2a { color: #663; font-weight: bold; font-size: 1.2em; margin-top: 0.4em }
.head2b { color: black; font-weight: 600; font-size: 1.2em; letter-spacing: 0.1em; margin-top: 0.4em; margin-bottom: 0.4em; border-bottom: 2px solid #458ab9 }
.head2tm6 { color: black; font-weight: bold; font-size: 1.2em; margin-top: 0.6em }
.head2tm8 { color: black; font-weight: bold; font-size: 1.2em; margin-top: 0.8em }
.head2w { color: #fff; font-weight: bold; font-size: 1.2em; }
.head2r { color: #e10000; font-weight: normal; font-size: 1.2em; margin-top: 0.5em }
.head2indent { color: black; font-weight: bold; font-size: 1.2em; margin-top: 0.4em; margin-left: 0.5em }
.head3 { color: black; font-weight: bold; font-size: 1em; margin-top: 0.3em; margin-bottom: 1em }
.head3a { color: #663; font-weight: bold; font-size: 1em; margin-top: 0.3em }
.head3b { color: black; font-weight: bold; font-size: 1em; letter-spacing: 0.1em; margin-top: 0.4em; margin-bottom: 0.4em; border-bottom: 2px solid #458ab9 }
.head3d { color: black; font-weight: bold; font-size: 1em }
.head3center { color: black; font-weight: bold; font-size: 1em; text-align: center }
.head3indent { color: black; font-weight: bold; font-size: 1em; margin-top: 0.3em; margin-left: 1em }
.head3tm6 { color: black; font-weight: bold; font-size: 1em; margin-top: 0.6em; margin-bottom: 0.1em }
.head3tm8 { color: black; font-weight: bold; font-size: 1em; margin-top: 0.8em; margin-bottom: 0.2em }
.head3w { color: #fff; font-weight: bold; font-size: 1em }
.head3r { color: #e10000; font-weight: bold; font-size: 1em; letter-spacing: 0.05em; margin-top: 0.75em }
.head4 { color: black; font-weight: bold; font-size: 0.85em; margin-top: 0.5em; margin-bottom: 0.2em; margin-left: 1em;}
.head4center { color: black; font-weight: bold; font-size: 0.85em; text-align: center }
.head4b { color: #663; font-weight: bold; font-size: 0.85em; margin-top: 0.2em }
.head4tm6 { color: black; font-weight: bold; font-size: 0.85em; margin-top: 0.6em; margin-bottom: 0.1em }
.head4tm8 { color: black; font-weight: bold; font-size: 0.85em; margin-top: 0.8em; margin-bottom: 0.2em }
.head4margin4 { color: black; font-weight: bold; font-size: 0.85em; background-color: #dfddd5; margin: 0.4em }
.head5 { color: black; font-weight: 600; font-size: 0.75em; margin-top: 0.2em; margin-left: 2em; }
.head5a { color: black; font-weight: 600; font-size: 0.75em; margin-top: 0.2em }
.head5b { color: #663; font-weight: 600; font-size: 0.75em; margin-top: 0.2em; margin-left: 1em }
.head5tm6 { color: black; font-weight: 600; font-size: 0.75em; margin-top: 0.6em; margin-left: 1em }
.head5tm8 { color: black; font-weight: 600; font-size: 0.75em; margin-top: 0.8em; margin-left: 1em }
.hint1 { color: #663; font-size: 12px; line-height: 14px }
.inactive { color: #6c8899 }
.margintop1 { margin-left: 1em; margin-top: 0.3em }
.margintop2 { margin-top: 0.5em }
.margintop3 { margin-top: 1em }
.marginleft1 { margin-left: 1.5em; margin-top: 0.3em }
.marginleft1b { font-size: 0.85em; margin-left: 1em }
.marginleft2 { margin-left: 2em }
.marginleft3 { margin-left: 3em }
.marginleft4 { margin-left: 4em }
.nonproportional { font-size: 10pt; font-family: "Courier New", Courier, Monaco }
.padding8 { padding: 8px }
.padding2x4 { padding-top: 2px; padding-bottom: 2px; padding-right: 4px; padding-left: 4px }
.padding2 { padding: 2px }
.padding4 { padding: 4px }
.rowaltcolor { background-color: #f4f4f4 }
.scroll1 { background-color: #efeee9; padding: 10px 12px 10px 10px; overflow: auto }
.ruleblue { color: #458ab9 }
.rulebelow { padding-bottom: 5px; border-bottom: 2px solid #458ab9 }
.rulebelow2 { padding-bottom: 3px; border-bottom: 1px solid #babdb6 }
.ruleabove { padding-top: 5px; border-top: 2px solid #458ab9 }
.breadcrumb { color: #848582; font-size: 0.65em; line-height: 1em; text-decoration: none; margin-bottom: 1em }
.smalltext { color: black; font-size: 0.75em; line-height: 1em }
.smalltext2a { color: #663; font-size: 0.75em; line-height: 1em }
.smalltext2b { color: black; font-weight: bold; font-size: 0.75em; line-height: 1em }
.smalltext2c { color: #355263; font-size: 0.75em; line-height: 1.1em; width: 480px }
.smalltext2d { color: #355263; font-size: 0.75em }
.mediumtext { color: black; font-size: 0.85em; line-height: 1.1em }
.largetext { color: black; font-style: normal; font-weight: normal; font-size: 1em; line-height: 1.1em }
.textblue1 { color: #4d6d8b; font-size: 0.9em; line-height: 1.2em }
.typegold1 { color: #663; font-size: 1em; line-height: 1.1em }
.typegold2 { color: #663; font-size: 0.85em; line-height: 1.1em }
.tablecolumnhead1 { color: black; font-weight: bold; font-size: 0.75em; background-color: #efeeec; border-bottom: 1px solid black }
.tablecolumnhead1b { color: black; font-weight: bold; font-size: 0.75em; border-bottom: 1px solid black }
.tablecolumnhead2 { color: #663; font-weight: 600; font-size: 0.75em; text-align: center }
.tablehead1 { color: white; font-weight: bold; font-size: 0.95em; background-color: #458ab9; text-align: left; text-indent: 0.2em; padding: 0.2em }
.tablehead2 { color: black; font-weight: 600; font-size: 0.9em; line-height: 1.1em; background-color: #cc9; text-align: left; text-indent: 0.5em; letter-spacing: 0.1em }
.tablehead1b { font-weight: bold; font-size: 1em; line-height: 1.1em; background-color: #cc9; text-align: left; text-indent: 0.5em }
.tablesubhead1 { color: black; font-weight: bold; font-size: 0.85em; background-color: #efeeec; text-align: left; text-indent: 0.2em; padding: 0.2em }
.tablesubhead3 { color: black; font-weight: 600; font-size: 0.75em; background-color: #dfddd5; text-align: left; padding: 0.2em }
.tablesubhead2 { color: black; font-weight: normal; font-size: 0.85em; background-color: #efeeec; text-align: left; padding: 0.2em }
.tabb { font-weight: bold; font-size: 14pt;}
.tabw { color: white; font-weight: bold; font-size: 14pt; }
.task1 { font-size: 0.7em; margin-top: 0.35em; margin-left: 1.3em }
.grouphead { color: #333; font-weight: 600; font-size: 0.8em; line-height: 0.9em; margin-top: 0.7em; margin-left: 1.2em }
.task1a { font-size: 0.7em; margin-top: 0.35em }
.task2 { font-size: 0.7em; margin-top: 0.35em; margin-left: 2.3em }
.task3 { color: #003399; font-size: 0.6em; line-height: 1em; text-decoration: none; margin-top: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em }
.task3b { color: #003399; font-size: 0.75em; line-height: 1em; text-decoration: none; margin-top: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em }
.navhead { color: black; font-weight: bold; font-size: 0.85em; line-height: 0.9em; background-color: #cfcdc6; vertical-align: middle; padding: 4px }
.role1 { color: black; font-weight: bold; font-size: 0.75em; line-height: 0.85em; text-decoration: none; margin-top: 0.6em }
.windowheaddgrey { color: #5a5958; font-weight: bold; font-size: 18pt; line-height: 18pt; letter-spacing: 1px }
.windowheadblack { color: #5a5958; font-weight: bold; font-size: 18pt; line-height: 18pt; letter-spacing: 1px }
.windowheadwhite { color: white; font-weight: bold; font-size: 18pt; line-height: 18pt; letter-spacing: 1px }
.width350 { width: 350px }
.width300 { width: 300px }
.width400 { width: 400px }
.width450 { width: 450px }
.width500 { width: 500px }
.headcapwide { color: #663; font-weight: 600; font-size: 0.6em; letter-spacing: 0.2em }
.subtitle1 { color: black; font-weight: bold; font-size: 14px; line-height: 14px }
.subtitle2 { color: white; font-weight: bold; font-size: 14px; line-height: 14px }
.headpb { color: black; font-weight: bold; font-size: 15px; text-align: left; vertical-align: top; letter-spacing: 2px }
.tab1s { color: white; font-weight: bold; font-size: 12px; line-height: 17px; text-decoration: none; background-color: #458ab9; text-align: center; white-space: nowrap }
.tab1u { color: black; background-color: #DFDDD5; font-size: 12px; text-decoration: none; font-weight: bold; text-align: center; white-space: nowrap }
.tab2s { color: white; font-weight: bold; font-size: 11px; text-decoration: none; background-color: #458ab9; white-space: nowrap }
.tab2u { color: white; font-weight: normal; font-size: 11px; text-decoration: none; background-color: #458ab9; white-space: nowrap }
.copyright { color: #cfcdc6; font-size: 0.55em }

View File

@@ -0,0 +1,41 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Novell&reg; CASA Manager</title>
<link href="hf_style.css" rel="styleSheet" type="text/css">
<style type="text/css" media="screen">
<!--
body { font-family: "Trebuchet MS", Arial, Helvetica, Geneva; background: white url('help_zcc_bg.gif') repeat-x; }
#headgraphic { position: absolute; z-index: 0; top: 0px; left: 0px; width: 380px; visibility: visible }
#helpcontent { position: absolute; top: 37px; left: 10px; width: 93%; visibility: visible }
-->
</style>
</head>
<body bgcolor="white" marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">
<div id="headgraphic">
<img src="h1_help_zcc.gif" width="221" height="26" border="0"></div>
<div id="helpcontent" style="left: 10px; width: 68%; top: 37px">
<div class="head1"><b>CASA - Common Authentication Services Adapter</b></div><br>
<div class="head3b"><b>Legal Notices</b></div>
Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.<br/>
This library is free software; you can redistribute it and/or<br/>
modify it under the terms of the GNU Lesser General Public<br/>
License as published by the Free Software Foundation; version 2.1<br/>
of the License.<br/>
<br/>
This library is distributed in the hope that it will be useful,<br/>
but WITHOUT ANY WARRANTY; without even the implied warranty of<br/>
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br/>
Library Lesser General Public License for more details.<br/>
You should have received a copy of the GNU Lesser General Public<br/>
License along with this library; if not, Novell, Inc.<br/>
<br/>
To contact Novell about this file by physical or electronic mail,<br/>
you may find current contact information at <a href="http://www.novell.com">www.novell.com</a>.
<div class="ruleabove"></div>
</body>
</html>

BIN
gui/images/CASA.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
gui/images/CASA_16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
gui/images/CASA_22.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
gui/images/CASA_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

BIN
gui/images/CASA_48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
gui/images/CASAicons.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
gui/images/casa-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

11693
gui/images/casa.glade Normal file

File diff suppressed because it is too large Load Diff

9
gui/images/casa.gladep Normal file
View File

@@ -0,0 +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>

BIN
gui/images/firefox-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
gui/images/keyring-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
gui/images/kwallet-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
gui/images/micasa-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

BIN
gui/images/mozilla-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
gui/images/novell-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

16
gui/objs.lux Normal file
View File

@@ -0,0 +1,16 @@
OBJS=\
AssemblyInfo \
CasaMain \
CasaTray \
TrayLib \
Firefox \
GnomeKeyring \
KdeWallet \
Logger \
MiCasa \
Mozilla \
Store \
StoreDataInterface \
StorePolicyInterface \
CommonGUI \
Common

17
gui/src.lux Normal file
View File

@@ -0,0 +1,17 @@
SRC=\
AssemblyInfo.cs \
CasaMain.cs \
CasaTray.cs \
TrayLib.cs \
Firefox.cs \
GnomeKeyring.cs \
KdeWallet.cs \
Logger.cs \
MiCasa.cs \
Mozilla.cs \
Store.cs \
StoreDataInterface.cs \
StorePolicyInterface.cs \
CommonGUI.cs \
Common.cs