• Resolved carsononline

    (@carsononline)


    I have been looking for this kind of thing for quite some time.

    I need –
    1. User to login
    2. User to have access to (their own) files that I uploaded via ftp in a sortable list
    3. It to prompt you to log in when not logged in.

    This seems to solve most of these issues, except there is no recursiveness, and I get errors about directory not found when accessing a “files” page when not logged in. fa-nulldirectory is where its pointing with nobody logged in. That causes scandir errors and more.

    Can you help with any of these?

    https://www.ads-software.com/plugins/file-away/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author thomstark

    (@thomstark)

    Hi, sorry about that. I didn’t realize fa-nulldirectory was causing scandir errors. Are you seeing those errors on the page? Because you can turn that off.

    As a temporary fix, you can use another plugin of mine, very lightweight. Eyes Only: User Access Shortcode. Wrap an [eyesonly] shortcode around your [fileaway] shortcode and set it to hide from logged out users. That will solve the scandir errors until I have time to get a new approach. I will also add the feature to prompt to login if the fileaway shortcode is set for logged in users only. But I don’t have a timeframe. It’s a good suggestion so I intend to honor it.

    Recursiveness is probably not going to happen unless I get a brain tumor that makes me smarter, or someone comes along to help me. Sorry about that.

    Thread Starter carsononline

    (@carsononline)

    Thanks for the fix and the quick info..

    Can you think of any workarounds for recursive? Your plugin works so perfectly for what I need, just not recursively. Email me and I might have something to help.

    Cheers!!

    Plugin Author thomstark

    (@thomstark)

    Got your email. Go ahead and edit it out. I’ll email you when I get home later. Thanks.

    Thread Starter carsononline

    (@carsononline)

    Had an error when not logged in, but I just had to create an empty “fa-nulldirectory” in my folders tree. Errors gone.

    Now to get recursive. ??

    Plugin Author thomstark

    (@thomstark)

    Not at all. I realize now why that doesn’t fix the issue. Will work on it when I get home.

    Plugin Author thomstark

    (@thomstark)

    All right. I have a quick fix, which will be included in the next version. You can do this one of two ways.

    1) I’ve uploaded the fix to the current version on the repository, so if you want to change the version number back a notch in the main plugin file, or just manually download the plugin again and overwrite the current installation, it’ll be fixed. I’m not pushing a new version yet because I want to make this fix a little more integrated with my “debug” feature. But in the meantime, it should work for you.

    2) You can make the change yourself. Go to wp-content/plugins/file-away/includes/ and open up file-away.php for editing. If the lines are double-spaced, go down to about line 97 or so (if single-spaced, whatever half of 97 is). Find the two lines that look like this:

    $dir = (strpos ($dir, '//') ? preg_replace('#/+#', '/', $dir) : $dir );
    include SSFA_INCLUDES.'shortcode-options.php';

    In between those two lines, add this line of code:

    if ($private_content = true and !is_dir($dir)) return null;

    That’ll get rid of your errors. It checks if the shortcode is supposed to be pointing to something that only logged-in users can see, and then checks if the directory it’s pointing to exists. If not, it outputs nothing. Got rid of the errors for me.

    When I release the next version, I’ll do something with login prompting, or even a redirect to a login page (defined in the shortcode). We could do a login message, or a redirect (not sure if I want to set up both though, as I’m swamped ATM). But you’ll have to use a shortcode attribute to activate it, because one of the features of File Away is the user doesn’t see anything if there’s nothing for them to see.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Couple of issues – Wants. :)’ is closed to new replies.