1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
/* Simple interfaces to various protocols.
*
* (C) 2003 Anope Team
* Contact us at info@anope.org
*
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
* $Id$
*
*/
#include "services.h"
/* Makes an permanent ban from all the servers. Assumes that the matching clients are killed. */
void s_akill(char *user, char *host, char *who, time_t when,
time_t expires, char *reason)
{
#if defined(IRC_BAHAMUT)
/* send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user, 86400*2, who, when, reason); */
send_cmd(NULL, "AKILL %s %s %d %s %ld :%s", host, user,
86400 * 2, who, time(NULL), reason);
#elif defined(IRC_UNREAL)
send_cmd(NULL, "TKL + G %s %s %s %ld %ld :%s", user, host, who, time(NULL) + 86400 * 2, /* Avoids filling the akill list of servers too much */
when, reason);
#elif defined(IRC_DREAMFORGE)
send_cmd(NULL, "AKILL %s %s :%s", host, user, reason);
#elif defined(IRC_PTLINK)
send_cmd(ServerName, "GLINE %s@%s %i %s :%s", user, host, 86400 * 2,
who, reason);
#elif defined(IRC_HYBRID)
send_cmd(s_OperServ, "KLINE * %ld %s %s :%s",
(expires - (long) time(NULL)), user, host, reason);
#endif
}
/*************************************************************************/
/* Removes a permanent ban from all the servers. */
void s_rakill(char *user, char *host)
{
#if defined(IRC_PTLINK)
send_cmd(NULL, "UNGLINE %s@%s", user, host);
#elif defined(IRC_UNREAL)
send_cmd(NULL, "TKL - G %s %s %s", user, host, s_OperServ);
#elif !defined(IRC_HYBRID)
send_cmd(NULL, "RAKILL %s %s", host, user);
#endif
}
/*************************************************************************/
void s_sgline(char *mask, char *reason)
{
#ifdef IRC_BAHAMUT
/* User *u; */
send_cmd(NULL, "SGLINE %d :%s:%s", strlen(mask), mask, reason);
/* Do things properly: kill all corresponding users as this is
unfortunately not done by the IRCds :/ */
/* Breaks things currently! */
/* for (u = firstuser(); u; u = nextuser())
if (match_wild_nocase(mask, u->realname))
send_cmd(NULL, "SVSKILL %s :G-Lined: %s", u->nick, reason); */
#endif
}
/*************************************************************************/
void s_sqline(char *mask, char *reason)
{
#ifdef IRC_BAHAMUT
if (*mask == '#') {
int i;
Channel *c, *next;
char *av[3];
struct c_userlist *cu, *cunext;
send_cmd(NULL, "SQLINE %s :%s", mask, reason);
for (i = 0; i < 1024; i++) {
for (c = chanlist[i]; c; c = next) {
next = c->next;
if (!match_wild_nocase(mask, c->name))
continue;
for (cu = c->users; cu; cu = cunext) {
cunext = cu->next;
if (is_oper(cu->user))
continue;
av[0] = c->name;
av[1] = cu->user->nick;
av[2] = reason;
send_cmd(s_OperServ, "KICK %s %s :Q-Lined: %s", av[0],
av[1], av[2]);
do_kick(s_ChanServ, 3, av);
}
}
}
} else {
#endif
send_cmd(NULL, "SQLINE %s :%s", mask, reason);
#ifdef IRC_BAHAMUT
}
#endif
}
/*************************************************************************/
void s_svsnoop(char *server, int set)
{
#ifndef IRC_HYBRID
#ifdef IRC_PTLINK
send_cmd(NULL, "SVSADMIN %s :%s", server, set ? "noopers" : "rehash");
#else
send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-"));
#endif
#endif
}
/*************************************************************************/
void s_szline(char *mask, char *reason)
{
#ifdef IRC_BAHAMUT
send_cmd(NULL, "SZLINE %s :%s", mask, reason);
#endif
}
/*************************************************************************/
void s_unsgline(char *mask)
{
#ifdef IRC_BAHAMUT
send_cmd(NULL, "UNSGLINE 0 :%s", mask);
#endif
}
/*************************************************************************/
void s_unsqline(char *mask)
{
#ifdef IRC_BAHAMUT
send_cmd(NULL, "UNSQLINE 0 %s", mask);
#else
send_cmd(NULL, "UNSQLINE %s", mask);
#endif
}
/*************************************************************************/
void s_unszline(char *mask)
{
#ifdef IRC_BAHAMUT
send_cmd(NULL, "UNSZLINE 0 %s", mask);
#endif
}
|