/[svn]/ircd-hybrid/modules/m_kline.c
ViewVC logotype

Diff of /ircd-hybrid/modules/m_kline.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 614 by michael, Fri May 19 09:23:10 2006 UTC revision 615 by michael, Sun May 21 12:44:31 2006 UTC
# Line 82  INIT_MODULE(m_kline, "$Revision$") Line 82  INIT_MODULE(m_kline, "$Revision$")
82    mod_add_cmd(&unkline_msgtab);    mod_add_cmd(&unkline_msgtab);
83    mod_add_cmd(&dline_msgtab);    mod_add_cmd(&dline_msgtab);
84    mod_add_cmd(&undline_msgtab);    mod_add_cmd(&undline_msgtab);
85    
86    add_capability("KLN", CAP_KLN, 1);    add_capability("KLN", CAP_KLN, 1);
87    add_capability("UNKLN", CAP_UNKLN, 1);    add_capability("UNKLN", CAP_UNKLN, 1);
88  }  }
# Line 90  CLEANUP_MODULE Line 91  CLEANUP_MODULE
91  {  {
92    delete_capability("UNKLN");    delete_capability("UNKLN");
93    delete_capability("KLN");    delete_capability("KLN");
94    
95    mod_del_cmd(&undline_msgtab);    mod_del_cmd(&undline_msgtab);
96    mod_del_cmd(&dline_msgtab);    mod_del_cmd(&dline_msgtab);
97    mod_del_cmd(&unkline_msgtab);    mod_del_cmd(&unkline_msgtab);
# Line 318  apply_kline(struct Client *source_p, str Line 320  apply_kline(struct Client *source_p, str
320    
321    add_conf_by_address(CONF_KILL, aconf);    add_conf_by_address(CONF_KILL, aconf);
322    write_conf_line(source_p, conf, current_date, cur_time);    write_conf_line(source_p, conf, current_date, cur_time);
323    
324      sendto_realops_flags(UMODE_ALL, L_ALL,
325                           "%s added K-Line for [%s@%s] [%s]",
326                           get_oper_name(source_p),
327                           aconf->user, aconf->host, aconf->reason);
328      sendto_one(source_p, ":%s NOTICE %s :Added K-Line [%s@%s] to %s",
329                 MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),
330                 source_p->name, aconf->user, aconf->host, ConfigFileEntry.klinefile);
331      ilog(L_TRACE, "%s added K-Line for [%s@%s] [%s]",
332           get_oper_name(source_p), aconf->user, aconf->host, aconf->reason);
333      log_oper_action(LOG_KLINE_TYPE, source_p, "[%s@%s] [%s]\n",
334                      aconf->user, aconf->host, aconf->reason);
335    
336    /* Now, activate kline against current online clients */    /* Now, activate kline against current online clients */
337    rehashed_klines = 1;    rehashed_klines = 1;
338  }  }
# Line 332  static void Line 347  static void
347  apply_tkline(struct Client *source_p, struct ConfItem *conf,  apply_tkline(struct Client *source_p, struct ConfItem *conf,
348               int tkline_time)               int tkline_time)
349  {  {
350    struct AccessItem *aconf;    struct AccessItem *aconf = &conf->conf.AccessItem;
351    
   aconf = &conf->conf.AccessItem;  
352    aconf->hold = CurrentTime + tkline_time;    aconf->hold = CurrentTime + tkline_time;
353    add_temp_line(conf);    add_temp_line(conf);
354    
355    sendto_realops_flags(UMODE_ALL, L_ALL,    sendto_realops_flags(UMODE_ALL, L_ALL,
356                         "%s added temporary %d min. K-Line for [%s@%s] [%s]",                         "%s added temporary %d min. K-Line for [%s@%s] [%s]",
357                         get_oper_name(source_p), tkline_time/60,                         get_oper_name(source_p), tkline_time/60,
358                         aconf->user, aconf->host,                         aconf->user, aconf->host,
359                         aconf->reason);                         aconf->reason);
360    sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. K-Line [%s@%s]",    sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. K-Line [%s@%s]",
361               MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),               MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),
362               source_p->name, tkline_time/60, aconf->user, aconf->host);               source_p->name, tkline_time/60, aconf->user, aconf->host);
363    ilog(L_TRACE, "%s added temporary %d min. K-Line for [%s@%s] [%s]",    ilog(L_TRACE, "%s added temporary %d min. K-Line for [%s@%s] [%s]",
364         get_oper_name(source_p), tkline_time/60,         get_oper_name(source_p), tkline_time/60,
365         aconf->user, aconf->host, aconf->reason);         aconf->user, aconf->host, aconf->reason);
366    log_oper_action(LOG_TEMP_KLINE_TYPE, source_p, "[%s@%s] [%s]\n",    log_oper_action(LOG_TEMP_KLINE_TYPE, source_p, "[%s@%s] [%s]\n",
367                    aconf->user, aconf->host, aconf->reason);                    aconf->user, aconf->host, aconf->reason);
368    
369    rehashed_klines = 1;    rehashed_klines = 1;
370  }  }
371    
# Line 363  static void Line 379  static void
379  apply_tdline(struct Client *source_p, struct ConfItem *conf,  apply_tdline(struct Client *source_p, struct ConfItem *conf,
380               const char *current_date, int tkline_time)               const char *current_date, int tkline_time)
381  {  {
382    struct AccessItem *aconf;    struct AccessItem *aconf = &conf->conf.AccessItem;
383    
   aconf = &conf->conf.AccessItem;  
384    aconf->hold = CurrentTime + tkline_time;    aconf->hold = CurrentTime + tkline_time;
   
385    add_temp_line(conf);    add_temp_line(conf);
   sendto_realops_flags(UMODE_ALL, L_ALL,  
                        "%s added temporary %d min. D-Line for [%s] [%s]",  
                        get_oper_name(source_p), tkline_time/60,  
                        aconf->host, aconf->reason);  
386    
387      sendto_realops_flags(UMODE_ALL, L_ALL,
388                           "%s added temporary %d min. D-Line for [%s] [%s]",
389                           get_oper_name(source_p), tkline_time/60,
390                           aconf->host, aconf->reason);
391    sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. D-Line [%s]",    sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. D-Line [%s]",
392               MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),               MyConnect(source_p) ? me.name : ID_or_name(&me, source_p->from),
393               source_p->name, tkline_time/60, aconf->host);               source_p->name, tkline_time/60, aconf->host);
394    ilog(L_TRACE, "%s added temporary %d min. D-Line for [%s] [%s]",    ilog(L_TRACE, "%s added temporary %d min. D-Line for [%s] [%s]",
395         get_oper_name(source_p), tkline_time/60, aconf->host, aconf->reason);         get_oper_name(source_p), tkline_time/60, aconf->host, aconf->reason);
396    log_oper_action(LOG_TEMP_DLINE_TYPE, source_p, "[%s@%s] [%s]\n",    log_oper_action(LOG_TEMP_DLINE_TYPE, source_p, "[%s@%s] [%s]\n",
397                    aconf->user, aconf->host, aconf->reason);                    aconf->user, aconf->host, aconf->reason);
398    
399    rehashed_klines = 1;    rehashed_klines = 1;
400  }  }
401    
# Line 518  mo_dline(struct Client *client_p, struct Line 533  mo_dline(struct Client *client_p, struct
533    
534      add_conf_by_address(CONF_DLINE, aconf);      add_conf_by_address(CONF_DLINE, aconf);
535      write_conf_line(source_p, conf, current_date, cur_time);      write_conf_line(source_p, conf, current_date, cur_time);
536    
537        sendto_realops_flags(UMODE_ALL, L_ALL,
538                             "%s added D-Line for [%s] [%s]",
539                             get_oper_name(source_p), aconf->host, aconf->reason);
540        sendto_one(source_p, ":%s NOTICE %s :Added D-Line [%s] to %s",
541                   me.name, source_p->name, aconf->host, ConfigFileEntry.dlinefile);
542        ilog(L_TRACE, "%s added D-Line for [%s] [%s]",
543             get_oper_name(source_p), aconf->host, aconf->reason);
544        log_oper_action(LOG_DLINE_TYPE, source_p, "[%s] [%s]\n",
545                        aconf->host, aconf->reason);
546    }    }
547    
548    rehashed_klines = 1;    rehashed_klines = 1;
# Line 845  mo_undline(struct Client *client_p, stru Line 870  mo_undline(struct Client *client_p, stru
870      sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed",      sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed",
871                 me.name, source_p->name, cidr);                 me.name, source_p->name, cidr);
872      sendto_realops_flags(UMODE_ALL, L_ALL,      sendto_realops_flags(UMODE_ALL, L_ALL,
873                           "%s has removed the D-Line for: [%s]",                           "%s has removed the D-Line for: [%s]",
874                           get_oper_name(source_p), cidr);                           get_oper_name(source_p), cidr);
875      ilog(L_NOTICE, "%s removed D-Line for [%s]",      ilog(L_NOTICE, "%s removed D-Line for [%s]",
876           get_oper_name(source_p), cidr);           get_oper_name(source_p), cidr);
877      return;      return;

Legend:
Removed from v.614  
changed lines
  Added in v.615

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28