Author Topic: help me about Oper change nick  (Read 10059 times)

Offline dynconf

  • First timer
  • *
  • Posts: 7
    • View Profile
help me about Oper change nick
« on: June 13, 2004, 02:50:30 am »
i need a code in s_user.c  to prevent Oper can change nick if they not deoper before ! thx

Offline IceDragon

  • Outstanding community member
  • ****
  • Posts: 185
  • Rawr
    • View Profile
    • IceRealm
help me about Oper change nick
« Reply #1 on: June 14, 2004, 03:09:32 pm »
If I've got you right and you want to prevent IRC operators from changing their nicknames, you can put the following in your src/s_user.c file - function m_nick() (Line 1247, if unmodified):

Code: [Select]
 /*
   ** Prevent IRC Operators from changing their nickname -- IceDragon
   */
  if (MyOper(cptr))
  {
      sendto_one (sptr, ":%s NOTICE %s :Nickname change denied - deoper first!",
                  me.name, parv[1]);
      return 0;
  }


In :badword:ure, don't waste your time asking the people here for modifications. As the saying goes - "Give a man a fish, and he eats for a day. Teach him to fish, and he eats for a lifetime".
I did it out of pure lack of anything else to do. Sorry for being selfish ;)

Offline dynconf

  • First timer
  • *
  • Posts: 7
    • View Profile
help me about Oper change nick
« Reply #2 on: June 14, 2004, 10:57:39 pm »
thx so much ! IceDragon  :)
I have a another question . how to change command /chghost nick newnick to another commands , what must i modify ?

Offline TheKing

  • First timer
  • *
  • Posts: 5
    • View Profile
Re: help me about Oper change nick
« Reply #3 on: March 12, 2010, 10:53:16 am »
IceDragon! bro Can you help me fix this code to it work for UltimateIRCd(Tsunami)-3.0(02)

thank alot bro !


Offline IceDragon

  • Outstanding community member
  • ****
  • Posts: 185
  • Rawr
    • View Profile
    • IceRealm
Re: help me about Oper change nick
« Reply #4 on: March 13, 2010, 02:37:44 am »
Well, the same code should work with a few modifications:
  • Instead of src/s_user.c you will change the contents of src/m_nick.c
  • You'll change the following function: int m_nick (aClient * client_p, aClient * source_p, int parc, char *parv[])

You will have to insert the modified code after these lines:
Code: [Select]
  if (parc < 2)
  {
    sendto_one (source_p, err_str (ERR_NONICKNAMEGIVEN), me.name, parv[0]);
    return 0;
  }

And the code itself that you should insert would be this:
Code: [Select]
  if (MyOper(client_p))
  {
      sendto_one (source_p, ":%s NOTICE %s :Nickname change denied - deoper first!",
                  me.name, parv[1]);
      return 0;
  }

I haven't compiled or tested this myself (it's been several years since I last modded Ultimate and last time I was here was back in 2004), but it should work in theory...


P.S. Please don't ask me to make modifications for your IRCds. I'm not really interested in this nowadays, nor am I as oriented as I used to be.

Offline TheKing

  • First timer
  • *
  • Posts: 5
    • View Profile
Re: help me about Oper change nick
« Reply #5 on: March 13, 2010, 03:21:31 am »
oh Thank alot bro, it worked :)

 

anything