I need to call an external function to check a user's chat admin rights instead of calling user_access('administer chats'). I tried the following:

1. I patched chatroom_chat_register_user() in chatroom.module to register a qualified user as chat admin when my access check function succeeds. I see in the chatroom_online_list DB table that the qualified users are now registered with is_admin = 1 for the right chats alright.

2. I patched chatroom_chat_kick_user() and chatroom_chat_kick_user() in updates.inc and replaced the user_access('administer chats') calls with corresponding calls to my access check function.

Unfortunately it still doesn't work. It seems the /kick and /ban messages are not being allowed through by the js code, so the allowed admin user's attempts to send /kick or /ban messages have no impact. My guess is that I need to patch the js code as well.

Need some hints on the places in the code I need to patch. I'm not a js expert.

Thanks in advance for any help.

Comments

chaldar’s picture

A typo correction (how did I do that even after previewing?! :-( ):

2. I patched chatroom_chat_kick_user() and chatroom_chat_kick_user() in updates.inc and replaced the user_access('administer chats') calls with corresponding calls to my access check function.

Obviously the above should read:

2. I patched chatroom_chat_kick_user() and chatroom_chat_ban_user() in updates.inc and replaced the user_access('administer chats') calls with corresponding calls to my access check function.

Also, I should add that /me, /msg, /away, and /back commands work perfectly fine after the patching and in general all other chatroom functionalities work as usual. It's just the /kick and /ban messages that still don't.

pomliane’s picture

Status: Active » Closed (won't fix)

This version of Chat Room is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.