Przekierowanie po wylogowaniu

Zaczęty przez LukaszP, 17 Listopad 2005, 08:08

0 użytkowników i 1 Gość przegląda ten wątek.

LukaszP

Oby po wylogowaniu przekierować użytkownika na wybraną stronę należy:

Plik: Sources/LogInOut.php

Znajdź:

// Empty the cookie! (set it in the past, and for ID_MEMBER = 0)
setLoginCookie(-3600, 0);


Poniżej dodaj:

$_SESSION['logout_url'] = 'http://www.smf.pl/index.php';

defc0n

chyba kiedys o tym pisal Kemac, ale spoko ;)

ziemek8

#2
Można też zrobić tak z logowaniem. ;)


Plik: Sources/LogInOut.php



Linia: ~84
if (isset($_SESSION['old_url']) && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0)
$_SESSION['login_url'] = $_SESSION['old_url'];
else
unset($_SESSION['login_url']);
}

Zamienić na:
if (isset($_SESSION['old_url']) && preg_match('~(board|topic)[=,]~', $_SESSION['old_url']) != 0)
$_SESSION['login_url'] = $_SESSION['old_url'];
else
//unset($_SESSION['login_url']);
$_SESSION['login_url'] = 'http://adres.pl/index.php';
}




Linia: ~123
// Some whitelisting for login_url...
if (empty($_SESSION['login_url']))
      redirectexit();
else
{
// Best not to clutter the session data too much...
$temp = $_SESSION['login_url'];
unset($_SESSION['login_url']);

redirectexit($temp);
}

Zamienić na:
// Some whitelisting for login_url...
if (empty($_SESSION['login_url']))
      redirectexit('http://adres.pl/index.php');
else
{
// Best not to clutter the session data too much...
$temp = 'http://adres.pl/index.php';
//$temp = $_SESSION['login_url'];
unset($_SESSION['login_url']);

redirectexit($temp);
}





PS: Napisałem tutaj pytanie, ale udało mi się to rozwiązać, więc zamieszczam.
I want to have a knowledge to understand | www.archeos.pl | www.n-gry.pl