• 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

Custom login problems with pfc.before.auth

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

Post a reply
1 post • Page 1 of 1

Custom login problems with pfc.before.auth

Postby Kuferl » Mon Sep 09, 2013 3:54 pm

PFC Version: 2.1.0

http://www.kuferl.eu/pickup

Hi. I want to use the chat with a custom login that is achieved with the steam login. I store the username in $_SESSION and want to use it for the chat with the pfc hook pfc.before.auth.
This is the hook i wrote in server/config.php :

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


Furthermore i changed the pfc.showAuthForm function to this:

Code: Select all
 pfc.showAuthForm = function (msg) {
    pfc.modalbox.open(
        '<form>'
      + '  <div class="popup-login">'
      + '    You need to be logged in to see the chat'
     + ' </div>');
  };
  return pfc;
}(phpFreeChat || {}, jQuery, window));/*jslint node: true, maxlen: 150, maxerr: 50, indent: 2 */


My main problems here are those 2:
1) sometimes it doesn't log you in and shows the login message (You need to be logged in...)

2) it doesn't remove you from the chat after logging out. The logout works by simply destroying the session.
Kuferl
New member
 
Posts: 1
Joined: Mon Sep 09, 2013 11:25 am
Top

Post a reply
1 post • Page 1 of 1

Return to General Support (v2.x)

Who is online

Users browsing this forum: No registered users and 1 guest

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