How to remove commands ? (/nick)

71 views
Skip to first unread message

Bah Bonjour

unread,
Apr 26, 2016, 10:34:40 AM4/26/16
to AJAX-chat
Hello,
I am using this chat and it is awesome but, I want to remove the /nick command (or at least make it for admins)
How do I do this ?
Thanks for help.

Bobby Russ

unread,
Apr 26, 2016, 11:09:53 AM4/26/16
to Bah Bonjour, AJAX-chat

You could set the configuration setting in the lib directory to no on allow change username.  This would be for all users.

--
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.

Banjo Fox

unread,
Sep 1, 2016, 5:20:56 PM9/1/16
to ajax...@googlegroups.com, kiwimet...@gmail.com
It is possible to change the config so that ONLY Admins and Moderators can use  /nick.
I have tried to post the code here but for some reason the system won't let me -.-

Addendum:

This is a link to my Github fork of the AJAXChat repo.
More specifically it points to the Notes.txt file which I have been using to track changes

https://github.com/BanjoFox/AJAX-Chat-RPGMode/blob/master/chat/Notes.txt

Cuore di angelo

unread,
Sep 2, 2016, 6:25:01 AM9/2/16
to AJAX-chat
In lib -> config.php

change this:

// Allow/Disallow users to change their userName (Nickname):
$config['allowNickChange'] = true;


to this:

// Allow/Disallow users to change their userName (Nickname):
$config['allowNickChange'] = false;

Cuore di angelo

unread,
Sep 2, 2016, 6:58:08 AM9/2/16
to AJAX-chat
To allow the change of nickname only administrators and moderators :

File: AJAXChat.php (line 1300 +/-)
change this:

function insertParsedMessageNick($textParts) {
if(!$this->getConfig('allowNickChange') ||
(!$this->getConfig('allowGuestUserName') && $this->getUserRole() == AJAX_CHAT_GUEST)) {
$this->insertChatBotMessage(
$this->getPrivateMessageID(),
'/error CommandNotAllowed '.$textParts[0]
);


To this:

function insertParsedMessageNick($textParts) {
if(!$this->getConfig('allowNickChange') ||
(!$this->getConfig('allowdGuestUserName') && $this->getUserRole() == AJAX_CHAT_GUEST) ||
  ($this->getUserRole() == AJAX_CHAT_USER)) { 
$this->insertChatBotMessage(
$this->getPrivateMessageID(),
'/error CommandNotAllowed '.$textParts[0]
);



Il giorno martedì 26 aprile 2016 16:34:40 UTC+2, Apjue ha scritto:

Banjo Fox

unread,
Sep 2, 2016, 8:42:51 AM9/2/16
to AJAX-chat
Yep.

That's exactly what I did.
You can also copy/paste the entire "function insertParsedMessageNick($textParts) { ... }" code block into the CustomAJAXChat.php to make it more "future proof" but that takes a lot more doing ;)
Reply all
Reply to author
Forward
0 new messages