| View previous topic :: View next topic |
| Author |
Message |
NeoTez
Joined: 27 May 2009 Posts: 2
|
Posted: Wed May 27, 2009 10:56 am Post subject: 2 issues with integrated login/logout on site homepage. |
|
|
Hello,
I'm have my forums located at www.mysite.com/forums and and trying to have a login/logout box on www.mysite.com
Here is the code I am using:
<?php
define('IN_PHPBB', true);
$phpbb_root_path = '../forums/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if($user->data['is_registered'])
{
echo("Hi " . $user->data['username'] . "! <a href=" . $phpbb_root_path . 'ucp.php?mode=logout&redirect=login.php' . '&sid=' . $user->data['session_id'] . ">Logout?</a>");
}
else
{
echo('<br><form action="/forums/ucp.php" mode="login" method="post" enctype="multipart/form-data">
<label for="username">Username: </label><input type="text" name="username" size="10" />
<label for="password">Password: </label><input type="password" name="password" size="10" />
<input type="hidden" name="redirect" value="login.php" />
<input type="submit" value="Login" name="login" />
</form>');
}
?>
login.php is located in the forum root.
Problem 1:
The redirect to login.php after login works fine, but the redirect to login.php after logout doesn't work. It just redirects to the forum main.
Problem 2:
I need these 2 redirects to be instant, instead of showing the normal PHPbb login/logout pages first. This is because I am putting the login.php file in an iframe on my homepage. How can I make them instant redirects?
Thanks in advance,
Paul |
|
| Back to top |
|
 |
samir
Joined: 12 Nov 2007 Posts: 232
|
Posted: Fri May 29, 2009 12:12 pm Post subject: |
|
|
| paul , do u mean that you need a single login and logout , so that when you logout from the mail site you automatically logout from the froum and vice versa????? |
|
| Back to top |
|
 |
NeoTez
Joined: 27 May 2009 Posts: 2
|
Posted: Fri May 29, 2009 7:01 pm Post subject: |
|
|
| No, I just want a login/logout box on my main site that provides the same functionality as the main PHPbb one. |
|
| Back to top |
|
 |
samir
Joined: 12 Nov 2007 Posts: 232
|
Posted: Mon Jun 01, 2009 7:25 am Post subject: |
|
|
| ok , then you need to maintain separate login / logout for your main site , and a separate login / logout for the forum site. i dont undertstand the use of iframe in the login page.............! |
|
| Back to top |
|
 |
|