Revert latest encryption changes to previous state

This commit is contained in:
bergware
2017-09-12 08:22:55 +02:00
parent eba4c5a6ce
commit eea7980f74
3 changed files with 14 additions and 136 deletions
+3 -8
View File
@@ -11,22 +11,17 @@
*/
?>
<?
$var = parse_ini_file('/var/local/emhttp/var.ini');
$cfg = '/boot/config/keyfile.cfg';
$var = parse_ini_file('/var/local/emhttp/var.ini');
$luks = $var['luksKeyfile'];
$text = $_POST['text'] ?? false;
$file = $_POST['file'] ?? false;
$flag = $_POST['flag'] ?? false;
$text = $_POST['text'] ?? '';
$file = $_POST['file'] ?? '';
if ($text) {
file_put_contents($luks, $text);
if ($flag) file_put_contents($cfg,'text');
} elseif ($file) {
file_put_contents($luks, $file);
if ($flag) file_put_contents($cfg,'file');
} else {
@unlink($luks);
if ($_POST['reset']) @unlink($cfg);
}
$save = false;
?>