solved private profiles can't download their jrFiles

blindmime
@blindmime
11 years ago
772 posts
I'm hoping this can be fixed soon since I'm in the middle of a rollout (if it is, indeed, a bug).

I've set up a proofing system for clients. I have private profiles and the jrFile module. We upload files with jrFile. The customer logs in and clicks the file icon to download. However, if their profile is a private profile, they can't download their own files.



I'm using jrElastic.
updated by @blindmime: 05/04/14 06:31:29PM
brian
@brian
11 years ago
10,149 posts
I'll check this out.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,149 posts
A quick fix for this is to open the jrCore/index.php file and around like 5100 you will see this:

if (isset($_rt['profile_private']) && $_rt['profile_private'] != '1') {

Change it to this:

if ($_user['user_active_profile_id'] != $_rt['_profile_id'] && isset($_rt['profile_private']) && $_rt['profile_private'] != '1') {

That should fix it - I will get that in the next release of the core.

Let me know if that works.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 04/01/14 02:33:13PM
brian
@brian
11 years ago
10,149 posts
Double checking this code and I don't think it is needed - I can see the code is making sure the user is not part of the profile before telling them not allowed, but let me know if that helps or not.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
blindmime
@blindmime
11 years ago
772 posts
I got an error trying to log in after doing that. I think I found a couple extra ")". Here's what I have. Hope it's right:

if ($_user['user_active_profile_id'] != $_rt['_profile_id'] && isset($_rt['profile_private']) && $_rt['profile_private'] != '1') {
blindmime
@blindmime
11 years ago
772 posts
This code is now hiding their files entirely. Before, I could see a file list and access a detail page, but they just couldn't download the files. When you clicked on the file icon, a message which takes you out of the skin to a blank page (other than the message) says you don't have permission to download the file.
updated by @blindmime: 04/01/14 02:54:12PM
brian
@brian
11 years ago
10,149 posts
blindmime:
This code is now hiding their files entirely.

There's actually a bigger issue at play here - I'm assuming you have the Followers module disabled? I will push out a fix to the core here shortly.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
blindmime
@blindmime
11 years ago
772 posts
Yes, it's disabled.
brian
@brian
11 years ago
10,149 posts
blindmime:
Yes, it's disabled.

Yeah with the followers module disabled it takes a slightly different route through the privacy check function - and that way is missing adding in the user's active profile id.

I should have an update for the core in just a few minutes.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
brian
@brian
11 years ago
10,149 posts
OK - version 5.1.34 is up in the marketplace and it should fix this up.

Let me know if you see any issues.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
blindmime
@blindmime
11 years ago
772 posts
I appreciate all you do, Brian -- just let me know.

Thanks!
brian
@brian
11 years ago
10,149 posts
blindmime:
I appreciate all you do, Brian -- just let me know.

Thanks!

See my response above ;)

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
blindmime
@blindmime
11 years ago
772 posts
It looks like that fixed it.

Thanks again!
brian
@brian
11 years ago
10,149 posts
Right on - glad to hear that.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags