
Please help I love this little program and I would buy the template add on if the uploads worked.
Cheers and hope we can work it out for the simpler minded.
$filesList = $conn->query("SELECT * FROM `files` WHERE `project` = 28")->fetchAll();
$list = array('pass8','pass7','pass6','pass5','pass4','pass3','pass2','pass1');
$filesList = $conn->query("SELECT * FROM `files`")->fetchAll(); // fetch all project of the database
<?php
require("./init.php");
$path = "./include/phpseclib";
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
$filesList = $conn->query("SELECT * FROM `files` WHERE `project` = 28")->fetchAll(); // line to fetch one project
//$filesList = $conn->query("SELECT * FROM `files`")->fetchAll(); // fetch all project of the database
$myfile = new datei();
foreach($filesList as $file){
$tmpFile = CL_ROOT . "/" . $file["datei"];
$list = array('pass8','pass7','pass6','pass5','pass4','pass3','pass2','pass1');
$test = file_get_contents($tmpFile);
$flag = false;
$good = ""; // clear stream at every loop
// loop to decrypt with the 8 pass
foreach ($list as $contrasena) {
$plaintext = $myfile->decryptPFile($test, $contrasena);
if($plaintext) {
$test = $plaintext;
$good = $plaintext;
$flag = true;
} else {
if ($flag == false) {
$test = file_get_contents($tmpFile);
} else {
$test = $good;
}
}
}
//will leave the file as it is, if no decryption has occurred
if(!$plaintext){
if($good){
file_put_contents($tmpFile,$good);
}
} else {
file_put_contents($tmpFile,$plaintext);
}
}
?>
//$this->encryptFile($datei_final);
//encrypt files in their tmp location
$myfile->encryptFile($file["tmp_name"], $settings["filePass"]);
Safari, Firefox (Mac OS), Internet Explorer (Win) can not open files (tested with pdf, doc and docx files) after download!
Only chromium (Mac OSX) works up to now successfully!
Users browsing this forum: No registered users