Need additional permisson in mchat rooms

Chat rooms for mChat with optional password protection and 1-on-1 chats
Post Reply
User avatar
jan_2017
Distinguished Donor
Posts: 131
Joined: 13 May 2017, 18:07

Need additional permisson in mchat rooms

#1

Post by jan_2017 » 19 Aug 2018, 18:04

Hello.

At the moment i' ve got two rooms.At the first room only user logins are shown.At the second room only new topics and posts are shown.

I don't want that users chatting in this two rooms. How can i change permisson?Only reading no writing.The rooms are only for notifications.

Bye the way ... i' ve got two additional rooms where users can chat.

Thanks Bye Jan

User avatar
kasimi
mChat developer
Posts: 785
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Need additional permisson in mchat rooms

#2

Post by kasimi » 19 Aug 2018, 19:59

Permissions on a per-room level are not possible, it would be a nightmare to implement.

Nothing that can't be solved with some old-fashioned custom code. :) To prevent users from sending a message when they are in a certain room:
  • Open ext/dmzx/mchat/styles/all/template/javascript/mchat.js
  • Find the very last line in the file:

    Code: Select all

    - This code is only accessible to donors -
  • Above, add this code and adjust the room ID 123. You can also block multiple rooms: 123,456,789

    Code: Select all

    - This code is only accessible to donors -

User avatar
jan_2017
Distinguished Donor
Posts: 131
Joined: 13 May 2017, 18:07

Re: Need additional permisson in mchat rooms

#3

Post by jan_2017 » 19 Aug 2018, 22:04

Wow.....thank you very much for this info!!! i will test it and will give here a feedback .... bye Jan

User avatar
jan_2017
Distinguished Donor
Posts: 131
Joined: 13 May 2017, 18:07

Re: Need additional permisson in mchat rooms

#4

Post by jan_2017 » 22 Sep 2018, 09:14

It doesn't work if i put the code above in mchat.js file.

User avatar
kasimi
mChat developer
Posts: 785
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Need additional permisson in mchat rooms

#5

Post by kasimi » 22 Sep 2018, 09:17

I tested the code and it works for me. Re-check your edits and make sure there are no errors in your browser console.

User avatar
jan_2017
Distinguished Donor
Posts: 131
Joined: 13 May 2017, 18:07

Re: Need additional permisson in mchat rooms

#6

Post by jan_2017 » 22 Sep 2018, 09:50

kasimi wrote:
22 Sep 2018, 09:17
I tested the code and it works for me. Re-check your edits and make sure there are no errors in your browser console.
I´m sorry!

I have insert the code with my smartphone in mchat.js file. That was my failure!

Now it works!!!

Thanks kasimi for your help :wave: :beer:

mortalites
Donor
Posts: 8
Joined: 30 Jul 2018, 17:20

Re: Need additional permisson in mchat rooms

#7

Post by mortalites » 14 Dec 2018, 17:14

I must not be doing this right. I only want to make a few rooms but i receive the following error in ever room when I try and send a message:

"No route found for "POST /mchat": Method Not Allowed (Allow: GET, HEAD)"

Code: Select all

- This code is only accessible to donors -

User avatar
kasimi
mChat developer
Posts: 785
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Need additional permisson in mchat rooms

#8

Post by kasimi » 14 Dec 2018, 21:27

You didn't copy the complete code, you're missing the last line.

mortalites
Donor
Posts: 8
Joined: 30 Jul 2018, 17:20

Re: Need additional permisson in mchat rooms

#9

Post by mortalites » 15 Dec 2018, 04:18

I think I got it all figured out now and I believe that is working correctly now.

Thanks again

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest