$symlinkLocation = $symlinkList_Item["location"]; if ($modulePermissions[$symlinkName]["permissions"]["group_id"] <= $scadaUserPermission_GroupID) { if ($symlinkDisplayBoolean == "true") { if ($numberOfModules_OnNavigation <= 4) { print "<a onclick=\"areaLoader('{$symlinkName}')\" id=\"scadaNavItem\">"; print $symlinkName; print "</a>"; $numberOfModules_OnNavigation = $numberOfModules_OnNavigation + 1; } else { $extraModules_NavigationArray[] = $symlinkName; } } } } if ($numberOfModules_OnNavigation > 5) { print "<div class=\"showMoreNavigation\">"; foreach ($extraModules_NavigationArray as $key => $navigationLink) { print "<a onclick=\"areaLoader('{$navigationLink}')\">{$navigationLink}</a>"; } print "</div>"; } /* End of symlink Analyzing */ /* User Dropdown */ /* End of User Dropdown */ print "</div>"; } else { atlasui_redirect("login", 0.5); } ?> </body> </html>
$passwordHash = $configJSON_Decoded["preferences"]["password_hash"]; $uncleanUsername = $_POST["username"]; $uncleanPassword = $_POST["password"]; $uncleanBotProtection = $_POST["botProtection"]; $botProtectionActual = $_POST["botProtectionActual"]; $unhashedUsername = atlasui_string_clean($uncleanUsername, 1, true); $unhashedPassword = atlasui_string_clean($uncleanPassword, 1, true); $inputBotProtection = atlasui_string_clean($uncleanBotProtection, 1, true); if ($inputBotProtection == $botProtectionActual) { $userFile_Hash = substr(atlasui_encrypt($unhashedUsername, "strong", "100000", $passwordHash), 0, 16); $hashedUsername = atlasui_encrypt($unhashedUsername, "strong", "100000", $passwordHash); $hashedPassword = atlasui_encrypt($unhashedPassword, "strong", "100000", $passwordHash); if (file_exists("users/{$userFile_Hash}.json")) { $userInfo_Encoded = file_get_contents("users/{$userFile_Hash}.json"); $userInfo_Decoded = json_decode($userInfo_Encoded, true); if ($userInfo_Decoded["general"]["username"] == $hashedUsername && $userInfo_Decoded["general"]["password"] == $hashedPassword) { $setCookie_Address = $_SERVER['SERVER_NAME']; setcookie("openweb-scada", $hashedUsername, time() + 3600 * 24 * 14, __DIR__, $setCookie_Address, false, true); atlasui_redirect("index", 0.5); } else { loginForm(); } } else { loginForm(); } } else { loginForm(); } } else { loginForm(); }