|
@@ -36,7 +36,6 @@ namespace PRSServer
|
|
|
SMSProviderProperties = new Dictionary<SMSProviderType, string>();
|
|
|
PasswordExpiryTime = 90;
|
|
|
SessionExpiryTime = 120;
|
|
|
- CertificateFile = null;
|
|
|
ColorScheme = "#FF6495ED";
|
|
|
}
|
|
|
|
|
@@ -44,15 +43,12 @@ namespace PRSServer
|
|
|
[EditorSequence(1)]
|
|
|
public string FileName { get; set; }
|
|
|
|
|
|
- [IntegerEditor]
|
|
|
[EditorSequence(2)]
|
|
|
public int Port { get; set; }
|
|
|
|
|
|
- [IntegerEditor]
|
|
|
[EditorSequence(3)]
|
|
|
public int RPCPort { get; set; }
|
|
|
|
|
|
- [TextBoxEditor]
|
|
|
[EditorSequence(4)]
|
|
|
public string GoogleAPIKey { get; set; }
|
|
|
|
|
@@ -65,11 +61,9 @@ namespace PRSServer
|
|
|
public string PurchaseOrderPrefix { get; set; }
|
|
|
|
|
|
[EditorSequence(7)]
|
|
|
- [IntegerEditor]
|
|
|
public int PasswordExpiryTime { get; set; }
|
|
|
|
|
|
[EditorSequence(8)]
|
|
|
- [IntegerEditor]
|
|
|
[Caption("Login Expiry Time (mins)")]
|
|
|
public int SessionExpiryTime { get; set; }
|
|
|
|
|
@@ -78,11 +72,10 @@ namespace PRSServer
|
|
|
|
|
|
[EditorSequence(9)]
|
|
|
[FileNameEditor("Certificate Files (*.pfx)|*.pfx")]
|
|
|
- public string CertificateFile { get; set; }
|
|
|
+ public string? CertificateFile { get; set; }
|
|
|
|
|
|
[EditorSequence(10)]
|
|
|
- [TextBoxEditor]
|
|
|
- public string CertificateExpirationSubscriber { get; set; }
|
|
|
+ public string? CertificateExpirationSubscriber { get; set; }
|
|
|
|
|
|
[EditorSequence(11)]
|
|
|
[ColorEditor]
|
|
@@ -90,7 +83,13 @@ namespace PRSServer
|
|
|
|
|
|
[EmbeddedImageEditor(MaximumHeight = 450, MaximumWidth = 450)]
|
|
|
[EditorSequence(12)]
|
|
|
- public byte[] Logo { get; set; }
|
|
|
+ public byte[]? Logo { get; set; }
|
|
|
+
|
|
|
+ [EditorSequence(13)]
|
|
|
+ public ServerEmailType EmailType { get; set; }
|
|
|
+
|
|
|
+ [NullEditor]
|
|
|
+ public string EmailProperties { get; set; } = "";
|
|
|
|
|
|
public override ServerType Type()
|
|
|
{
|
|
@@ -101,5 +100,29 @@ namespace PRSServer
|
|
|
newstyle
|
|
|
? $"{serviceName}_RPC"
|
|
|
: $"{serviceName}_IPC";
|
|
|
+
|
|
|
+ public BaseObject GetEmailProperties()
|
|
|
+ {
|
|
|
+ return EmailType switch
|
|
|
+ {
|
|
|
+ ServerEmailType.IMAP => Serialization.Deserialize<ServerEmailIMAPProperties>(EmailProperties)
|
|
|
+ ?? new ServerEmailIMAPProperties(),
|
|
|
+ ServerEmailType.Exchange => Serialization.Deserialize<ServerEmailExchangeProperties>(EmailProperties)
|
|
|
+ ?? new ServerEmailExchangeProperties(),
|
|
|
+ _ => throw new Exception($"Invalid email type {EmailType}"),
|
|
|
+ };
|
|
|
+ }
|
|
|
+ public void SetEmailProperties(BaseObject props)
|
|
|
+ {
|
|
|
+ EmailProperties = Serialization.Serialize(props);
|
|
|
+ if(props is ServerEmailIMAPProperties)
|
|
|
+ {
|
|
|
+ EmailType = ServerEmailType.IMAP;
|
|
|
+ }
|
|
|
+ else if(props is ServerEmailExchangeProperties)
|
|
|
+ {
|
|
|
+ EmailType = ServerEmailType.Exchange;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|