mirror of
https://github.com/unraid/webgui.git
synced 2026-05-24 07:09:42 -05:00
Wireless support - allow initial plain username and password
When user name and password are stored in plain text, these will be encrypted at start up.
This commit is contained in:
@@ -11,12 +11,11 @@
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
$ssl = '/etc/rc.d/rc.ssl.input';
|
||||
if (is_readable($ssl)) extract(parse_ini_file($ssl));
|
||||
$open_ssl = "/usr/local/emhttp/webGui/scripts/open_ssl";
|
||||
|
||||
// encrypt username and password before saving (if existing)
|
||||
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);
|
||||
if (!empty($_POST['USERNAME'])) $_POST['USERNAME'] = exec("$open_ssl encrypt \"{$_POST['USERNAME']}\"");
|
||||
if (!empty($_POST['PASSWORD'])) $_POST['PASSWORD'] = exec("$open_ssl encrypt \"{$_POST['PASSWORD']}\"");
|
||||
|
||||
// update active wifi selection
|
||||
foreach ($keys as $key => $val) if (isset($val['GROUP'])) $keys[$key]['GROUP'] = 'saved';
|
||||
|
||||
Reference in New Issue
Block a user