Icy Phoenix

     
 


Post new topic  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Logout 
 
I have a small question.

Why whe I do logout the page that apper is the forum and not the home(portal).

Thank you in advance.
Claudio
 



 
fotopassioneSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Logout 
 
There is a $smart_redirect on page_header for logout
But i don't know how to mod it for what you like  
 




____________
? Zuker - EDDB - LPM - Sharefields
 
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Logout 
 
Yes, the $smart_redirect isn't all that smart at the moment!

If you want to change where the user is redirected to, you need to insert some lines.

Open includes/page_header.php

Look for (around line 253):

Code: [Download] [Hide] [Select]
if ( $userdata['session_logged_in'] )
{
    $u_login_logout = LOGIN_MG . '?logout=true&sid=' . $userdata['session_id'];
    $l_login_logout = $lang['Logout'] . ' (' . $userdata['username'] . ') ';
    $l_login_logout2 = $lang['Logout'];


After, add:

Code: [Download] [Hide] [Select]
//    $smart_redirect = strrchr($_SERVER['PHP_SELF'], '/');  // uncomment these two lines if you want to return the user
//    $smart_redirect = substr($smart_redirect, 1, strlen($smart_redirect));  // to the page they just viewed,
    $smart_redirect = 'index.' . $phpEx;         // and comment this line to prevent redirect to index page
    $u_login_logout .= (!empty($smart_redirect)) ? '&redirect=' . $smart_redirect : '';

You see in the above, I have set it so you can decide whether to redirect to the index page (as it is at the moment), or, by commenting out that, and uncommenting the upper two lines, have it redirect to whatever page the user is viewing.

And note, these lines should be added before: } - the closure of the if statement!
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Logout 
 
Smart redirect is enabled only when logging in.

When logging out has been disabled, because if you are logging out from a page which requires special permissions you would be asked to login again.

So FORUM INDEX has been inserted as default.

moreteavicar, remember that INDEX.PHP in XS is identified by PORTAL_MG... so you should use that var.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Logout 
 
Well, I don't see how it really matters - There is no reason not to override a variable with a constant, such as "index.php" if you want to have everyone referred to that page by default - if it physically exists as a file in your root... And also, $_SERVER['PHP_SELF'] returns the real page name being used...  so the real filename is implicit in the variables $portal_mg and $smart_redirect  anyway... so whether you make $smart_redirect =  $portal_mg or $smart_redirect = 'index.php' depends on if you are likely to change the name of index.php to home.php or whatever...  which is not the case here... (and in any case, the intelligent person here will know to change index.php to home.php, etc). In fact I use the implementation posted above on my site so that users are referred to index.php on logging out, and it can also be simplified to:

Code: [Download] [Hide]
  1. $u_login_logout .= '&redirect=index.php';  

 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Logout 
 
Of course you can avoid using the CONSTANT... but if you post a solution to the forum you should use the standard way XS is coded, otherwise some users may have problems if they have renamed their pages.

Remember also that & char should be escaped before being passed to an URL which has to be clicked... otherwise it is not W3C compliant...

Code: [Download] [Hide]
  1. $u_login_logout .= '&redirect=' . PORTAL_MG; 


This should be the correct code to be used in XS.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  This topic is locked: you cannot edit posts or make replies.  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron