Add call to get GlobalSettings from daemon/service.
This commit is contained in:
parent
2b727e4c21
commit
7f78288cb0
@ -71,6 +71,7 @@ namespace Novell.CASA.GUI
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// HandleUnlock dialog
|
||||
/// </summary>
|
||||
@ -406,17 +407,38 @@ namespace Novell.CASA.GUI
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal static bool UseMasterPassword()
|
||||
{
|
||||
#if W32
|
||||
return IsRegKeySet(CASA_REG_KEY, "UseMasterPassword");
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
string sSettingValue;
|
||||
sSettingValue = GetGlobalConfSetting("UseMasterPassword", "false");
|
||||
if (sSettingValue.Equals("true"))
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if W32
|
||||
|
||||
private static bool IsRegKeySet(string sPath, string sValue)
|
||||
|
@ -61,7 +61,8 @@ namespace Novell.CASA.MiCasa.Communication
|
||||
public const int VERB_CHANGE_PERSIST_DIR = 23;
|
||||
public const int VERB_CREATE_POLICY_DIR = 24;
|
||||
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_CREATE_TEST_SECRETS = 97;
|
||||
|
@ -242,9 +242,12 @@ namespace sscs.verbs
|
||||
case MiCasaRequestReply.VERB_GET_MODIFIED_TIME:
|
||||
{
|
||||
return DoGetModifiedTime(ssStore, wo);
|
||||
}
|
||||
case MiCasaRequestReply.VERB_GET_GLOBAL_SETTING:
|
||||
{
|
||||
return DoGetGlobalSetting(ssStore, wo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
default:
|
||||
{
|
||||
wo.SetError(constants.RetCodes.FAILURE, "Verb Not Supported");
|
||||
@ -262,8 +265,19 @@ namespace sscs.verbs
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user