Lock files issue
-
Hi Alex, I’m working on my local enviroment to check if I can upgrade your plugin from old version 1.2.14 to the newest one 2.2.11 (you know that on my site the update procedure can’t fill correctly some columns on my site after the plugin update…)
So after some works on the tables to add values manually the posts seems switch to private, I did too to some attachments. So privating posts seems works only if I change manually the uam_access_group_to_object columns… It’s a hard work but seems work. OKNow I need to protect private pdf, xls, zip and docs files (leaving free all images on the site, obviously) so I’m going on to the lock files section.
In UAM > Settings > Setting files I set :
Lock files: yes
Download: normal (try fopen too)
Inline : empty
Locked directory type: WordPress
Blocked files type: Check “Files to block” and set pdf,xls,zip,docThe new version of the plugin create the .htaccess in uploads as follow:
<IfModule mod_rewrite.c> <FilesMatch '\.(pdf|zip|doc|xls)'> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_URI} !.*\/sites\/[0-9]+\/.* RewriteCond %{REQUEST_URI} ^.*/[0-9]{4}/[0-9]{2}.*$ RewriteRule ^([^?]*)$ /index.php?uamfiletype=attachment&uamgetfile=$1 [QSA,L] RewriteRule ^(.*)\?(((?!uamfiletype).)*)$ /index.php?uamfiletype=attachment&uamgetfile=$1&$2 [QSA,L] RewriteRule ^(.*)\?(.*)$ /index.php?uamgetfile=$1&$2 [QSA,L] </FilesMatch> </IfModule>
With this way I see the follow behaviour:
LOGGED USERS can’t no more download ALL pdf,xls,zip,file (public or not)
NOT LOGGED USERS: On direct link to protected files correctly shown “Permission denied to access the file” BUT on public files can’t download nothing…
ALL IMAGES ON THE SITE ARE NOT SHOWNSo I try to remove Blocked files type FLAG from Check “Files to block” and set instead the FLAG on “NOT blocked files” to “gif,jpg,png,jep” and the .htaccess chaanges correctly to
<IfModule mod_rewrite.c> <FilesMatch '^\.(gif|jpg|jpeg|png)'> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_URI} !.*\/sites\/[0-9]+\/.* RewriteCond %{REQUEST_URI} ^.*/[0-9]{4}/[0-9]{2}.*$ RewriteRule ^([^?]*)$ /index.php?uamfiletype=attachment&uamgetfile=$1 [QSA,L] RewriteRule ^(.*)\?(((?!uamfiletype).)*)$ /index.php?uamfiletype=attachment&uamgetfile=$1&$2 [QSA,L] RewriteRule ^(.*)\?(.*)$ /index.php?uamgetfile=$1&$2 [QSA,L] </FilesMatch> </IfModule>
This way now show images correctly but pdf,docs,xls and zip are open to view to LOGGED/NOT LOGGED USERS…
Can you help me? Seems one Flag exclude the other…
I also try Locked directory type: ALL or Blocked files type:ALL but no luckThanks in advance
J
- The topic ‘Lock files issue’ is closed to new replies.