Disable Guest

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Disable Guest

Post by Highway of Life »

No, don’t use a redirect... use the login_box(); function... that’s what it’s there for.

And yes, that is the solution... so what’s the problem? :?
Highway of Life wrote: For the other pages, open faq.php and index.php
Add the following code:

Code: Select all

if (!$user->data['is_registered'])
{
    login_box('', 'LOGIN');
}
Image

me_09
Registered User
Posts: 31
Joined: Wed Apr 04, 2007 11:12 pm

Re: Disable Guest

Post by me_09 »

prefer example
on configuration

You want disable guest ---> yes or no

but aspect mod anyway thx :)

walkingdead
Registered User
Posts: 8
Joined: Fri May 04, 2007 1:04 pm

Re: Disable Guest

Post by walkingdead »

cant you disable Guest access to certain forums by changing the forums permisions so only people who are aproved or in a user group can get into that forum or am i wrong?

User avatar
Highway of Life
Registered User
Posts: 1399
Joined: Tue Feb 08, 2005 10:18 pm
Location: I'd love to change the World, but they won't give me the Source Code
Contact:

Re: Disable Guest

Post by Highway of Life »

walkingdead wrote: cant you disable Guest access to certain forums by changing the forums permisions so only people who are aproved or in a user group can get into that forum or am i wrong?

Yes... we already discussed that earlier in the topic.
The only place you *have* to add the login code is in the index and the faq, that’s all.
60 second job at best... probably as fast as setting a config switch.
Most (over 90%) of the boards out there won’t need that extreme of a condition. -- They would just set all forums to registered users only.
Image

celphys
Registered User
Posts: 1
Joined: Tue Nov 10, 2009 10:36 pm

Re: Disable Guest

Post by celphys »

Highway of Life wrote:Go to ACP > Permissions [Tab] > Groups permissions > Guests > (user permissions) click on Advanced permissions
And set each option within each tab to No.

This should disable their ability to use the search function.

For the other pages, open faq.php and index.php
Add the following code:

Code: Select all

if (!$user->data['is_registered'])
{
    login_box('', 'LOGIN');
} 
right AFTER you see...

Code: Select all

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

// and for faq.php...
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(); 
That should do it :D
Is this different in 3.0.5? I have a use to do this where if a user has not registered they are sent directly to the login page. I have added this as prescribed above but I get a blank page when I put it into use.

I copied the top and pasted exactly in the right place in index.php and faq.php.

What am I doing wrong? Or is there something that I am missing?

User avatar
imkingdavid
Registered User
Posts: 1050
Joined: Thu Jul 30, 2009 12:06 pm

Re: Disable Guest

Post by imkingdavid »

Look on your server at the error_log file and post the latest messages if any. I'm not sure why it wouldn't work on 3.0.5 or 3.0.6 but we'll have to see.
I do custom MODs. PM for a quote!
View My: MODs | Portfolio
Please do NOT contact for support via PM or email.
Remember, the enemy's gate is down.

Post Reply