=== s2member Secure File Browser === Contributors: Potsky Donate link: Tags: s2member, file, browser Requires at least: 3.2 Tested up to: 3.5 Stable tag: 0.2.1 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html A plugin for browsing files from the secure-files location of the s2member WordPress Membership plugin. == Description == s2member Secure File Browser is a wordpress plugin for browsing files from the secure-files location of the s2member WordPress Membership plugin. You can display the file browser via the shortcode `[s2member_secure_files_browser /]`. The shortcode will display a file browser item with only granted directories for current user. The shortcode can handle : * `access-s2member-level0` directory for level #0 and more users * `access-s2member-level1` directory for level #1 and more users * `access-s2member-level2` directory for level #2 and more users * `access-s2member-level3` directory for level #3 and more users * `access-s2member-level4` directory for level #4 and more users * `access-s2member-ccap-*` custom capabilities directories for according users * any directory for all users Clicking on a file will launch the download according to the s2member files access control. **Available shortcode options** * `dirbase` : initial directory from the s2member-files directory > default is / * `hidden` : show hidden files or not > default is no 0 > set to 1 to display * `dirfirst` : show directories above files > default is yes 1 > set to 0 to display directories with files * `names` : replace files name with custom values. > Syntax : `realfilename_1:Custom File Name #1|...|realfilename_n:Custom File Name #n` > `access-s2member-level#` will be automatically renamed with your s2member level custom labels. * `folderevent` : event to trigger expand/collapse > default is `click` (can be `mouseover`, …) * `expandspeed` : speed of the expand folder action in ms > default is `500` (ms) > use `-1` for no animation * `expandeasing` : easing function to use on expand > default is `swing` > can be set to `linear` * `collapsespeed` : speed of the collapse folder action in ms > default is `500` (ms) > use `-1` for no animation * `collapseeasing` : easing function to use on collapse > default is `swing` > can be set to `linear` * `multifolder` : whether or not to limit the browser to one subfolder at a time > default yes 1 > set to 0 to display only one open directory at a time * `openrecursive` : whether or not to open all subdirectories when opening a directory > default no 0 > set to 1 to open recursively subdirectories when opening a directory (then all directories will be open at initialization) * `filterdir` : a full regexp directories have to match to be displayed ([regexp format](http://www.php.net/manual/en/pcre.pattern.php "PCRE"), `preg_match` PHP function is used) > eg: `/(access|user)/i` * `filterfile` : a full regexp files have to match to be displayed ([regexp format](http://www.php.net/manual/en/pcre.pattern.php "PCRE"), `preg_match` PHP function is used) > eg: `/\.(png|jpe?g|gif|zip)$/i` **Example** (*A shortcode has to be defined on one line, here is on several lines below only for better understanding*) : `[s2member_secure_files_browser folderevent="mouseover" expandeasing="linear" expandspeed="200" collapseeasing="swing" collapsespeed="200" multifolder="0" openrecursive="1" dirbase="/" hidden="1" dirfirst="0" openrecursive="1" filterdir="/(access|user)/i" filterfile="/\.(png|jpe?g|gif|zip)$/i" names="access-s2member-level0:General|access-s2member-ccap-video:Videos" /]` Don't hesitate to ask me new features or report bugs on [potsky.com](https://www.potsky.com/code/wordpress-plugins/s2member-secure-file-browser/ "Plugin page") ! You can join me on [GitHub](https://github.com/potsky/WordPressS2MemberFileBrowser/ "GitHub") to add feature, fix bugs,... ! == Installation == **s2member Secure File Browser** is very easy to install (instructions) : * Upload the `/s2member-secure-file-browser` folder to your `/wp-content/plugins/` directory. * Activate the plugin through the Plugins menu in WordPress®. * Use the shortcode `[s2member_secure_files_browser/]` in your pages, enjoy! == Frequently asked questions == = s2member secure files are always directly downloadable, how can I protect them by forcing php handling ? = It is recommended to add a `deny from all` directive in your `httpd.conf` for your s2member-files directory in order to avoid people directly access your protected files. Do not put the `deny` directive in the `s2member-files/.htaccess` because this file is always regenerated by s2member and your modifications are always overwritten. = Why s2member-files/.htaccess is not displayed ? = Even if you set shortcode option `hidden` to `1`, `.htaccess` will never been displayed. == Screenshots == 1. File browser in action == Changelog == = 0.2.1 = * Publishing fix = 0.2 = * Enhancement : file and directories icons are now clickable * New feature : shortag option filterdir * New feature : shortag option filterfile * New feature : shortag option openrecursive * Security fix : real path check perform to forbid browsing above s2member-files directory * Bug fix : dirbase now works as expected = 0.1 = * First release == Upgrade Notice == = 0.2.1 = This version fixes a security related bug. Upgrade immediately.