2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2008 Alexander Barton (alex@barton.de)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
11 * IRC operator functions
28 #include "irc-write.h"
34 * Return and log a "no privileges" message.
37 Op_NoPrivileges(CLIENT * Client, REQUEST * Req)
42 from = Client_Search(Req->prefix);
45 Log(LOG_NOTICE, "No privileges: client \"%s\" (%s), command \"%s\"",
46 Req->prefix, Client_Mask(Client), Req->command);
47 return IRC_WriteStrClient(from, ERR_NOPRIVILEGES_MSG,
50 Log(LOG_NOTICE, "No privileges: client \"%s\", command \"%s\"",
51 Client_Mask(Client), Req->command);
52 return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG,
55 } /* Op_NoPrivileges */
59 * Check that the client is an IRC operator allowed to administer this server.
62 Op_Check(CLIENT * Client, REQUEST * Req)
66 assert(Client != NULL);
69 if (Client_Type(Client) == CLIENT_SERVER && Req->prefix)
70 c = Client_Search(Req->prefix);
75 if (!Client_HasMode(c, 'o'))
77 if (!Client_OperByMe(c) && !Conf_AllowRemoteOper)
79 /* The client is an local IRC operator, or this server is configured
80 * to trust remote operators. */