mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-08 23:00:27 +00:00
- IRC Operators can KILL users now.
This commit is contained in:
parent
6591f17f0a
commit
b99af4fa47
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: irc.c,v 1.104 2002/11/30 17:39:56 alex Exp $
|
* $Id: irc.c,v 1.105 2002/12/06 17:02:39 alex Exp $
|
||||||
*
|
*
|
||||||
* irc.c: IRC-Befehle
|
* irc.c: IRC-Befehle
|
||||||
*/
|
*/
|
||||||
@ -51,32 +51,41 @@ GLOBAL BOOLEAN
|
|||||||
IRC_KILL( CLIENT *Client, REQUEST *Req )
|
IRC_KILL( CLIENT *Client, REQUEST *Req )
|
||||||
{
|
{
|
||||||
CLIENT *prefix, *c;
|
CLIENT *prefix, *c;
|
||||||
|
CHAR reason[COMMAND_LEN];
|
||||||
|
|
||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
assert( Req != NULL );
|
assert( Req != NULL );
|
||||||
|
|
||||||
|
/* is the user an IRC operator? */
|
||||||
|
if(( Client_Type( Client ) != CLIENT_SERVER ) && ( ! Client_OperByMe( Client ))) return IRC_WriteStrClient( Client, ERR_NOPRIVILEGES_MSG, Client_ID( Client ));
|
||||||
|
|
||||||
/* Falsche Anzahl Parameter? */
|
/* Falsche Anzahl Parameter? */
|
||||||
if(( Req->argc != 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
if(( Req->argc != 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
||||||
|
|
||||||
prefix = Client_Search( Req->prefix );
|
if( Req->prefix ) prefix = Client_Search( Req->prefix );
|
||||||
|
else prefix = Client;
|
||||||
if( ! prefix )
|
if( ! prefix )
|
||||||
{
|
{
|
||||||
Log( LOG_WARNING, "Got KILL with invalid prefix: \"%s\"!", Req->prefix );
|
Log( LOG_WARNING, "Got KILL with invalid prefix: \"%s\"!", Req->prefix );
|
||||||
prefix = Client_ThisServer( );
|
prefix = Client_ThisServer( );
|
||||||
}
|
}
|
||||||
|
|
||||||
Log( LOG_NOTICE, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
|
Log( LOG_NOTICE|LOG_snotice, "Got KILL command from \"%s\" for \"%s\": %s", Client_Mask( prefix ), Req->argv[0], Req->argv[1] );
|
||||||
|
|
||||||
|
/* build reason string */
|
||||||
|
if( Client_Type( Client ) == CLIENT_USER ) sprintf( reason, "KILLed by %s: %s", Client_ID( Client ), Req->argv[1] );
|
||||||
|
else strcpy( reason, Req->argv[1] );
|
||||||
|
|
||||||
/* andere Server benachrichtigen */
|
/* andere Server benachrichtigen */
|
||||||
IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], Req->argv[1] );
|
IRC_WriteStrServersPrefix( Client, prefix, "KILL %s :%s", Req->argv[0], reason );
|
||||||
|
|
||||||
/* haben wir selber einen solchen Client? */
|
/* haben wir selber einen solchen Client? */
|
||||||
c = Client_Search( Req->argv[0] );
|
c = Client_Search( Req->argv[0] );
|
||||||
if( c )
|
if( c )
|
||||||
{
|
{
|
||||||
/* Ja, wir haben einen solchen Client */
|
/* Ja, wir haben einen solchen Client */
|
||||||
if( Client_Conn( c ) != NONE ) Conn_Close( Client_Conn( c ), NULL, Req->argv[1], TRUE );
|
if( Client_Conn( c ) != NONE ) Conn_Close( Client_Conn( c ), NULL, reason, TRUE );
|
||||||
else Client_Destroy( c, NULL, Req->argv[1], TRUE );
|
else Client_Destroy( c, NULL, reason, TRUE );
|
||||||
}
|
}
|
||||||
else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
|
else Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: parse.c,v 1.49 2002/11/30 17:39:56 alex Exp $
|
* $Id: parse.c,v 1.50 2002/12/06 17:02:39 alex Exp $
|
||||||
*
|
*
|
||||||
* parse.c: Parsen der Client-Anfragen
|
* parse.c: Parsen der Client-Anfragen
|
||||||
*/
|
*/
|
||||||
@ -69,7 +69,7 @@ COMMAND My_Commands[] =
|
|||||||
{ "ISON", IRC_ISON, CLIENT_USER, 0 },
|
{ "ISON", IRC_ISON, CLIENT_USER, 0 },
|
||||||
{ "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 0 },
|
{ "JOIN", IRC_JOIN, CLIENT_USER|CLIENT_SERVER, 0 },
|
||||||
{ "KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 0 },
|
{ "KICK", IRC_KICK, CLIENT_USER|CLIENT_SERVER, 0 },
|
||||||
{ "KILL", IRC_KILL, CLIENT_SERVER, 0 },
|
{ "KILL", IRC_KILL, CLIENT_USER|CLIENT_SERVER, 0 },
|
||||||
{ "LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0 },
|
{ "LINKS", IRC_LINKS, CLIENT_USER|CLIENT_SERVER, 0 },
|
||||||
{ "LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0 },
|
{ "LIST", IRC_LIST, CLIENT_USER|CLIENT_SERVER, 0 },
|
||||||
{ "LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0 },
|
{ "LUSERS", IRC_LUSERS, CLIENT_USER|CLIENT_SERVER, 0 },
|
||||||
|
Loading…
Reference in New Issue
Block a user