vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Stop Members Bypassing Restrictions By Logging Out (https://vborg.vbsupport.ru/showthread.php?t=172305)

Konstantinos 03-07-2008 07:27 PM

so its useless for admins who already have guests not be able to view the forum

AngelBlue 03-07-2008 07:53 PM

Quote:

Originally Posted by Konstantinos (Post 1459586)
so its useless for admins who already have guests not be able to view the forum

No, actually it is quite useful for them!

The biggest reason to let guests see your forum is to entice them to register by showing them what they COULD get if they registered.

The biggest reason not to let guests see your forum is to force them to register - if they can browse as a guest, why do they need to register?

With this mod, you can let first time visitors see your forum, so they are tempted into registering, and once registered, they have to remain logged-in to view the forum. So you can get the best of both worlds. This mod works especially well with the limited guest viewing system, forming a combination that drives people to register and then stay registered and logged in.

Big Boss 03-08-2008 07:08 PM

Thanks for this! Been waiting for something like this for a long time.

bigcurt 03-13-2008 01:07 AM

I edited that piece of code just as you said..and I am not sure why it isn't working but as a banned user I can log off and log back in just fine ( and see the forum after log out )..all that.

AngelBlue 03-13-2008 02:23 AM

The cookie only gets set when the member views a thread or forum. If you try to test this by clearing your cookies then logging into an *already banned* account, it won't work.... because you don't have the cookie.
It would, however, work for the person that was banned, because they would (presumably) have viewed at least one thread before they got banned, and thus would have the cookie set.

If you *really* want it to work for banned users who have cleared their cookies previously, you could add something like the following to the plugin definitions :
Code:

                <plugin active="1">
                        <title><![CDATA[NGB System [Profile Start Check]]]></title>
                        <hookname>global_start</hookname>
                        <phpcode><![CDATA[
                        if ($userinfo['usergroupid'] == 8) {
                            ($hook = vBulletinHook::fetch_hook('ngb_plugin')) ? eval($hook) : false;
                        }
                        ]]></phpcode>
                </plugin>

Doing this would, however, probably be pointless, because if the banned person has cleared their cookies once since they last viewed a thread, the odds are they will just clear their cookies again if you re-set the cookie when they login with a banned account.

bigcurt 03-13-2008 07:32 PM

OK, would this be an adequate test of the system:

Make a user
look at a thread
Ban that user
Login as that user and test?

Would that be a good test/would it hurt my other account at all?

AngelBlue 03-13-2008 09:54 PM

Quote:

Originally Posted by bigcurt (Post 1464063)
OK, would this be an adequate test of the system:

Make a user
look at a thread
Ban that user
Login as that user and test?

Would that be a good test/would it hurt my other account at all?

Banning one user shouldn't affect any other user accounts unless you have something like AE Multiple Login Detection installed.

Once you have viewed a thread while logged in (you have to not be in vB's default banned usergroup, id 8, in order to read threads), it should deny you the ability to read the forum threads as a guest, until you clear your cookies.

What exactly are you trying to test? Are you trying to test that this product will stop people who have previously read a thread while logged in from continuing to read threads if they log out? If so, just install, read a thread, logout, and see if you can still read threads.

Are you trying to test that this mod stops users you have banned from browsing the forum as a guest? It will stop them reading threads, but only if they read at least one thread before you banned them.

Allnick 03-15-2008 12:04 AM

This is an interesting add on.
One thing though.....I find it good practise to view as a guest myself at times.
For instance after creating a new forum and setting permissions. I need to see what guests can view, as well as registered users.

I presume Admin (me) would have to clear cookies to view as a guest.
It would be good to have the Admin account unaffected.

AngelBlue 03-15-2008 03:31 AM

Quote:

Originally Posted by Allnick (Post 1464993)
This is an interesting add on.
One thing though.....I find it good practise to view as a guest myself at times.
For instance after creating a new forum and setting permissions. I need to see what guests can view, as well as registered users.

I presume Admin (me) would have to clear cookies to view as a guest.
It would be good to have the Admin account unaffected.


Try editing the product file before importing, replacing:
Code:

                                        if (!isset($_COOKIE['NGBaccess'])) {
                                                // we do NOT use vbsetcookie, because cookies set with vbsetcookie() are erased when the user logs out!
                                                setcookie("NGBaccess", "yes", time()+31104000, "/");
                                        }

with:
Code:

                                        if (
                                        !isset($_COOKIE['NGBaccess']) AND
                                        !in_array($bbuserinfo['usergroupid'], array(6)) )
                                        ) {
                                                // we do NOT use vbsetcookie, because cookies set with vbsetcookie() are erased when the user logs out!
                                                setcookie("NGBaccess", "yes", time()+31104000, "/");
                                        }

You can replace the "6" here with "6,5" (IIRC) to also exempt supermods. You will need to clear your cookies once before this exemption applies.

AngelBlue 03-24-2008 12:42 AM

Removed the beta tag, as this hack has been in use for awhile now without issues.


All times are GMT. The time now is 02:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01129 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete