• 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

Adding password supported admins V2

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

Post a reply
2 posts • Page 1 of 1

Adding password supported admins V2

Postby Sinan92 » Fri Apr 26, 2013 9:29 am

Hey,

I was busy implementing this chat in my website. But after searching through the whole code and documentation I could not find a way to add password supported admin roles like in V1. (see: http://www.phpfreechat.net/admin )

Is it possible to do this in V2? Or is it to be implemented?

I have added the hook:

Code: Select all
 $GLOBALS['pfc_hooks']['pfc.isop'][5] = function ($app, $req, $res) {
   return function ($login, $channel, $uid, $cid) use ($app, $req, $res) {
     if ($login == 'Admin1' && $channel == "xxx" || $login == 'Admin2' && $channel == "xxx") {
       return true;
     } else {
       return false;
     }
   };
 };


But in this way everyone who just typed in Admin1 as username could log in as administrator, which is not safe.
Sinan92
New member
 
Posts: 1
Joined: Fri Apr 26, 2013 9:27 am
Top

Re: Adding password supported admins V2

Postby phpfreechat » Sat Apr 27, 2013 5:05 pm

You are right, if you do it that way it will give admin rights to every connected "Admin1"

To fix your problem you should add an controled authentication system with this hook: http://www.phpfreechat.net/documentatio ... beforeauth

Or you could also try to give operators rights directrly into the pfc.isop hook but not by testing the nickname but by testing a variable into the PHP session (but I don't know if you have this informations in the session)
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 4 guests

  • 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