vBadvanced Forums  
Go Back   vBadvanced Forums > vBadvanced Products > vBadvanced CMPS > vBa CMPS v1.x (Archive - Closed for Posting) > Troubleshooting / "How do I..." Questions

 
 
Thread Tools Display Modes
  #1  
Old 07-03-2004, 11:21 AM
StewardManscat's Avatar
StewardManscat StewardManscat is offline
Member
 
Join Date: Jun 2004
Posts: 68
Default Hybrid site: redirect after page

Pasting together an existing site with vb3 and cmps...

Some areas are for registered members only. The registration system is now vb3. I cannot convert all of the old site into vb3/cmps at once. I think I need a "hybrid" to get by.

So in my old sections I write:

PHP Code:
if ($NoCurrentSession) {
  
header("Location: /forum/cmps_index.php?page=forbidden");
  exit;

where "forbidden" is a cmps page with no access privleges. So this brings up the "You are not logged in" prompt, which is desired.

But of course, after login, the system returns to "You do not have permission to access this page". It's the God's honest truth. But if the user clicks again on where they were going, they are off to the races.

All site areas are linked across the top, and all are always enabled. This is desired. The ones which go to vb pages behave correctly: after denial followed by login, the system redirects to the original page.

I wonder how I can mimic this to support old sections... ?

Thanks in advance.
  #2  
Old 07-03-2004, 08:13 PM
Brian's Avatar
Brian Brian is offline
Administrator
 
Join Date: Jan 2004
Location: Georgia, USA
Posts: 34,240
Default Re: Hybrid site: redirect after page

I'm not entirely sure I understand what you're trying to do, so please excuse me if this is not correct... Once you log into vBulletin though, it will redirect you to the page that you logged in from. Since they logged in from your forbidden page, they are going to be redirected to that page. I might suggest adding a custom php module for that page which will check to see if a user is logged in, and if not, then print the error. Then change the code you posted above to something like this:
PHP Code:
if ($NoCurrentSession) { 
  
header("Location: /forum/cmps_index.php?page=forbidden&return=http://yoursite.com/whatever_page_here"); 
  exit; 

You could then use the 'return' part in the URL there to redirect the user to that specific page in the module that you created, assuming that they are logged in.
  #3  
Old 07-06-2004, 01:43 PM
StewardManscat's Avatar
StewardManscat StewardManscat is offline
Member
 
Join Date: Jun 2004
Posts: 68
Default Re: Hybrid site: redirect after page

You understood perfectly and your answer is helpful, thank you.

I had hoped there might be some magic buried in either vb or vbadvanced already...
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Created a Custom Page and... mholtum Troubleshooting / "How do I..." Questions 3 06-21-2004 04:34 PM
Site Index (like your Services Box) Everywhere george bray Troubleshooting / "How do I..." Questions 4 05-27-2004 09:45 AM


All times are GMT -4. The time now is 08:01 PM.

Forums Powered by vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.
Please note that vBadvanced is in no way affiliated with Jelsoft Enterprises Ltd, nor will Jelsoft be able to provide any support for our products.