• Resolved Yannick Lefebvre

    (@jackdewey)


    Hi, I have been using Download Manager since last summer on a private site that my company uses as a sales portal for our sales team and sales partners.

    While the plugin worked very well, one issue I had is that once someone had a link for a download, they could still use that direct link when they were not logged into the site.

    To correct the issue, I added a few lines in the after_setup_theme hook to remove the download action if the user is not logged in:

    add_action( 'after_setup_theme', 'cml_hook_the_remove', 1) ;
    
    function cml_hook_the_remove() {
    	if ( !is_user_logged_in() ) {
    		$removal_success = remove_action( 'init', 'wpdm_DownloadNow', 10 );
    	}
    }

    In recent versions of Download Manager, the wpdm_DownloadNow was moved into the Apply class and renamed. The problem with this is that you need to have a global pointer to the class to be able to remove that action hook call and the code does not store the pointer to class after it instantiates it.

    I have rolled back to version 2.8.3 for the moment until a way to remove that action hook can be provided.

    https://www.ads-software.com/plugins/download-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change in API causing problems with protected site’ is closed to new replies.