X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-oper.c;h=e68defb543bdcfb20dec61069fa54c595fabe071;hp=d71bcaaf6ccccef7b7f34ee85586364d6ffd1020;hb=1d8cb34bc88c8891a1d6a7c3a78ff78909e9f8bf;hpb=2ee05c9a6856d78f996dfbc991452e4cc1c58c37 diff --git a/src/ngircd/irc-oper.c b/src/ngircd/irc-oper.c index d71bcaaf..e68defb5 100644 --- a/src/ngircd/irc-oper.c +++ b/src/ngircd/irc-oper.c @@ -9,34 +9,35 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: irc-oper.c,v 1.1 2002/03/03 17:15:11 alex Exp $ + * $Id: irc-oper.c,v 1.10 2002/11/22 23:32:29 alex Exp $ * * irc-oper.c: IRC-Operator-Befehle - * - * $Log: irc-oper.c,v $ - * Revision 1.1 2002/03/03 17:15:11 alex - * - Source in weitere Module fuer IRC-Befehle aufgesplitted. - * */ -#include -#include "global.h" +#include "portab.h" -#include +#include "imp.h" #include +#include #include "ngircd.h" +#include "resolve.h" #include "conf.h" +#include "conn.h" +#include "client.h" +#include "channel.h" #include "irc-write.h" #include "log.h" #include "messages.h" +#include "parse.h" #include #include "irc-oper.h" -GLOBAL BOOLEAN IRC_OPER( CLIENT *Client, REQUEST *Req ) +GLOBAL BOOLEAN +IRC_OPER( CLIENT *Client, REQUEST *Req ) { INT i; @@ -74,14 +75,15 @@ GLOBAL BOOLEAN IRC_OPER( CLIENT *Client, REQUEST *Req ) IRC_WriteStrServersPrefix( NULL, Client, "MODE %s :+o", Client_ID( Client )); } - if( ! Client_OperByMe( Client )) Log( LOG_NOTICE, "Got valid OPER from \"%s\", user is an IRC operator now.", Client_Mask( Client )); + if( ! Client_OperByMe( Client )) Log( LOG_NOTICE|LOG_snotice, "Got valid OPER from \"%s\", user is an IRC operator now.", Client_Mask( Client )); Client_SetOperByMe( Client, TRUE ); return IRC_WriteStrClient( Client, RPL_YOUREOPER_MSG, Client_ID( Client )); } /* IRC_OPER */ -GLOBAL BOOLEAN IRC_DIE( CLIENT *Client, REQUEST *Req ) +GLOBAL BOOLEAN +IRC_DIE( CLIENT *Client, REQUEST *Req ) { assert( Client != NULL ); assert( Req != NULL ); @@ -93,13 +95,34 @@ GLOBAL BOOLEAN IRC_DIE( CLIENT *Client, REQUEST *Req ) if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); - Log( LOG_NOTICE, "Got DIE command from \"%s\", going down!", Client_Mask( Client )); + Log( LOG_NOTICE|LOG_snotice, "Got DIE command from \"%s\", going down!", Client_Mask( Client )); NGIRCd_Quit = TRUE; return CONNECTED; } /* IRC_DIE */ -GLOBAL BOOLEAN IRC_RESTART( CLIENT *Client, REQUEST *Req ) +GLOBAL BOOLEAN +IRC_REHASH( CLIENT *Client, REQUEST *Req ) +{ + assert( Client != NULL ); + assert( Req != NULL ); + + if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); + + /* Falsche Anzahl Parameter? */ + if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + + if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); + + Log( LOG_NOTICE|LOG_snotice, "Got REHASH command from \"%s\", re-reading configuration ...", Client_Mask( Client )); + NGIRCd_Rehash( ); + + return CONNECTED; +} /* IRC_REHASH */ + + +GLOBAL BOOLEAN +IRC_RESTART( CLIENT *Client, REQUEST *Req ) { assert( Client != NULL ); assert( Req != NULL ); @@ -111,10 +134,31 @@ GLOBAL BOOLEAN IRC_RESTART( CLIENT *Client, REQUEST *Req ) if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); - Log( LOG_NOTICE, "Got RESTART command from \"%s\", going down!", Client_Mask( Client )); + Log( LOG_NOTICE|LOG_snotice, "Got RESTART command from \"%s\", going down!", Client_Mask( Client )); NGIRCd_Restart = TRUE; return CONNECTED; } /* IRC_RESTART */ +GLOBAL BOOLEAN +IRC_CONNECT(CLIENT *Client, REQUEST *Req ) +{ + /* Vorlaeufige Version zu Debug-Zwecken: es wird einfach + * der "passive mode" aufgehoben, mehr passiert nicht ... */ + + assert( Client != NULL ); + assert( Req != NULL ); + + if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client )); + + /* Falsche Anzahl Parameter? */ + if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command ); + if(( ! Client_HasMode( Client, 'o' )) || ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client )); + + Log( LOG_NOTICE|LOG_snotice, "Got CONNECT command from \"%s\".", Client_Mask( Client )); + NGIRCd_Passive = FALSE; + return CONNECTED; +} /* IRC_CONNECT */ + + /* -eof- */