Giter VIP home page Giter VIP logo

wordpressauthdownloads's Introduction

WordPressAuthDownloads

PHP script which streams file from a localhost-only accessible directory to authenticated WordPress users on a particular WordPress website.

##Instructions

  • Create a directory to serve as the "secret_files" directory that the web server can access.

  • Place the .htaccess file in the directory created in 1. On line 4 fill the quotation marks with the full path to the secret directory.

    • Include trailing slash '/'
<Directory "/var/www/secret_files/">
  • Place the protected_user_files.php in the same directory as the wp-load.php file in your wordpress site (the directory with all core WordPress files).

  • Change the variable $protected_path to the path of the directory created in #1 in protected_user_files.php.

    • Include trailing slash '/'
  • Change the variable $wp_url to the site's "WordPress Address (URL)" --This is where the WordPress core files reside.

    • Include trailing slash '/'
    • Able to be located on the Settings->General screen
  • Change $web_name to the name of the site.

  • Put files into the secret directory (any type is compatible)

  • Go to $wp_url/protected_user_files.php and you will see a table of file names and the associated link which will cause them to be able to be downloaded by users logged in on your WordPress site. This page will only show for authenticated users on the wordpress site.

  • Copy/Paste the link generated for the corresponding file name. The script will use the name $_GET variable to stream the file to logged in users on the website.

  • Note: This will work for any logged in WordPress user (specific to the site). There is no distinction in user privillege level.

Contact W. Ryan Parker for comments or questions ([email protected])

wordpressauthdownloads's People

Contributors

wrparker avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.