-
Notifications
You must be signed in to change notification settings - Fork 300
Mod Moderator Admin Escalation
Orrden edited this page May 22, 2015
·
2 revisions
On my Forum, there are users I trust and users I do not. We have a full staff, but there are times when we are unable to monitor every channel of our AJAX Chat. So I have created a command that allows for a normal user to be Escalated to a Moderator level. I don't advise giving this to just anyone unless you trust them with the power.
In CustomAJAXChat.php - Add:
function parseCustomCommands($text, $textParts) {
switch($textParts[0]) {
// NEW COMMANDS BELOW THIS case: 'blah';
case '/engage-0110AD':
$this->setUserRole(AJAX_CHAT_MODERATOR);
$this->insertChatBotMessage( $this->getChannel(), $this->getLoginUserName().' claims Mod Powers.');
$this->setUserName( 'Super-' .$this->getLoginUserName());
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
case '/engage-0110AD_VYDd9804':
$this->setUserRole(AJAX_CHAT_ADMIN);
$this->insertChatBotMessage( $this->getChannel(), $this->getLoginUserName().' claims Admin Power');
$this->setUserName( 'Uber-' .$this->getLoginUserName());
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
case '/void-0110AD':
$this->setUserRole(AJAX_CHAT_USER);
$this->insertChatBotMessage( $this->getChannel(), $this->getUsername(). ' has surrendered Power.');
$this->setUsername( $this->getLoginUserName());
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
}
}
You can adjust the commands by editing the values in:
case '/engage-0110AD':
and
case '/engage-0110AD_VYDd9804':
and you can modify the release command by editing this value:
case '/void-0110AD':