• 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

certain users in certain room

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

Post a reply
10 posts • Page 1 of 1

Postby ab52 » Sat Oct 30, 2010 12:07 pm

i have made that nick names are take from a log in script

but i was wondering if there is a way to limit which users can acces certain rooms

for example
i have a room called Printer and i only want certain users to be able to access the room printer
is there a way to do this

thanks
Adam
ab52
New member
 
Posts: 7
Joined: Tue Oct 26, 2010 9:18 am
Top

Postby OldWolf » Sat Oct 30, 2010 8:38 pm

The closest thing would be frozen_channels, which will let you set which channels a user CAN access, blocking all others:
http://www.phpfreechat.net/parameters#frozen_channels
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 ab52 » Sat Oct 30, 2010 11:06 pm

OldWolf wrote:The closest thing would be frozen_channels, which will let you set which channels a user CAN access, blocking all others:
http://www.phpfreechat.net/parameters#frozen_channels

argh, so i take it i cannot say that user ADAM can only see the certain groups

hum.. o well
ab52
New member
 
Posts: 7
Joined: Tue Oct 26, 2010 9:18 am
Top

Postby OldWolf » Sun Oct 31, 2010 1:48 am

Well, you can set that for each user... just like you would their nick.

Basically you asked for:
The ability to block access to certain rooms
This offers you:
The ability to allow access ONLY to certain rooms

So, no new rooms could be created outside of those.
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 ab52 » Sun Oct 31, 2010 11:17 am

ah maybe i was not that clear

For example i want the user ab not to be able to access the from TEST
if they try to join either by /join or by clicking on the link ( that i made) then it says that they are not allowed to

but i want the user sdr to be able to access TEST

ie user by user case
Last edited by ab52 on Sun Oct 31, 2010 11:17 am, edited 1 time in total.
ab52
New member
 
Posts: 7
Joined: Tue Oct 26, 2010 9:18 am
Top

Postby waiheke » Sun Oct 31, 2010 3:26 pm

you say you have a login script?

so the link you have made must come after the login ?
why not have a simple code so that if the name is not in an array, or retrieved from a database, the link does not appear ?

if (something);
show the link
otherwise ..
do nothing

do you know php or javascript?
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby ab52 » Sun Oct 31, 2010 9:56 pm

nope

not too good at either

sorry
ab52
New member
 
Posts: 7
Joined: Tue Oct 26, 2010 9:18 am
Top

Postby OldWolf » Sun Oct 31, 2010 10:08 pm

ab52 wrote:ah maybe i was not that clear

For example i want the user ab not to be able to access the from TEST
if they try to join either by /join or by clicking on the link ( that i made) then it says that they are not allowed to

but i want the user sdr to be able to access TEST

ie user by user case

I understand what you're asking. Let me explain again and see if we can get on the same page:

The parameter I'm providing is unique to each user, just like nick. But it's not exactly what your asking for:
Setting frozen_channels to array("Main Chat") would allow the user access ONLY to "Main Chat". You can set this parameter to whatever you want for each user, just like you set their nick. So some users could access array("Main Chat", "Test") while others would only be allowed to access array("Main Chat"). Does that make sense?
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 ab52 » Sun Oct 31, 2010 10:20 pm

that sounds perfect
how would i do that

also if possible, could the arrays holding users allow in that chat be in a different file, just because otherwise the main file would get very big??
ab52
New member
 
Posts: 7
Joined: Tue Oct 26, 2010 9:18 am
Top

Postby OldWolf » Mon Nov 01, 2010 10:20 pm

Well, the basic application would be something along these lines. I'm going under the assumption that you have some variable "$username" which contains their name, since you said you had worked out how to set the nick.

Code: Select all
switch ($username)
{
    case "timmy":
        $params["frozen_channels"] = array("Room", "Room2", "Room3");
    break;
    case "jimmy":
        $params["frozen_channels"] = array("Room", "Room2");
    break;
    default:
        $params["frozen_channels"] = array("Room");
    break;
}

Now, obviously this is a simple application of it, but hopefully you get the idea. If you don't like that case stuff, you can just use if/else, but case keeps it a little cleaner. Default will be called if none of the other cases apply, so that covers all your other users that aren't the ones you specifically named.

The other nice thing about this is that you can also use that to assign admin, by doing $params["isadmin"] = true; as a second line, on the cases you want to have admin.

Please note, I haven't actually ran this code, so there might be some syntax errors or what have you, I tend to have to debug everything I write. :P
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


Post a reply
10 posts • Page 1 of 1

Return to General Support (v1.x)

Who is online

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