#include "parse.h"
#include "modules.h"
#include "bandbi.h"
+#include "operhash.h"
static int mo_dline(struct Client *, struct Client *, int, const char **);
static int me_dline(struct Client *, struct Client *, int, const char **);
{
struct ConfItem *aconf;
char *oper_reason;
- char dlbuffer[IRCD_BUFSIZE];
- const char *current_date;
struct rb_sockaddr_storage daddr;
int t = AF_INET, ty, b;
const char *creason;
}
rb_set_time();
- current_date = smalldate();
aconf = make_conf();
aconf->status = CONF_DLINE;
+ aconf->created = rb_current_time();
aconf->host = rb_strdup(dlhost);
+ aconf->passwd = rb_strdup(reason);
+ aconf->info.oper = operhash_add(get_oper_name(source_p));
/* Look for an oper reason */
if((oper_reason = strchr(reason, '|')) != NULL)
if(tdline_time > 0)
{
- rb_snprintf(dlbuffer, sizeof(dlbuffer),
- "Temporary D-line %d min. - %s (%s)",
- (int) (tdline_time / 60), reason, current_date);
- aconf->passwd = rb_strdup(dlbuffer);
aconf->hold = rb_current_time() + tdline_time;
add_temp_dline(aconf);
}
else
{
- rb_snprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date);
- aconf->passwd = rb_strdup(dlbuffer);
add_conf_by_address(aconf->host, CONF_DLINE, NULL, NULL, aconf);
bandb_add(BANDB_DLINE, source_p, aconf->host, NULL,
reason, EmptyString(aconf->spasswd) ? NULL : aconf->spasswd, 0);
+
+ if(EmptyString(oper_reason))
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "%s added D-Line for [%s] [%s]",
+ get_oper_name(source_p), aconf->host, reason);
+ ilog(L_KLINE, "D %s 0 %s %s",
+ get_oper_name(source_p), aconf->host, reason);
+ }
+ else
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "%s added D-Line for [%s] [%s|%s]",
+ get_oper_name(source_p), aconf->host, reason, oper_reason);
+ ilog(L_KLINE, "D %s 0 %s %s|%s",
+ get_oper_name(source_p),
+ aconf->host, reason, oper_reason);
+ }
}
return 0;