Add call to get GlobalSettings from daemon/service.

This commit is contained in:
Jim Norman 2008-04-02 15:05:51 +00:00
parent 2b727e4c21
commit 7f78288cb0
3 changed files with 49 additions and 12 deletions

View File

@ -71,6 +71,7 @@ namespace Novell.CASA.GUI
// //
} }
/// <summary> /// <summary>
/// HandleUnlock dialog /// HandleUnlock dialog
/// </summary> /// </summary>
@ -406,14 +407,35 @@ namespace Novell.CASA.GUI
} }
} }
internal static bool UseMasterPassword() internal static bool UseMasterPassword()
{ {
#if W32 string sSettingValue;
return IsRegKeySet(CASA_REG_KEY, "UseMasterPassword"); sSettingValue = GetGlobalConfSetting("UseMasterPassword", "false");
#else if (sSettingValue.Equals("true"))
return true; {
#endif return true;
}
else
{
return false;
}
}
internal static string GetGlobalConfSetting(string sSettingName, string sDefaultValue)
{
string sSettingValue = null;
if (sSettingName != null)
{
sSettingValue = (string)MiCasaRequestReply.Send(MiCasaRequestReply.VERB_GET_GLOBAL_SETTING, null, null, null, sSettingName);
}
if ((sSettingValue == null) && (sDefaultValue != null))
{
sSettingValue = sDefaultValue;
}
return sSettingValue;
} }

View File

@ -62,6 +62,7 @@ namespace Novell.CASA.MiCasa.Communication
public const int VERB_CREATE_POLICY_DIR = 24; public const int VERB_CREATE_POLICY_DIR = 24;
public const int VERB_GET_CREATE_TIME = 25; public const int VERB_GET_CREATE_TIME = 25;
public const int VERB_GET_MODIFIED_TIME = 26; public const int VERB_GET_MODIFIED_TIME = 26;
public const int VERB_GET_GLOBAL_SETTING = 27;
public const int VERB_DUMP_LINKED_KEYS = 96; public const int VERB_DUMP_LINKED_KEYS = 96;
public const int VERB_CREATE_TEST_SECRETS = 97; public const int VERB_CREATE_TEST_SECRETS = 97;

View File

@ -243,7 +243,10 @@ namespace sscs.verbs
{ {
return DoGetModifiedTime(ssStore, wo); return DoGetModifiedTime(ssStore, wo);
} }
case MiCasaRequestReply.VERB_GET_GLOBAL_SETTING:
{
return DoGetGlobalSetting(ssStore, wo);
}
default: default:
{ {
@ -264,6 +267,17 @@ namespace sscs.verbs
return wo; return wo;
} }
private WrappedObject DoGetGlobalSetting(SecretStore ssStore, WrappedObject wo)
{
String sSettingName = (string)wo.GetObject();
String sSettingValue = null;
if (sSettingName != null)
{
sSettingValue = Config.GetGlobalConfigSetting(sSettingName);
}
wo.SetObject(sSettingValue);
return wo;
}
private WrappedObject DoGetModifiedTime(SecretStore ssStore, WrappedObject wo) private WrappedObject DoGetModifiedTime(SecretStore ssStore, WrappedObject wo)
{ {