Search found 11 matches

by terrylb
Fri Sep 07, 2018 9:31 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

I had a strong suspicion the template call wasn't in the right place. Thank you very much kasimi , that fixed it. I agree, it should really only be included on forum posts since that's where videos live, but it's a private, very lightly used board, at most 3 simultaneous users, so I don't think the ...
by terrylb
Fri Sep 07, 2018 5:26 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Unfortunately that didn't work. Adding your suggestions results in the video src attribute being stuffed with the entire forum topic html. aws.php isn't actually getting called. As a recap, on a forum page where we post video, the ajax call in aws.js gets the video tag and posts the video filename t...
by terrylb
Thu Sep 06, 2018 8:21 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Thank you kasimi, I'll give it a go.

BTW, your avatar cracks me up every time I look at it! :)
by terrylb
Thu Sep 06, 2018 4:48 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Thank you for the followup Brf. The php and js was written by someone else way back in 2014 and has been working until moving to 3.2. I'm just trying to maintain the functionality. I appreciate your suggestion that the orthodox way to do this is via an extension. I was hoping this could be solved qu...
by terrylb
Wed Sep 05, 2018 11:16 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

I've done some searching on append_sid and I'm not sure how to use it in my situation. Can I ask for some additional pointers? Here's a recap of the setup and previous posts. /styles/prosilver/templates/overall_header.html includes 2 script lines: jquery and aws.js aws.js makes an ajax call to aws.p...
by terrylb
Tue Sep 04, 2018 5:12 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Thanks Brf. Do you have any examples of getting sessions into an ajax call using the sid?
by terrylb
Tue Sep 04, 2018 2:59 am
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Oh, sorry, another typo. Sheesh! If you look at the included php file a couple posts up you'll see that it's actually correct, user_id. Okay, thanks for clarifying that Anonymous is user_id 1. I guess the question now is why does it report it's the Anonymous user and not the logged in user? At the r...
by terrylb
Tue Sep 04, 2018 12:23 am
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Thanks Brf. I fixed the one occurrence but it was in the elseif which isn't getting called because the prior if is succeeding when it shouldn't be. I thought I read that the Anonymous user is supposed to be -1? How can username be Anonymous but user_id be 1? "username: Anonymous END user_id: 1 END a...
by terrylb
Mon Sep 03, 2018 11:13 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

I replaced the else with the elseif but no change. I added another echo and username is reported as ANONYMOUS but user_id is 1. "username: Anonymous END user_id= 1 END access denied" This is odd because I am logged in, as the site admin. If I don't test for logged in user, the signed url is generate...
by terrylb
Mon Sep 03, 2018 10:18 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Re: Only run php function if user is logged in?

Thanks kinerity. Oops, typo in the copy/paste to the forum. The closing quote is fixed. So if I try to access the php file directly when not logged in, it works correctly and does not allow access. But it also does not allow access if I am logged in. I added an echo to see who it thinks I am when lo...
by terrylb
Mon Sep 03, 2018 9:27 pm
Forum: phpBB Custom Coding
Topic: Only run php function if user is logged in?
Replies: 21
Views: 1137

Only run php function if user is logged in?

My board has a custom php file at webroot which is called to generate a signed url for viewing video on AWS. In 3.1 we used session management sort of like below but this doesn't seem to work in 3.2.2. // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); if ($...

Go to advanced search