• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 2.x Branch ‹ General Support (v2.x)
  • Change font size
  • FAQ
  • Register
  • Login

Using phpbb3 username for phpchat login name. Help.

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
2 posts • Page 1 of 1

Using phpbb3 username for phpchat login name. Help.

Postby dazamate » Sun Feb 03, 2013 5:17 am

Hi there,

I am building a membership site which is built around the phpbb3 login system. Once a user is logged into phpbb3 then they can access all members area only pages, one will be the chat room.

So I want to auto login with the phpbb3 user name....

I can't seem to get the login hook to read my chatname variable and I've gone as far as using sessions.

Here is where i am at...

Code: Select all
//stores the current logged in username into the session chatname variable
$_SESSION['chatname'] = $user->data['username'];


Then I go to the config.php file.

at the top I do a

Code: Select all
 session_start();


then...

Code: Select all
$GLOBALS['pfc_hooks']['pfc.before.auth'][5] = function ($app, $req, $res,) {
   return function () use ($app, $req, $res,)
      {
      var_dump ($_SESSION['chatname']);
      return ($_SESSION['chatname']);
      
   };
};


When go to the chatroom page, nothing comes up for the var_dump and the chat room is blank and does not ask for a login.

Any thoughts to why this isn't working?
dazamate
New member
 
Posts: 1
Joined: Sun Feb 03, 2013 5:09 am
Top

Re: Using phpbb3 username for phpchat login name. Help.

Postby phpfreechat » Fri Feb 08, 2013 7:33 pm

To avoid PHP conflicts between your code and phpfreechat one, have a look to this example of phpbb3 integration:
https://github.com/kerphi/phpfreechat/b ... c-hook.php
https://github.com/kerphi/phpfreechat/b ... h/auth.php
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
2 posts • Page 1 of 1

Return to General Support (v2.x)

Who is online

Users browsing this forum: No registered users and 0 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub