X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_admin.cpp;h=8c149eb3de3341f5912fdd8ff3798874ef23d322;hb=1552f3918ac0dad7fef9b86b70c0f4a63d4e37a7;hp=8ca05a523cb48ccb3b92965b847e4c7e9b4e71aa;hpb=65923c4d397ce3655473b2d25db5acc90aa78075;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_admin.cpp b/src/cmd_admin.cpp index 8ca05a523..8c149eb3d 100644 --- a/src/cmd_admin.cpp +++ b/src/cmd_admin.cpp @@ -2,12 +2,9 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. - * E-mail: - * - * + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits * - * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see * the file COPYING for details. * @@ -16,16 +13,23 @@ #include "configreader.h" #include "users.h" -#include "commands.h" -#include "helperfuncs.h" #include "commands/cmd_admin.h" -extern ServerConfig* Config; +extern "C" command_t* init_command(InspIRCd* Instance) +{ + return new cmd_admin(Instance); +} -void cmd_admin::Handle (char **parameters, int pcnt, userrec *user) +/** Handle /ADMIN + */ +CmdResult cmd_admin::Handle (const char** parameters, int pcnt, userrec *user) { - WriteServ(user->fd,"256 %s :Administrative info for %s",user->nick,Config->ServerName); - WriteServ(user->fd,"257 %s :Name - %s",user->nick,Config->AdminName); - WriteServ(user->fd,"258 %s :Nickname - %s",user->nick,Config->AdminNick); - WriteServ(user->fd,"258 %s :E-Mail - %s",user->nick,Config->AdminEmail); + if (!pcnt) + { + user->WriteServ("256 %s :Administrative info for %s",user->nick,ServerInstance->Config->ServerName); + user->WriteServ("257 %s :Name - %s",user->nick,ServerInstance->Config->AdminName); + user->WriteServ("258 %s :Nickname - %s",user->nick,ServerInstance->Config->AdminNick); + user->WriteServ("258 %s :E-Mail - %s",user->nick,ServerInstance->Config->AdminEmail); + } + return CMD_SUCCESS; }