Control Panel login screen improvements

Allows saving of remote access password

Remote access button selected by default if used last

Tabbing through the page now goes in a sane fashion
This commit is contained in:
Cyberboss
2017-09-29 12:57:22 -04:00
parent a2bde8d2ee
commit d88a422125
10 changed files with 149 additions and 35 deletions
-19
View File
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
namespace TGServerService
{
@@ -61,24 +60,6 @@ namespace TGServerService
}
}
public static string EncryptData(byte[] data, out string sentropy)
{
// Generate additional entropy (will be used as the Initialization vector)
byte[] entropy = new byte[20];
using (var rng = new RNGCryptoServiceProvider())
rng.GetBytes(entropy);
byte[] ciphertext = ProtectedData.Protect(data, entropy, DataProtectionScope.CurrentUser);
sentropy = Convert.ToBase64String(entropy, 0, entropy.Length);
return Convert.ToBase64String(ciphertext, 0, ciphertext.Length);
}
public static byte[] DecryptData(string data, string entropy)
{
return ProtectedData.Unprotect(Convert.FromBase64String(data), Convert.FromBase64String(entropy), DataProtectionScope.CurrentUser);
}
public static void CopyDirectory(string sourceDirName, string destDirName, IList<string> ignore = null, bool ignoreIfNotExists = false)
{
// If the destination directory doesn't exist, create it.