-GLOBAL BOOLEAN
-IRC_KILL( CLIENT *Client, REQUEST *Req )
-{
- CLIENT *prefix, *c;
-
- assert( Client != NULL );
- assert( Req != NULL );
-
- if( Client_Type( Client ) != CLIENT_SERVER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
-
- /* Falsche Anzahl Parameter? */
- if(( Req->argc != 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
-
- prefix = Client_Search( Req->prefix );
- if( ! prefix )
- {
- Log( LOG_WARNING, "Got KILL with invalid prefix: \"%s\"!", Req->prefix );
- prefix = Client_ThisServer( );
- }
-
- Log( LOG_NOTICE, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
-
- /* andere Server benachrichtigen */
- IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], Req->argv[1] );
-
- /* haben wir selber einen solchen Client? */
- c = Client_Search( Req->argv[0] );
- if( c )
- {
- /* Ja, wir haben einen solchen Client */
- if( Client_Conn( c ) != NONE ) Conn_Close( Client_Conn( c ), NULL, Req->argv[1], TRUE );
- else Client_Destroy( c, NULL, Req->argv[1], TRUE );
- }
- else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
-
- return CONNECTED;
-} /* IRC_KILL */
-
-
-GLOBAL BOOLEAN
-IRC_ADMIN(CLIENT *Client, REQUEST *Req )
-{
- CLIENT *target, *prefix;
-
- assert( Client != NULL );
- assert( Req != NULL );
-
- if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
-
- /* Falsche Anzahl Parameter? */
- if(( Req->argc > 1 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
-
- /* Ziel suchen */
- if( Req->argc == 1 ) target = Client_Search( Req->argv[0] );
- else target = Client_ThisServer( );
-
- /* Prefix ermitteln */
- if( Client_Type( Client ) == CLIENT_SERVER ) prefix = Client_Search( Req->prefix );
- else prefix = Client;
- if( ! prefix ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->prefix );
-
- /* An anderen Server weiterleiten? */
- if( target != Client_ThisServer( ))
- {
- if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[0] );
-
- /* forwarden */
- IRC_WriteStrClientPrefix( target, prefix, "ADMIN %s", Req->argv[0] );