summaryrefslogtreecommitdiff
path: root/src/users.c
diff options
context:
space:
mode:
authorviper viper@31f1291d-b8d6-0310-a050-a5561fc1590b <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-03 20:11:12 +0000
committerviper viper@31f1291d-b8d6-0310-a050-a5561fc1590b <viper viper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-03 20:11:12 +0000
commit790dc8a4bf326a7598fc41aa8c018e867edee33a (patch)
tree281aa0f14877734a92336a21355eb945a8d1517e /src/users.c
parent482a8aa766c9e1a96ff63b44ed319fe51588c35c (diff)
BUILD : 1.7.21 (1426) BUGS : 876 NOTES : We now support CIDR in channel ban/invite/except lists. Introduces new CIDR capable generic lists system.
git-svn-id: svn://svn.anope.org/anope/trunk@1426 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1141 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/users.c')
-rw-r--r--src/users.c50
1 files changed, 9 insertions, 41 deletions
diff --git a/src/users.c b/src/users.c
index bf3b5c2ac..44faaf9d5 100644
--- a/src/users.c
+++ b/src/users.c
@@ -506,7 +506,7 @@ User *do_nick(const char *source, char *nick, char *username, char *host,
if (!strcmp(vhost, "*")) {
vhost = NULL;
if (debug)
- alog("debug: new user with no vhost in NICK command: %s", nick);
+ alog("debug: new user�with no vhost in NICK command: %s", nick);
}
}
}
@@ -921,30 +921,13 @@ int is_oper(User * user)
/* Is the given user ban-excepted? */
int is_excepted(ChannelInfo * ci, User * user)
{
- int count, i;
- int isexcepted = 0;
- char **excepts;
-
- if (!ci->c)
- return 0;
-
- if (!ircd->except) {
+ if (!ci->c || !ircd->except)
return 0;
- }
- count = ci->c->exceptcount;
- excepts = scalloc(sizeof(char *) * count, 1);
- memcpy(excepts, ci->c->excepts, sizeof(char *) * count);
+ if (elist_match_user(ci->c->excepts, user))
+ return 1;
- for (i = 0; i < count; i++) {
- if (match_usermask(excepts[i], user)
- || match_userip(excepts[i], user, user->hostip)) {
- isexcepted = 1;
- break;
- }
- }
- free(excepts);
- return isexcepted;
+ return 0;
}
/*************************************************************************/
@@ -952,28 +935,13 @@ int is_excepted(ChannelInfo * ci, User * user)
/* Is the given MASK ban-excepted? */
int is_excepted_mask(ChannelInfo * ci, char *mask)
{
- int count, i;
- int isexcepted = 0;
- char **excepts;
-
- if (!ci->c)
- return 0;
-
- if (!ircd->except) {
+ if (!ci->c || !ircd->except)
return 0;
- }
- count = ci->c->exceptcount;
- excepts = scalloc(sizeof(char *) * count, 1);
- memcpy(excepts, ci->c->excepts, sizeof(char *) * count);
+ if (elist_match_mask(ci->c->excepts, mask, 0))
+ return 1;
- for (i = 0; i < count; i++) {
- if (match_wild_nocase(excepts[i], mask)) {
- isexcepted = 1;
- }
- }
- free(excepts);
- return isexcepted;
+ return 0;
}