added /vhost support as a alias for HostServ. Shmad will need to update hostserv to support

This commit is contained in:
fishwaldo 2002-09-12 07:15:58 +00:00
parent 2dae604011
commit bfa8da36f2
6 changed files with 137 additions and 9 deletions

1
.gitattributes vendored
View file

@ -385,6 +385,7 @@ modules/m_user.c -text
modules/m_userhost.c -text
modules/m_users.c -text
modules/m_version.c -text
modules/m_vhost.c -text
modules/m_wallops.c -text
modules/m_who.c -text
modules/m_whois.c -text

View file

@ -34,3 +34,4 @@ Symbols are:
(F) - Added Chanmode +R and username +r for registered channels and registered users
(F) - No more need for 3 opers to vote on a Gline. One oper does it now.
(F) - Moved ungline to m_gline, and unkline, undline to m_kline. removed m_unkline now.
(F) - Added /vhost as a alias for hostserv (From NeoStats). Have to get Shmad to update hostserv. (:fish PRIVMSG HostServ!services@stats.dynam.ac :login username password) is the syntax.

14
TODO
View file

@ -1,7 +1,13 @@
$Id: TODO,v 1.4 2002/09/02 04:10:59 fishwaldo Exp $
$Id: TODO,v 1.5 2002/09/12 07:15:57 fishwaldo Exp $
invites and exception list (and invite exception lists) should
override a oper only channel :)
NeoStats HostServ should accept /privmsg hostserv login <username> <password> for NeoIRCD vhost support!
Does Glines get propogated to new servers that have just joined the network? I don't think so, but have to confirm.
server<->server channel modes... Do they work?
SQlines etc need to be propogated
/nickserv /chanserv etc need to be added (dynamically!)
sendto_realops and sendto_realops_flags needs ability to send network wide (not just server wide)
update SERVER command, so Hidden, or Dynamic U-lined servers are introduced in a nicer way (Not via Server info line, as its done now)

View file

@ -1,7 +1,7 @@
#
# Makefile.in for ircd/modules
#
# $Id: Makefile.in,v 1.5 2002/09/12 05:45:19 fishwaldo Exp $
# $Id: Makefile.in,v 1.6 2002/09/12 07:15:58 fishwaldo Exp $
#
CC = @CC@
AR = @AR@
@ -103,7 +103,8 @@ SRCS = \
m_whois.c \
m_whowas.c \
m_sethost.c \
m_svscmds.c
m_svscmds.c \
m_vhost.c
ALL_SRCS = $(CORE_SRCS) \
$(SRCS)

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_kline.c,v 1.4 2002/09/12 05:45:20 fishwaldo Exp $
* $Id: m_kline.c,v 1.5 2002/09/12 07:15:58 fishwaldo Exp $
*/
#include "stdinc.h"
@ -86,7 +86,7 @@ _moddeinit(void)
mod_del_cmd(&dline_msgtab[0]);
mod_del_cmd(&dline_msgtab[1]);
}
const char *_version = "$Revision: 1.4 $";
const char *_version = "$Revision: 1.5 $";
#endif
/* Local function prototypes */
@ -326,7 +326,7 @@ ms_kline(struct Client *client_p, struct Client *source_p,
tkline_time = atoi(parv[2]);
if (find_u_conf((char *)source_p->user->server,
source_p->username, source_p->host))
source_p->username, source_p->host) || IsUlined(source_p) || IsServices(source_p))
{
sendto_realops_flags(FLAGS_ALL, L_ALL,
"*** Received K-Line for [%s@%s] [%s], from %s!%s@%s on %s",

119
modules/m_vhost.c Normal file
View file

@ -0,0 +1,119 @@
/************************************************************************
* IRC - Internet Relay Chat. m_vhost.c module
* Copyright (C) 2001 Hybrid Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: m_vhost.c,v 1.1 2002/09/12 07:15:58 fishwaldo Exp $
*/
/* List of ircd includes from ../include/ */
#include "stdinc.h"
#include "handlers.h"
#include "client.h"
#include "common.h" /* FALSE bleah */
#include "ircd.h"
#include "irc_string.h"
#include "numeric.h"
#include "fdlist.h"
#include "s_bsd.h"
#include "s_conf.h"
#include "s_log.h"
#include "s_serv.h"
#include "send.h"
#include "msg.h"
#include "parse.h"
#include "modules.h"
#include "hash.h"
#include "whowas.h"
/* define who hostserv is on your network */
#define HOSTSERV "HostServ"
/* Declare the void's initially up here, as modules dont have an
* include file, we will normally have client_p, source_p, parc
* and parv[] where:
*
* client_p == client issuing command
* source_p == where the command came from
* parc == the number of parameters
* parv == an array of the parameters
*/
static void m_vhost(struct Client *client_p, struct Client *source_p,
int parc, char *parv[]);
/* Show the commands this module can handle in a msgtab
* and give the msgtab a name, here its test_msgtab
*/
struct Message vhost_msgtab = {
"VHOST", 0, 0, 3, 3, MFLG_SLOW, 0,
{m_ignore, m_vhost, m_ignore, m_vhost}
};
/* Thats the msgtab finished */
#ifndef STATIC_MODULES
/* Here we tell it what to do when the module is loaded */
void
_modinit(void)
{
/* This will add the commands in test_msgtab (which is above) */
mod_add_cmd(&vhost_msgtab);
}
/* here we tell it what to do when the module is unloaded */
void
_moddeinit(void)
{
/* This will remove the commands in test_msgtab (which is above) */
mod_del_cmd(&vhost_msgtab);
}
/* When we last modified the file (shown in /modlist), this is usually:
*/
const char *_version = "$Revision: 1.1 $";
#endif
/*
* m_vhost
* Changes the Targets Virtual Hostname, and also sets +x if its not set already on the target
* parv[0] = sender prefix
* parv[1] = username
* parv[2] = password
*/
static void m_vhost(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
struct Client *target_p;
target_p = find_person(HOSTSERV);
/* if we found the target and its *IS* set a services, send the message to it, otherwise services are not online! */
if ((target_p != NULL) && (IsServices(target_p))) {
ilog(L_WARN, "vhost: Found Target %s", target_p->name);
sendto_one(target_p, ":%s PRIVMSG %s!%s@%s :login %s %s", client_p->name, target_p->name, target_p->username, target_p->host, parv[1], parv[2]);
} else {
sendto_one(source_p, ":%s 440 %s %s :Services are currently down. Please try again later.", me.name, source_p->name, HOSTSERV);
/* we couldn't find the target. Just exit */
return;
}
}