Code fixing

This commit is contained in:
bergware
2025-02-01 16:27:44 +01:00
parent 373485256e
commit 4059d6f7ef
2 changed files with 10 additions and 8 deletions

View File

@@ -11,11 +11,12 @@
*/
?>
<?
extract(parse_ini_file("/etc/rc.d/rc.ssl.input"));
$ssl = '/etc/rc.d/rc.ssl.input';
if (is_readable($ssl)) extract(parse_ini_file($ssl));
// encrypt username and password before saving (if existing)
if (!empty($_POST['USERNAME'])) $_POST['USERNAME'] = openssl_encrypt($_POST['USERNAME'],$cipher,$key,0,$iv);
if (!empty($_POST['PASSWORD'])) $_POST['PASSWORD'] = openssl_encrypt($_POST['PASSWORD'],$cipher,$key,0,$iv);
if (!empty($_POST['USERNAME']) && isset($cipher,$key,$iv)) $_POST['USERNAME'] = openssl_encrypt($_POST['USERNAME'],$cipher,$key,0,$iv);
if (!empty($_POST['PASSWORD']) && isset($cipher,$key,$iv)) $_POST['PASSWORD'] = openssl_encrypt($_POST['PASSWORD'],$cipher,$key,0,$iv);
// update active wifi selection
foreach ($keys as $key => $val) if (isset($val['GROUP'])) $keys[$key]['GROUP'] = 'saved';