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

Dynamic Channels for different users

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

Post a reply
4 posts • Page 1 of 1

Postby GreenImp » Sun Aug 19, 2012 2:08 pm

Hi,
I am trying to have it so that different users see different channels, when they view the chat.
I have integrated by own authentication system into the chat, to allow access only to certain members then, depending on their permissions, they will be able to view a certain group.
ie;
admins can see the 'admin' channel
users can see the 'user' channel

And so forth.

So, in the parameters I have something like the following (Simplified version, but you get the idea):
Code: Select all
if($isAdmin){
    $params['channels'] = array('admins');
}else{
    $params['channels'] = array('users');
}

But this doesn't work as expected.
It seems like even the channels parameter is cached, which means that everyone get thrown into the same channel, regardless of what is defined on page load.
If I '/rehash', clear my cache, log out and in again, I get entered into the correct channel, but then everyone else who logs in afterwards goes into the same channel.

Is there any way to dynamically put people into different channels when the chat is loaded?

Kind regards,
Lee
GreenImp
New member
 
Posts: 2
Joined: Sun Aug 19, 2012 1:58 pm
Top

Postby OldWolf » Tue Aug 21, 2012 12:27 am

Yup, try http://www.phpfreechat.net/parameters#dyn_params
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby GreenImp » Tue Aug 21, 2012 12:49 am

Oh, thank you so god darn much! I want to hug you right now!
How could I have missed that.. I'm right at the end of a (very) stressful project and this was one of the final hiccups. I'll definitely have to try it out in the morning!

Thank you :)
GreenImp
New member
 
Posts: 2
Joined: Sun Aug 19, 2012 1:58 pm
Top

Re: Dynamic Channels for different users

Postby dovier » Sun Oct 07, 2012 12:11 am

the following code its ok?

Code: Select all
$params["frozen_channels"] = array("Directors Chatroom", "Judges Chatroom", "Public Chatroom");
$params["dyn_params"] = array("channels");
if ($user->data['group_id'] == 8) {
   $params["channels"] = array("Directors Chatroom", "Public Chatroom");
} elseif ($user->data['group_id'] == 9) {
   $params["channels"] = array("Judges Chatroom", "Public Chatroom");
} else {
   $params["channels"] = array("Public Chatroom");
}
dovier
New member
 
Posts: 2
Joined: Sat Oct 06, 2012 11:43 pm
Top


Post a reply
4 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

Users browsing this forum: No registered users and 14 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