Esempio n. 1
0
static int exception_view(User * u, const int index, int *sent_header)
{
    char timebuf[32], expirebuf[256];
    struct tm tm;
    time_t t = time(NULL);

    if (index < 0 || index >= nexceptions)
        return 0;
    if (!*sent_header) {
        notice_lang(s_OperServ, u, OPER_EXCEPTION_LIST_HEADER);
        *sent_header = 1;
    }

    tm = *localtime(exceptions[index].time ? &exceptions[index].time : &t);
    strftime_lang(timebuf, sizeof(timebuf),
                  u, STRFTIME_SHORT_DATE_FORMAT, &tm);

    expire_left(u->na, expirebuf, sizeof(expirebuf),
                exceptions[index].expires);

    notice_lang(s_OperServ, u, OPER_EXCEPTION_VIEW_FORMAT,
                index + 1, exceptions[index].mask,
                *exceptions[index].who ?
                exceptions[index].who : "<unknown>",
                timebuf, expirebuf, exceptions[index].limit,
                exceptions[index].reason);
    return 1;
}
Esempio n. 2
0
static int akill_view(int number, Akill * ak, User * u, int *sent_header, ChannelInfo *ci) {
	char mask[BUFSIZE];
	char timebuf[32], expirebuf[256];
	struct tm tm;

	if (!ak)
	return 0;

	if (!*sent_header) {
		notice_lang(ci->bi->nick, u, OPER_AKILL_VIEW_HEADER);
		*sent_header = 1;
	}

	snprintf(mask, sizeof(mask), "%s@%s", ak->user, ak->host);
	tm = *localtime(&ak->seton);
	strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT, &tm);
	expire_left(u->na, expirebuf, sizeof(expirebuf), ak->expires);
	notice_lang(ci->bi->nick, u, OPER_AKILL_VIEW_FORMAT, number, mask, ak->by, timebuf, expirebuf, ak->reason);

	return 1;
}
Esempio n. 3
0
int sgline_view(int number, SXLine * sx, User * u, int *sent_header)
{
    char timebuf[32], expirebuf[256];
    struct tm tm;

    if (!sx)
        return 0;

    if (!*sent_header) {
        notice_lang(s_OperServ, u, OPER_SGLINE_VIEW_HEADER);
        *sent_header = 1;
    }

    tm = *localtime(&sx->seton);
    strftime_lang(timebuf, sizeof(timebuf), u, STRFTIME_SHORT_DATE_FORMAT,
                  &tm);
    expire_left(u->na, expirebuf, sizeof(expirebuf), sx->expires);
    notice_lang(s_OperServ, u, OPER_SGLINE_VIEW_FORMAT, number, sx->mask,
                sx->by, timebuf, expirebuf, sx->reason);

    return 1;
}