forked from Scrik/WebFMX3
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjsongen.php
29 lines (24 loc) · 1.13 KB
/
jsongen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
header('Content-Type: application/json; charset=utf-8');
include('webUtils/filesUtils.php');
include('webUtils/auxUtils.php');
include('settings.php');
$password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);
if ($password !== $jsonGenPassword)
{
header('Content-type: text/html; charset=utf-8');
echo '<html><body><form action="#" method=post>Password: <input type="password" name="password"> <input type="submit" value="Generate JSON"></form></body></html>';
} else {
$generatedFilesList = array();
GenerateFullFileList($clientsFolder, $generatedFilesList);
GenerateFullFileList($javaFolder, $generatedFilesList);
$keyLength = strlen($encryptionKey);
foreach ($generatedFilesList as $fileslistPath) {
$data = file_get_contents($fileslistPath);
EncryptRijndael($data, $encryptionKey);
file_put_contents($fileslistPath, $data);
echo 'Сгенерировано и зашифровано: '.$fileslistPath."\r\n";
}
echo 'Готово!';
}
?>