WordPress.org

Ready to get started?Download WordPress

Forums

WP-DownloadManager
[resolved] Add ability to filter user authentication check (5 posts)

  1. Faison
    Member
    Posted 6 months ago #

    I'm working on a site that uses a third party authentication system. When a user authenticates with the third party, they are not logged into WordPress so any checks with the function is_user_logged_in() will fail. If you could add a filter to the logged in check, that would allow myself and others to determine if a person not logged into WordPress is allowed to download a protected file.

    I've already made this change on my copy and all you would need to do is replace the following code in the files /download-manager.php, /process.php, and /download.php:

    if($data['access']=='member'&&!is_user_logged_in())

    With this code:

    $user_needs_to_login = $data['access']=='member'&&!is_user_logged_in();
    $user_needs_to_login = apply_filters( 'dm_user_needs_to_login', $user_needs_to_login );
    if($user_needs_to_login)

    If you could make that change, that would help me out a ton.

    Thanks,
    Faison

    http://wordpress.org/plugins/wp-downloadmanager/

  2. Lester Chan
    Member
    Plugin Author

    Posted 6 months ago #

    Hey Faison,

    Sounds good, possible to submit a pull request to me via https://github.com/lesterchan/wp-downloadmanager? Or the code you modified is just the 3 lines?

  3. Faison
    Member
    Posted 5 months ago #

    Hi Lester,

    I was going to send you a pull request, but I noticed that your github repo has version 1.61 of Download Manager, whereas the plugin repo version is at version 2.5.4. If you get the github repo up-to-date, I can send over a pull request.

    Thanks,
    Faison

  4. Lester Chan
    Member
    Plugin Author

    Posted 5 months ago #

    Hey Faison,

    The GitHub repo is always the latest, I just checked, both are 1.61.

  5. Faison
    Member
    Posted 5 months ago #

    Wow, I'm sorry and feel embarrassed. The plugin I'm looking at is actually a different Download Manager plugin and I didn't read well enough to notice that I was posting in the wrong one.

    Again I'm really sorry, but I hope you have a good one.

    Thanks,
    Faison

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.