Commit Diff


commit - 4ded22b00b44551ecf3b8d325144c2463ec4fe50
commit + 3a3d6d7b9a4b5e23f187a3722cb10ca9a916169f
blob - 4ec0427f2ff3cb197d3effffdf751d9aace0763f
blob + 402cfead579d5c2e3c5601ec1cff3c3c0e677e53
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc.c,v 1.94 2002/07/25 11:37:01 alex Exp $
+ * $Id: irc.c,v 1.95 2002/09/16 09:14:45 alex Exp $
  *
  * irc.c: IRC-Befehle
  */
@@ -656,6 +656,49 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
 
 
 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] );
+		return CONNECTED;
+	}
+
+	/* mit Versionsinfo antworten */
+	if( ! IRC_WriteStrClient( Client, RPL_ADMINME_MSG, Client_ID( prefix ), Conf_ServerName )) return DISCONNECTED;
+	if( ! IRC_WriteStrClient( Client, RPL_ADMINLOC1_MSG, Client_ID( prefix ), Conf_ServerAdmin1 )) return DISCONNECTED;
+	if( ! IRC_WriteStrClient( Client, RPL_ADMINLOC2_MSG, Client_ID( prefix ), Conf_ServerAdmin2 )) return DISCONNECTED;
+	if( ! IRC_WriteStrClient( Client, RPL_ADMINEMAIL_MSG, Client_ID( prefix ), Conf_ServerAdminMail )) return DISCONNECTED;
+
+	return CONNECTED;
+} /* IRC_ADMIN */
+
+
+
+GLOBAL BOOLEAN
 IRC_Show_MOTD( CLIENT *Client )
 {
 	BOOLEAN ok;
blob - f65148e91629bd85420e2f6ae520620a8ecd35a7
blob + 0864f266696a6a760dba1ede3ad57b1edde3941b
--- src/ngircd/irc.h
+++ src/ngircd/irc.h
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc.h,v 1.31 2002/05/27 13:09:27 alex Exp $
+ * $Id: irc.h,v 1.32 2002/09/16 09:14:45 alex Exp $
  *
  * irc.h: IRC-Befehle (Header)
  */
@@ -23,6 +23,7 @@ GLOBAL BOOLEAN IRC_MOTD PARAMS((CLIENT *Client, REQUES
 GLOBAL BOOLEAN IRC_LUSERS PARAMS((CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_LINKS PARAMS((CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_VERSION PARAMS((CLIENT *Client, REQUEST *Req ));
+GLOBAL BOOLEAN IRC_ADMIN PARAMS((CLIENT *Client, REQUEST *Req ));
 
 GLOBAL BOOLEAN IRC_PRIVMSG PARAMS((CLIENT *Client, REQUEST *Req ));
 GLOBAL BOOLEAN IRC_NOTICE PARAMS((CLIENT *Client, REQUEST *Req ));