Allowing user to log in for 24 hours.

Hello, now I need your help. I am looking for a plug or the like to obtain this feature, perhaps there is here with wpmudev.

1, Files'll go for me as administrator to upload, they should, however, be locked to outsiders.
2, I'll be able to create a user account where the user by username and password will be able to download files that it needs, it will be time limited to 24 hours. After this, it should not go to login.
3, would also be good if you could create different folders and where to place the various documents for easier to find what you are looking for.

Hope you understand what I mean :slight_smile:

  • Nithin

    Hi Ingemar,

    Hope you are doing good today. :slight_smile:

    1, Files'll go for me as administrator to upload, they should, however, be locked to outsiders.

    Not sure whether I understand you fully here, this would be the default function in WordPress, ie the only administrator can upload, you'll have to make sure the users have a role of contributor, or subscriber, so that they don't have permission to upload any content.

    If that's not what you meant, please explain further, what is the exact upload feature you are looking for?

    2, I'll be able to create a user account where the user by username and password will be able to download files that it needs, it will be time limited to 24 hours. After this, it should not go to login.

    You can use a plugin like WP Login Timeout Settings, so that you set the timeout for their logins to 24 hours:
    https://wordpress.org/plugins/wp-login-timeout-settings

    3, would also be good if you could create different folders and where to place the various documents for easier to find what you are looking for.

    Maybe Media Library Plus plugin feature is what you are looking for? Please check, and see whether this is what you meant, if not, please provide more information of your exact needs.
    https://wordpress.org/plugins/media-library-plus/

    I hope this helps .Please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

  • Rupok

    Hi Ingemar,

    you can create a login that works in 24 hours, and limit access to only those users to be able to download files?

    I believe this is possible with Membership 2 Pro.

    At first, you will need to install and activate Membership 2 Pro. Then go to "Dashboard > Membership 2 > Memberships" section and create a membership. After creating the membership, please edit that membership and disable the "This membership is public" option. Then go to "Access options" tab. There, change the "Access Structure" dropdown from "Permanent access" to "Finite access". Then set "Grant access for" option to "1 Day". This will allow the members of this membership to access the content protected for this membership for only 1 day (24 hours).

    After that, go to "Dashboard > Membership 2 > Add-ons" section and enable the "Media Protection" add-on. After enabling that add-on, please click the "Details..." link on that add-on box. Please check the attached screenshot for reference.

    A popup will appear. In that popup, enable the "Protect Individual Media files" option.

    Then go to "Dashboard > Membership 2 > Protection Rules > Media Library Items" section and protect your downloadable files for the membership you just created.

    After doing all these, you should assign your users this membership by going to "Dashboard > Membership 2 > Add Member" section whom you want to allow to access your protected downloadable files for 24 hours.

    I believe this will help. Please let us know if you have any confusion or any further query. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

  • Rupok

    Hi Ingemar,

    So sorry for the delay from our end. We do apologize for this. Actually, we try to reply older threads first and every time you put a comment your thread goes down in the queue and delay happens. However, we will try to make sure that this type of delay doesn't happen again.

    Now, regarding your query, when you protect a media item with Media Protection addon, those are unavailable when the user is not logged in or the user is not a member of the membership plan for which that media item is protected. Suppose, you have the following in your Media Protection addon settings:

    Your users will see something like this when they are out of the membership plan or not logged in:

    If they try to access the direct link to the media item, they will see this:

    So your content will be protected and there is no way to access those without being logged in and being an active member of the membership plan.

    I believe, these will help. Please let us know if you have any confusion or any further query. We will be glad to help.

    Have a nice day. Cheers!
    Rupok

  • James Morris

    Hello Ingemar,

    I hope you don't mind me jumping in here, but I believe I've found a partial solution.

    First, to explain: Membership 2 controls access to content that is passed through WordPress - meaning, anything that is passed through the_content() or through the admin side. The key here is PHP has to be involved. Static resource URIs such as file uploads are not passed through PHP to be accessed. This access control must be handled at the server level, independent of WordPress.

    However, I believe I've found a partial solution that will give some protection... Using the instructions from this article, I crafted an addition to my .htaccess file that prevents all but logged in users from accessing my static resources by direct URI.

    Here is the addition I made to my .htaccess:

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?ss\.wpdevtests\.com/ [NC]
    RewriteCond %{REQUEST_URI} !hotlink\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov) [NC]
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule .*\.(gif|png|jpg|doc|xls|pdf|html|htm|xlsx|docx|mp4|mov)$ http://ss.wpdevtests.com/ [NC]

    Here are the test URIs:
    http://ss.wpdevtests.com/wp-content-link-test/
    http://ss.wpdevtests.com/wp-content/uploads/2017/03/best-pics-from-year-in-space-nasa-scott-kelly-42-300x200.jpg

    As you can see, you can still see the image in the post, but you cannot access the direct link without being logged in.

    Let us know if you have any further questions. We'll be happy to help! :slight_smile:

    Best regards,

    James Morris