int result, duration;
if (cargc < 3) {
- controlreply(np, "Syntax: addjupe <servername> <duration> <reason>");
- return CMD_OK;
+ return CMD_USAGE;
}
if (jupe_find(cargv[0]) != NULL) {
result = jupe_add(cargv[0], cargv[2], duration, JUPE_ACTIVE);
- if (result)
+ if (result) {
+ controlwall(NO_OPER, NL_MISC, "%s added JUPE for '%s' expiring in %s with reason %s", controlid(np), cargv[0], longtoduration(duration, 0), cargv[2]);
controlreply(np, "Done.");
- else
+ } else
controlreply(np, "Jupe could not be created.");
return CMD_OK;
jupe_t *jupe;
if (cargc < 1) {
- controlreply(np, "Syntax: activatejupe <servername>");
-
- return CMD_OK;
+ return CMD_USAGE;
}
jupe = jupe_find(cargv[0]);
jupe_activate(jupe);
+ controlwall(NO_OPER, NL_MISC, "%s reactivated JUPE for '%s'", controlid(np), cargv[0]);
controlreply(np, "Done.");
-
return CMD_OK;
}
jupe_t *jupe;
if (cargc < 1) {
- controlreply(np, "Syntax: deactivatejupe <servername>");
- return CMD_OK;
+ return CMD_USAGE;
}
jupe = jupe_find(cargv[0]);
if (jupe == NULL) {
controlreply(np, "There is no such jupe.");
-
return CMD_OK;
}
if ((jupe->ju_flags & JUPE_ACTIVE) == 0) {
controlreply(np, "This jupe is already deactivated.");
-
return CMD_OK;
}
jupe_deactivate(jupe);
+ controlwall(NO_OPER, NL_MISC, "%s deactivated JUPE for '%s'", controlid(np), cargv[0]);
controlreply(np, "Done.");
-
return CMD_OK;
}
}
controlreply(np, "--- End of JUPE list.");
-
return CMD_OK;
}
void _init(void) {
- registercontrolcmd("addjupe", 10, 3, ju_addjupe);
- registercontrolcmd("activatejupe", 10, 1, ju_activatejupe);
- registercontrolcmd("deactivatejupe", 10, 1, ju_deactivatejupe);
- registercontrolcmd("jupelist", 10, 0, ju_jupelist);
+ registercontrolhelpcmd("addjupe", NO_OPER, 3, ju_addjupe, "Usage: addjupe <servername> <duration> <reason>");
+ registercontrolhelpcmd("activatejupe", NO_OPER, 1, ju_activatejupe, "Usage: activatejupe <servername>");
+ registercontrolhelpcmd("deactivatejupe", NO_OPER, 1, ju_deactivatejupe, "Usage: deactivatejupe <servername>");
+ registercontrolhelpcmd("jupelist", NO_OPER, 0, ju_jupelist, "Usage: jupelist");
}
void _fini(void) {