• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ How-to (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Remove ban and kick the owner of the chat room

A collection of how-to's, submitted by users for other users!

Moderator: re*s.t.a.r.s.*2

Post a reply
3 posts • Page 1 of 1

Postby waiheke » Fri Oct 29, 2010 11:06 pm

Remove the ability of other OP's to /kick or /ban you.

open src/commands/kick.class.php

scroll down to:

Code: Select all
    if ($nick == '')
    {
      // error
      $cmdp = $p;
      $cmdp["param"] = _pfc("Missing parameter");
      $cmdp["param"] .= " (".$this->usage.")";
      $cmd =& pfcCommand::Factory("error");
      $cmd->run($xml_reponse, $cmdp);
      return;
    }

immediately after that, paste this, replacing 'insert your user name here' with your user name, inside the single quotes.
you can change the error message too, on the "param" line:

Code: Select all
    if ($nick == 'insert your user name here')
    {
      //not a good move
      $cmdp = $p;
      $cmdp["param"] = _pfc(" You know that is not going to happen, right? ");
      $cmd =& pfcCommand::Factory("error");
     $cmd->run($xml_reponse, $cmdp);
      return;
    }

This is a soft approach that generates an error message

Open ban.class.php and do the same thing

:)
Last edited by waiheke on Fri Oct 29, 2010 11:28 pm, edited 1 time in total.
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby waiheke » Sat Oct 30, 2010 1:07 am

This is a harder approach, that instantly retaliates with the same command:
This is an alternative to the 2nd code block above -- not as well as. Use just one or the other.

Code: Select all
    if ($nick == 'insert your user name here')
    {
      $nick=NULL;
      $nick = $sender;
      $reason = "Instant karma bites !";
    } else {
      // carry on as normal
   }

This can go in both ban.class.php and kick.class.php files

If you would like to protect several OP users .. replace this line

Code: Select all
if ($nick == 'insert your user name here')

with this one:

Code: Select all
if ($nick == 'insert user name' || $nick == 'insert another user name') || $nick == 'insert another user name')
waiheke
Member
 
Posts: 126
Joined: Sun Sep 12, 2010 4:33 pm
Top

Postby seobox » Mon May 23, 2011 9:26 am

Thanks for this. Very interesting..
Last edited by seobox on Tue May 24, 2011 11:30 am, edited 1 time in total.
seobox
New member
 
Posts: 2
Joined: Fri May 20, 2011 9:42 am
Top


Post a reply
3 posts • Page 1 of 1

Return to How-to (v1.x)

Who is online

Users browsing this forum: No registered users and 0 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub