viktoa
Forum Replies Created
-
Forum: Plugins
In reply to: [Force Login] Downloading Files not working for logged in usersHey,
yes i understand your point.
The new whitelist code solves the problem with the 2 parameters but it still only downloads the login html.
The $_SERVER[‘REMOTE_ADDR’] is not 127.0.0.1 as the download request comes still from the browser.Forum: Plugins
In reply to: [Force Login] Downloading Files not working for logged in usersThank you for your reply.
It starts to download a file (a jpg-file with the right name).
When I convert the jpeg file to an html-file it’s the html of the login screen.Yeah, the issue is caused by the plugin as it it works fine when I deactivate it.
When I use your code to whitelist the localhost it downloads this code
<b>Warning</b>: in_array() expects parameter 2 to be array, null given in <b>/htdocs/cprkunden/wp-content/plugins/wp-force-login/wp-force-login.php</b> on line <b>48</b>
Forum: Plugins
In reply to: [Force Login] Downloading Files not working for logged in usersHey Kevin,
thank you very much for replying.
I tried your newest version from github but the problem still exists.
$zip = new ZipArchive(); // Load zip library $zip_name = "download.zip"; // Zip name if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE) { // Opening zip file to load files $error .= "* Sorry ZIP creation failed at this time"; } foreach($post['files'] as $file) { # download file $download_file = file_get_contents($file); #add it to the zip $zip->addFromString(basename($file),$download_file); //$zip->addFile($file); // Adding files into zip } $zip->close(); if(file_exists($zip_name)) { // push to download the zip header('Content-type: application/zip'); header('Content-Disposition: attachment; filename="'.$zip_name.'"'); readfile($zip_name);
Can i whitelist the server?