Login & Transactions
This commit is contained in:
parent
871818d88b
commit
44610b4d6e
|
@ -28,7 +28,6 @@
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p><input type="checkbox" name="cbRememberMe"/> <label for="cbRememberMe">Stay logged in</label></p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -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'"));
|
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.GeneralSettings.Monitor.IsPasswordProtected = true;
|
||||||
//PTMagicConfiguration.WriteGeneralSettings();
|
//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);
|
Response.Redirect(PTMagicConfiguration.GeneralSettings.Monitor.RootUrl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,6 @@
|
||||||
<ul class="submenu">
|
<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)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)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>
|
<li><a href="@Html.Raw(Model.PTMagicConfiguration.GeneralSettings.Monitor.RootUrl)PresetFiles"><i class="fa fa-edit"></i> Presets Files</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -50,7 +50,7 @@ namespace Monitor
|
||||||
services.AddDistributedMemoryCache();
|
services.AddDistributedMemoryCache();
|
||||||
services.AddSession(options =>
|
services.AddSession(options =>
|
||||||
{
|
{
|
||||||
options.IdleTimeout = TimeSpan.FromSeconds(900);
|
options.IdleTimeout = TimeSpan.FromSeconds(1800);
|
||||||
options.Cookie.HttpOnly = true;
|
options.Cookie.HttpOnly = true;
|
||||||
options.Cookie.Name = "PTMagicMonitor" + systemConfiguration.GeneralSettings.Monitor.Port.ToString();
|
options.Cookie.Name = "PTMagicMonitor" + systemConfiguration.GeneralSettings.Monitor.Port.ToString();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue