controlreply(sender, "Host added.");
triggerhook(HOOK_TRUSTS_ADDHOST, th);
- /* TODO: controlwall */
+ controlwall(NO_OPER, NL_TRUSTS, "%s TRUSTADD'ed host %s to group '%s'", controlid(sender), host, th->group->name->content);
return CMD_OK;
}
controlreply(sender, "Group added.");
triggerhook(HOOK_TRUSTS_ADDGROUP, tg);
- /* TODO: controlwall */
+ controlwall(NO_OPER, NL_TRUSTS, "%s TRUSTGROUPADD'ed '%s'", controlid(sender), tg->name->content);
return CMD_OK;
}
return CMD_ERROR;
}
+ controlreply(sender, "TODO: NOT IMPLEMENTED");
+
+ controlwall(NO_OPER, NL_TRUSTS, "%s TRUSTGROUPDEL'ed '%s'.", controlid(sender), tg->name->content);
+
triggerhook(HOOK_TRUSTS_DELGROUP, tg);
tg_delete(tg);
controlreply(sender, "Group deleted.");
- /* TODO: controlwall */
return CMD_OK;
}
trusthost *th;
uint32_t ip, mask;
nick *sender = source;
+ char *host;
if(cargc < 2)
return CMD_USAGE;
return CMD_ERROR;
}
- if(!trusts_str2cidr(cargv[1], &ip, &mask)) {
+ host = cargv[1];
+ if(!trusts_str2cidr(host, &ip, &mask)) {
controlreply(sender, "Invalid IP/mask.");
return CMD_ERROR;
}
return CMD_ERROR;
}
+ controlreply(sender, "TODO: NOT IMPLEMENTED");
+
triggerhook(HOOK_TRUSTS_DELHOST, th);
th_delete(th);
controlreply(sender, "Host deleted.");
- /* TODO: controlwall */
- return CMD_OK;
-}
+ controlwall(NO_OPER, NL_TRUSTS, "%s TRUSTDEL'ed %s from group '%s'.", controlid(sender), host, tg->name->content);
-static int modifyname(trustgroup *tg, char *name) {
- sstring *n = getsstring(name, TRUSTNAMELEN);
- if(!n)
- return 0;
-
- freesstring(tg->name);
- tg->name = n;
-
- return 1;
+ return CMD_OK;
}
static int modifycomment(trustgroup *tg, char *comment) {
trustgroup *tg;
nick *sender = source;
char *what, *to, validfields[512];
- struct trustmodification *mods = (struct trustmodification []){ MS(expires), MS(enforceident), MS(maxperuser), MS(name), MS(contact), MS(comment), MS(trustedfor) };
+ struct trustmodification *mods = (struct trustmodification []){ MS(expires), MS(enforceident), MS(maxperuser), MS(contact), MS(comment), MS(trustedfor) };
int modcount = sizeof(mods) / sizeof(struct trustmodification);
int i;
StringBuf b;
tg_update(tg);
controlreply(sender, "Group modified.");
- /* TODO: controlwall */
+ controlwall(NO_OPER, NL_TRUSTS, "%s TRUSTMODIFIED'ed group '%s' (field: %s, value: %s)", controlid(sender), tg->name->content, what, to);
+
return CMD_OK;
}