Block Private Chat between normal users

52 views
Skip to first unread message

Muhammad Ali Shan

unread,
Mar 3, 2015, 1:46:33 PM3/3/15
to ajax...@googlegroups.com
Hi,

Greetings!

I really liked this project. I am thinking if it is possible to block normal users to do Private Chat and to create any Rooms. I want only Admin/Moderator to do Private chat with individuals and there shouldn't be any Private Room other than just one Public Room.

Please let me know if it is possible.

regards

Bobby Russ

unread,
Mar 3, 2015, 6:36:47 PM3/3/15
to Muhammad Ali Shan, ajax...@googlegroups.com

You can disable both Private Messages and Private Channels in the lib directory by editing the config.php file.

Set $config['allowPrivateChannels'] = false;
Set $config['allowPrivateMessages'] = false;

--
You received this message because you are subscribed to the Google Groups "AJAX-chat" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Frug

unread,
Mar 4, 2015, 2:27:56 PM3/4/15
to ajax...@googlegroups.com, muhammad...@gmail.com
He's asking for it to be based on permission level. To do that he would need to modify chat.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+unsubscribe@googlegroups.com.

Stephen Gemme

unread,
Mar 13, 2015, 9:38:20 AM3/13/15
to ajax...@googlegroups.com, muhammad...@gmail.com
More Specifically in AjaxChat.php find and modify this:

function isAllowedToCreatePrivateChannel() {
if($this->getConfig('allowPrivateChannels')) {
switch($this->getUserRole()) {
case AJAX_CHAT_USER:
return true;
case AJAX_CHAT_MODERATOR:
return true;
case AJAX_CHAT_ADMIN:
return true;
default:
return false;
}
}
return false;
}

And to disable Private Channels for Users open Users.php and edit

// Sample registered user:
$users[3] = array();
$users[3]['userRole'] = AJAX_CHAT_USER;
$users[3]['userName'] = 'user';
$users[3]['password'] = 'user';
$users[3]['channels'] = array(0,1);

Remove the "1" from the array and you'll disable Users' private channels. 
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-chat+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages