| 19 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
| 20 |
|
* USA |
| 21 |
|
* |
| 22 |
< |
* $Id: m_xline.c,v 1.70 2005/09/03 06:05:37 michael Exp $ |
| 22 |
> |
* $Id$ |
| 23 |
|
*/ |
| 24 |
|
|
| 25 |
|
#include "stdinc.h" |
| 26 |
< |
#include "tools.h" |
| 26 |
> |
#include "list.h" |
| 27 |
|
#include "channel.h" |
| 28 |
|
#include "client.h" |
| 29 |
|
#include "common.h" |
| 45 |
|
#include "parse.h" |
| 46 |
|
#include "modules.h" |
| 47 |
|
#include "resv.h" |
| 48 |
– |
#include "list.h" |
| 49 |
– |
|
| 50 |
– |
static void mo_xline(struct Client *, struct Client *, int, char *[]); |
| 51 |
– |
static void ms_xline(struct Client *, struct Client *, int, char *[]); |
| 52 |
– |
static void me_xline(struct Client *, struct Client *, int, char *[]); |
| 48 |
|
|
| 54 |
– |
static void mo_unxline(struct Client *, struct Client *, int, char *[]); |
| 55 |
– |
static void ms_unxline(struct Client *, struct Client *, int, char *[]); |
| 49 |
|
|
| 50 |
|
static int valid_xline(struct Client *, char *, char *, int); |
| 51 |
|
static void write_xline(struct Client *, char *, char *, time_t); |
| 54 |
|
|
| 55 |
|
static void relay_xline(struct Client *, char *[]); |
| 56 |
|
|
| 64 |
– |
struct Message xline_msgtab = { |
| 65 |
– |
"XLINE", 0, 0, 2, 0, MFLG_SLOW, 0, |
| 66 |
– |
{ m_unregistered, m_not_oper, ms_xline, me_xline, mo_xline, m_ignore } |
| 67 |
– |
}; |
| 68 |
– |
|
| 69 |
– |
struct Message unxline_msgtab = { |
| 70 |
– |
"UNXLINE", 0, 0, 2, 0, MFLG_SLOW, 0, |
| 71 |
– |
{ m_unregistered, m_not_oper, ms_unxline, m_ignore, mo_unxline, m_ignore } |
| 72 |
– |
}; |
| 73 |
– |
|
| 74 |
– |
#ifndef STATIC_MODULES |
| 75 |
– |
void |
| 76 |
– |
_modinit(void) |
| 77 |
– |
{ |
| 78 |
– |
mod_add_cmd(&xline_msgtab); |
| 79 |
– |
mod_add_cmd(&unxline_msgtab); |
| 80 |
– |
} |
| 81 |
– |
|
| 82 |
– |
void |
| 83 |
– |
_moddeinit(void) |
| 84 |
– |
{ |
| 85 |
– |
mod_del_cmd(&xline_msgtab); |
| 86 |
– |
mod_del_cmd(&unxline_msgtab); |
| 87 |
– |
} |
| 88 |
– |
|
| 89 |
– |
const char *_version = "$Revision: 1.70 $"; |
| 90 |
– |
#endif |
| 91 |
– |
|
| 92 |
– |
|
| 57 |
|
/* mo_xline() |
| 58 |
|
* |
| 59 |
|
* inputs - pointer to server |
| 75 |
|
char *target_server = NULL; |
| 76 |
|
time_t tkline_time = 0; |
| 77 |
|
|
| 78 |
< |
if (!IsOperX(source_p)) |
| 78 |
> |
if (!HasOFlag(source_p, OPER_FLAG_X)) |
| 79 |
|
{ |
| 80 |
|
sendto_one(source_p, form_str(ERR_NOPRIVS), |
| 81 |
|
me.name, source_p->name, "xline"); |
| 199 |
|
"XLINE %s %s %s :%s", |
| 200 |
|
parv[1], parv[2], parv[3], parv[4]); |
| 201 |
|
|
| 202 |
< |
if (match(parv[1], me.name)) |
| 202 |
> |
if (!match(parv[1], me.name)) |
| 203 |
|
return; |
| 204 |
|
|
| 205 |
|
if (find_matching_name_conf(ULINE_TYPE, source_p->servptr->name, |
| 237 |
|
char *gecos = NULL; |
| 238 |
|
char *target_server = NULL; |
| 239 |
|
|
| 240 |
< |
if (!IsOperX(source_p)) |
| 240 |
> |
if (!HasOFlag(source_p, OPER_FLAG_X)) |
| 241 |
|
{ |
| 242 |
|
sendto_one(source_p, form_str(ERR_NOPRIVS), |
| 243 |
|
me.name, source_p->name, "unxline"); |
| 434 |
|
|
| 435 |
|
return 0; |
| 436 |
|
} |
| 437 |
+ |
|
| 438 |
+ |
static struct Message xline_msgtab = { |
| 439 |
+ |
"XLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, |
| 440 |
+ |
{ m_unregistered, m_not_oper, ms_xline, me_xline, mo_xline, m_ignore } |
| 441 |
+ |
}; |
| 442 |
+ |
|
| 443 |
+ |
static struct Message unxline_msgtab = { |
| 444 |
+ |
"UNXLINE", 0, 0, 2, MAXPARA, MFLG_SLOW, 0, |
| 445 |
+ |
{ m_unregistered, m_not_oper, ms_unxline, m_ignore, mo_unxline, m_ignore } |
| 446 |
+ |
}; |
| 447 |
+ |
|
| 448 |
+ |
static void |
| 449 |
+ |
module_init(void) |
| 450 |
+ |
{ |
| 451 |
+ |
mod_add_cmd(&xline_msgtab); |
| 452 |
+ |
mod_add_cmd(&unxline_msgtab); |
| 453 |
+ |
} |
| 454 |
+ |
|
| 455 |
+ |
static void |
| 456 |
+ |
module_exit(void) |
| 457 |
+ |
{ |
| 458 |
+ |
mod_del_cmd(&xline_msgtab); |
| 459 |
+ |
mod_del_cmd(&unxline_msgtab); |
| 460 |
+ |
} |
| 461 |
+ |
|
| 462 |
+ |
struct module module_entry = { |
| 463 |
+ |
.node = { NULL, NULL, NULL }, |
| 464 |
+ |
.name = NULL, |
| 465 |
+ |
.version = "$Revision$", |
| 466 |
+ |
.handle = NULL, |
| 467 |
+ |
.modinit = module_init, |
| 468 |
+ |
.modexit = module_exit, |
| 469 |
+ |
.flags = 0 |
| 470 |
+ |
}; |