summaryrefslogtreecommitdiff
path: root/src/sessions.c
diff options
context:
space:
mode:
authortrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-11-28 06:10:17 +0000
committertrystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b <trystan trystan@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-11-28 06:10:17 +0000
commitf37314234168d48ea2dddba3a3b4b8fefadab8b3 (patch)
treed2a0f3dab7647c7b4b99ae7004002b242d20deff /src/sessions.c
parentc55942927eccc7b3bf3e5aa742acdb737b4a8989 (diff)
BUILD : 1.7.6 (463) BUGS : 192, 210, 222, 234 NOTES : 1. Removed +d references from the ptlink protocol code, since they do not timestamp the nicks 2. Memos sent as notification of receipt can not be cancelled. 3. Unreal3.2 supports SVSMODE -b on clearing bans 4. fixed do_kill() not remove the user from the user list 5. /os set sql [on|off] runtime sql toggle 6. Segfaults logged to the services log when DumpCore is disabled 7. fixed RUNGROUP not passed during build time 8. Exceptions now update if the limit is changed 9. Solid-IRCD support 10. Fixed TSMODE warnings when using FANTASY commands 11. Fixed read_int32 warnings (fixes compiling and running under cygwin) - Thats all..
git-svn-id: svn://svn.anope.org/anope/trunk@463 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@317 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/sessions.c')
-rw-r--r--src/sessions.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/sessions.c b/src/sessions.c
index 30edad494..939c92afb 100644
--- a/src/sessions.c
+++ b/src/sessions.c
@@ -76,7 +76,7 @@ int16 nexceptions = 0;
static Session *findsession(const char *host);
static Exception *find_host_exception(const char *host);
-static int exception_add(const char *mask, const int limit,
+static int exception_add(User * u, const char *mask, const int limit,
const char *reason, const char *who,
const time_t expires);
@@ -380,7 +380,7 @@ void load_exceptions()
int i;
int16 n;
int16 tmp16;
- int32 tmp32;
+ uint32 tmp32;
if (!
(f = open_db(s_OperServ, ExceptionDBName, "r", EXCEPTION_VERSION)))
@@ -479,16 +479,29 @@ void save_rdb_exceptions()
/************************ Exception Manipulation *************************/
/*************************************************************************/
-static int exception_add(const char *mask, const int limit,
+static int exception_add(User * u, const char *mask, const int limit,
const char *reason, const char *who,
const time_t expires)
{
int i;
/* Check if an exception already exists for this mask */
- for (i = 0; i < nexceptions; i++)
- if (stricmp(mask, exceptions[i].mask) == 0)
- return 0;
+ for (i = 0; i < nexceptions; i++) {
+ if (!stricmp(mask, exceptions[i].mask)) {
+ if (exceptions[i].limit != limit) {
+ exceptions[i].limit = limit;
+ if (u)
+ notice_lang(s_OperServ, u, OPER_EXCEPTION_CHANGED,
+ mask, exceptions[i].limit);
+ return -2;
+ } else {
+ if (u)
+ notice_lang(s_OperServ, u, OPER_EXCEPTION_EXISTS,
+ mask);
+ return -1;
+ }
+ }
+ }
nexceptions++;
exceptions = srealloc(exceptions, sizeof(Exception) * nexceptions);
@@ -626,6 +639,7 @@ int do_exception(User * u)
char *mask, *reason, *expiry, *limitstr;
int limit, expires;
int i;
+ int x;
if (!LimitSessions) {
notice_lang(s_OperServ, u, OPER_EXCEPTION_DISABLED);
@@ -679,12 +693,13 @@ int do_exception(User * u)
return MOD_CONT;
}
- if (exception_add(mask, limit, reason, u->nick, expires))
+ x = exception_add(u, mask, limit, reason, u->nick, expires);
+
+ if (x == 1) {
notice_lang(s_OperServ, u, OPER_EXCEPTION_ADDED, mask,
limit);
- else
- notice_lang(s_OperServ, u, OPER_EXCEPTION_ALREADY_PRESENT,
- mask, limit);
+ }
+
if (readonly)
notice_lang(s_OperServ, u, READ_ONLY_MODE);
}