password check path

This commit is contained in:
HojouFotytu 2021-02-27 15:05:12 +09:00
parent 1da425219e
commit b86aa273ee
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@
<div class="p-20"> <div class="p-20">
<form class="form-horizontal m-t-20" method="post"> <form class="form-horizontal m-t-20" method="post">
@if (System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory().Split("Monitor")[0] + "settings.secure.json")) @if (System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory().Split("Monitor")[0] + "/settings.secure.json"))
{ {
<div class="form-group"> <div class="form-group">
<div class="col-12"> <div class="col-12">

View File

@ -27,7 +27,7 @@ namespace Monitor.Pages
{ {
encryptedOldPassword = EncryptionHelper.Encrypt(OldPassword); encryptedOldPassword = EncryptionHelper.Encrypt(OldPassword);
if (!Password.Equals(PasswordConfirm) || !encryptedOldPassword.Equals(PTMagicConfiguration.SecureSettings.MonitorPassword) && System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory().Split("Monitor")[0] + "settings.secure.json")) if (!Password.Equals(PasswordConfirm) || !encryptedOldPassword.Equals(PTMagicConfiguration.SecureSettings.MonitorPassword) && System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory().Split("Monitor")[0] + "/settings.secure.json"))
{ {
ValidationMessage = "Old Password wrong or new Password does not match with confirmation"; ValidationMessage = "Old Password wrong or new Password does not match with confirmation";
} }
@ -40,7 +40,7 @@ namespace Monitor.Pages
} }
else else
{ {
if (!Password.Equals(PasswordConfirm) && !System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory().Split("Monitor")[0] + "settings.secure.json")) if (!Password.Equals(PasswordConfirm) && !System.IO.File.Exists(System.IO.Directory.GetCurrentDirectory().Split("Monitor")[0] + "/settings.secure.json"))
{ {
ValidationMessage = "New Password does not match with confirmation"; ValidationMessage = "New Password does not match with confirmation";
} }