Login & Transactions

This commit is contained in:
HojouFotytu 2024-01-21 13:22:10 +09:00
parent 871818d88b
commit 44610b4d6e
4 changed files with 2 additions and 15 deletions

View File

@ -28,7 +28,6 @@
</button>
</span>
</div>
<p><input type="checkbox" name="cbRememberMe"/> <label for="cbRememberMe">Stay logged in</label></p>
</div>
</form>

View File

@ -32,18 +32,7 @@ namespace Monitor.Pages
HttpContext.Session.SetString("LoggedIn" + PTMagicConfiguration.GeneralSettings.Monitor.Port.ToString(), DateTime.UtcNow.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'"));
PTMagicConfiguration.GeneralSettings.Monitor.IsPasswordProtected = true;
//PTMagicConfiguration.WriteGeneralSettings();
if (cbRememberMe != null)
{
if (cbRememberMe.Equals("on", StringComparison.InvariantCultureIgnoreCase))
{
CookieOptions cookieOption = new CookieOptions();
cookieOption.Expires = DateTime.UtcNow.AddYears(1);
string cookieValue = EncryptionHelper.Encrypt(encryptedPassword);
Response.Cookies.Append("PTMRememberMeKey", cookieValue, cookieOption);
}
}
Response.Redirect(PTMagicConfiguration.GeneralSettings.Monitor.RootUrl);
}

View File

@ -101,7 +101,6 @@
<ul class="submenu">
<li><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)SettingsGeneral"><i class="fa fa-power-off"></i> General</a></li>
<li><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)SettingsAnalyzer"><i class="fa fa-magic"></i> Analyzer</a></li>
<li><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)Transactions"><i class="fa fa-exchange"></i> Transactions</a></li>
<li><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)PresetFiles"><i class="fa fa-edit"></i> Presets Files</a></li>
</ul>
</li>

View File

@ -50,7 +50,7 @@ namespace Monitor
services.AddDistributedMemoryCache();
services.AddSession(options =>
{
options.IdleTimeout = TimeSpan.FromSeconds(900);
options.IdleTimeout = TimeSpan.FromSeconds(1800);
options.Cookie.HttpOnly = true;
options.Cookie.Name = "PTMagicMonitor" + systemConfiguration.GeneralSettings.Monitor.Port.ToString();
});