vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Not Logged In Redirect (https://vborg.vbsupport.ru/showthread.php?t=280045)

MagicPID 03-14-2012 11:35 PM

Not Logged In Redirect
 
Does anyone know of a way to make it so that if you are not logged in it redirects you to an alternate login page?

My forum uses an alternate login page and not the normal vBulletin login, so I was wondering if I could make it so that they can't go to /forums/ at all if they are not logged in. (Currently it just says to log in and shows the default login)

Thanks

MagicPID 03-17-2012 05:44 AM

Bumping this---

Simon Lloyd 03-17-2012 06:36 AM

Put this at the top of your header template
HTML Code:

<if condition="$bbuserinfo['usergroupid'] == 1">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if> 

of course you need to change the url but anyone viewing your site who are not logged in will be redirected there.

MagicPID 03-17-2012 06:43 AM

Quote:

Originally Posted by Simon Lloyd (Post 2310323)
Put this at the top of your header template
HTML Code:

<if condition="$bbuserinfo['usergroupid'] == 1">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if> 

of course you need to change the url but anyone viewing your site who are not logged in will be redirected there.

While this does work, when I send out an invitation to my site the user is given a link to register.php and the code here redirects even the register.php page, is there a way to exclude that page so that they can still join?

Simon Lloyd 03-17-2012 04:56 PM

Try this instead
HTML Code:

<if condition="THIS_SCRIPT != 'register' AND is_member_of($bbuserinfo,1)">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if>


MagicPID 03-17-2012 06:52 PM

Quote:

Originally Posted by Simon Lloyd (Post 2310429)
Try this instead
HTML Code:

<if condition="THIS_SCRIPT != 'register' AND is_member_of($bbuserinfo,1)">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if>


This worked perfectly!

Thanks, I appreciate it.

MagicPID 03-19-2012 12:10 AM

One final issue, I still want my users to be able to use the lost password php which is found under /forums/login.php?do=lostpw, the only problem is it's situated within the login.php and the whole point of this thread was to avoid users being able to access that.

Is there a way to let users only access that part of the login.php?

Simon Lloyd 03-19-2012 07:53 AM

Not that i can think of off hand, but you could always put the lost password link at your redirected location...........but i'll have a think about it :)


All times are GMT. The time now is 01:02 AM.

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.01155 seconds
  • Memory Usage 1,727KB
  • 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
  • (4)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete