Permission Mod

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Suggested Hosts
mudassar788
Registered User
Posts: 42
Joined: Sat Jan 05, 2008 5:37 pm

Permission Mod

Post by mudassar788 »

Hello

I am looking for some advanced permission mod. My requirement is simple, I think, there maybe a mod or built in feature in phpBB3, I searched, but didn't find out

I want to that Guest can see Forum & see Topics, not Guest must register to read topics in that forum. I set permission for for to See Forum "Yes" & Read Forum "No" . But on this, it don't allow user to see topic link in that forum. I want that Guest should Topic Link in forums, but should not be able to read those topic without signing in.

I hope some one will help me

Regards
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52105
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Permission Mod

Post by Brf »

If you want to set it such that guests can never read topics, it should be pretty simple to tweak viewtopic... You might want to disable Search for guests also, otherwise they will be able to read topics in Search.
mudassar788
Registered User
Posts: 42
Joined: Sat Jan 05, 2008 5:37 pm

Re: Permission Mod

Post by mudassar788 »

Is it not possible to give Guest access to few forums only ?? like vbulletin, IPB etc
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52105
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Permission Mod

Post by Brf »

You can give guests access to whatever you want, but phpBB does not have a permissions for "can read topics", only "can read forums". So there is not a permission that would allow them to see the topics, but not read them.
Tappanga
Registered User
Posts: 50
Joined: Tue Jul 15, 2008 5:19 pm

Re: Permission Mod

Post by Tappanga »

Brf wrote:If you want to set it such that guests can never read topics, it should be pretty simple to tweak viewtopic... You might want to disable Search for guests also, otherwise they will be able to read topics in Search.

Can you share that tweak? I'd really like this as well.
Tappanga
Registered User
Posts: 50
Joined: Tue Jul 15, 2008 5:19 pm

Re: Permission Mod

Post by Tappanga »

Let me add that I've already asked in another place in the forum, and was given a tweak that changed all the messages to "GUESTS CANNOT READ TOPICS!". That's fine, but I'd really like something that redirects a guest, when they click on a topic, to the login/sign up screen.
mudassar788
Registered User
Posts: 42
Joined: Sat Jan 05, 2008 5:37 pm

Re: Permission Mod

Post by mudassar788 »

Oh Very sad, this is a great feature but not available in phpBB3. So, no chance for mods :(
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52105
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Permission Mod

Post by Brf »

If you never want guests to read any topics, give them "can read" permissions and then change this one line in viewtopic.php:

Code: Select all

if (!$auth->acl_get('f_read', $forum_id))
to

Code: Select all

if (!$auth->acl_get('f_read', $forum_id) || $user->data['user_id'] == ANONYMOUS)
to always allow those who can see a forum to also see the topics, but not read them... change these lines in viewforum.php:

Code: Select all

if ($auth->acl_get('f_read', $forum_id))
to

Code: Select all

if ($auth->acl_gets('f_list', 'f_read', $forum_id))
and

Code: Select all

if (!$auth->acl_get('f_read', $forum_id))
to

Code: Select all

if (!$auth->acl_gets('f_list', 'f_read', $forum_id))
mudassar788
Registered User
Posts: 42
Joined: Sat Jan 05, 2008 5:37 pm

Re: Permission Mod

Post by mudassar788 »

Its okay, but didn't fulfill my request.

Anyway, thanks Brf for quick response & great help!!!!
Last edited by mudassar788 on Tue Sep 23, 2008 7:05 pm, edited 1 time in total.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52105
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Permission Mod

Post by Brf »

Why doesnt it?
If you use the second solution I gave... Then anytime you give permissions to see a forum, it also gives permission to see the topics, which is what you asked for.
mudassar788
Registered User
Posts: 42
Joined: Sat Jan 05, 2008 5:37 pm

Re: Permission Mod

Post by mudassar788 »

to always allow those who can see a forum to also see the topics, but not read them... change these lines in viewforum.php:
So, will this code work ?

I mean, by this code, Will I be able to give users to read topics on some forum & no read topics on some other forums ?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52105
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Permission Mod

Post by Brf »

I was offering two completely separate solutions.

The first solution completely blocks viewtopic from guests. That is not the solution you want. You want the second solution, which alllows anyone who has "can see forums" to also "see" the topics.
Tappanga
Registered User
Posts: 50
Joined: Tue Jul 15, 2008 5:19 pm

Re: Permission Mod

Post by Tappanga »

Thanks Brf. I'll try that later tonight.
Tappanga
Registered User
Posts: 50
Joined: Tue Jul 15, 2008 5:19 pm

Re: Permission Mod

Post by Tappanga »

Brf wrote:
to always allow those who can see a forum to also see the topics, but not read them... change these lines in viewforum.php:

Code: Select all

if ($auth->acl_get('f_read', $forum_id))
to

Code: Select all

if ($auth->acl_gets('f_list', 'f_read', $forum_id))
and

Code: Select all

if (!$auth->acl_get('f_read', $forum_id))
to

Code: Select all

if (!$auth->acl_gets('f_list', 'f_read', $forum_id))

Made the changes then logged out and tried it out as a guest. Didn't work. :(
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52105
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Permission Mod

Post by Brf »

Did you give the guest group permission to see a forum?
Locked

Return to “[3.0.x] MOD Requests”