Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2012, 11:35 PM
MagicPID's Avatar
MagicPID MagicPID is offline
 
Join Date: Jul 2011
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-17-2012, 05:44 AM
MagicPID's Avatar
MagicPID MagicPID is offline
 
Join Date: Jul 2011
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bumping this---
Reply With Quote
  #3  
Old 03-17-2012, 06:36 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 03-17-2012, 06:43 AM
MagicPID's Avatar
MagicPID MagicPID is offline
 
Join Date: Jul 2011
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
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?
Reply With Quote
  #5  
Old 03-17-2012, 04:56 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
Благодарность от:
MagicPID
  #6  
Old 03-17-2012, 06:52 PM
MagicPID's Avatar
MagicPID MagicPID is offline
 
Join Date: Jul 2011
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
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.
Reply With Quote
  #7  
Old 03-19-2012, 12:10 AM
MagicPID's Avatar
MagicPID MagicPID is offline
 
Join Date: Jul 2011
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 03-19-2012, 07:53 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:28 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04802 seconds
  • Memory Usage 2,236KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete