Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

emaxads on "Sessions and login status non wordpress pages"

$
0
0

Other posts on this subject are not really resolved or are old...
I currently have a legacy site that uses phpbb as a support forum with site-wide authorization and status. The site itself has many sub directories and pages i am thinking of installing a fresh wp install with bbpress and getting rid of the phpbb alltogether. I would like to have the same functionality across all the pages in the site as loged in users are delivered different content on different pages. With phpbb i use a function on pages like this one for a page in the root other directories just change root path to phpbb

define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if(isset($_POST['login']))
{
    $username = request_var('username', '', true);
    $password = request_var('password', '', true);
    $autologin = (!empty($_POST['autologin'])) ? true : false;

    $result = $auth->login($username, $password, $autologin);

    if ($result['status'] == LOGIN_SUCCESS)
    {
        //User was successfully logged into phpBB
        // append/replace SID
        $redirect = reapply_sid('curPageURL()');

        meta_refresh(0, $redirect);
    }
    else
    {
        $badlogin = 'bad';
    }
}
if (isset($_GET['logout'])) {
	$user->session_kill();
	$user->session_begin();
	$redirect = request_var('redirect', "index.$phpEx");
	redirect($redirect);
}

Looking if anyone has done this with Wordpress and what i might need to do. I know I will have to define cookie path but what else am i getting into any help would be greatly appreciated

Thanks Chuck


Viewing all articles
Browse latest Browse all 8245

Trending Articles