🔐PWD work #634

This commit is contained in:
jokob-sk
2024-04-20 10:14:22 +10:00
parent c1b5a2684b
commit 003fc557cd
19 changed files with 76 additions and 248 deletions

View File

@@ -328,7 +328,7 @@ function saveSettings()
$settingValue = $setting[3];
if ($group == $settingGroup) {
if ($settingType == 'text' || $settingType == 'password' || $settingType == 'readonly' || $settingType == 'text.select') {
if ($settingType == 'text' || $settingType == 'password' || $settingType == 'password.SHA256' || $settingType == 'readonly' || $settingType == 'text.select') {
$val = encode_single_quotes($settingValue);
$txt .= $settingKey . "='" . $val . "'\n";
} elseif ($settingType == 'integer' || $settingType == 'integer.select') {

View File

@@ -29,18 +29,18 @@ $config_file_lines = file($config_file);
$CookieSaveLoginName = "NetAlertX_SaveLogin";
// ###################################
// ## PIALERT_WEB_PROTECTION FALSE
// ## SETPWD_enable_password FALSE
// ###################################
$config_file_lines_bypass = array_values(preg_grep('/^PIALERT_WEB_PROTECTION.*=/', $config_file_lines));
$config_file_lines_bypass = array_values(preg_grep('/^SETPWD_enable_password.*=/', $config_file_lines));
$protection_line = explode("=", $config_file_lines_bypass[0]);
$Pia_WebProtection = strtolower(trim($protection_line[1]));
// ###################################
// ## PIALERT_WEB_PROTECTION TRUE
// ## SETPWD_enable_password TRUE
// ###################################
$config_file_lines = array_values(preg_grep('/^PIALERT_WEB_PASSWORD.*=/', $config_file_lines));
$config_file_lines = array_values(preg_grep('/^SETPWD_password.*=/', $config_file_lines));
$password_line = explode("'", $config_file_lines[0]);
$Pia_Password = $password_line[1];