void log_entry(enum log_level level, const struct irc_network *n, const struct irc_client *c, const char *data) { if (flog == NULL) return; if (level > current_log_level) return; if (level < LOG_DATA) admin_log(level, n, c, data); if (!no_log_timestamp) fprintf(flog, "[%s] ", get_date()); g_assert(strchr(data, '\n') == NULL); fprintf(flog, "%s", data); if (n) { fprintf(flog, " (%s", n->name); if (c) fprintf(flog, "/%s", c->description); fprintf(flog, ")"); } fprintf(flog, "\n"); fflush(flog); }
IpList::IpList(const std::string& ip, Wt::WContainerWidget* parent): WContainerWidget(parent) { if (!tApp->user() || !tApp->user()->has_permission(REGISTRATION_BANNER)) { return; } model_ = new IpListModel(ip, this); admin_log("List users of IP " + ip_a(ip), true); initialize(); }
IpList::IpList(const UserPtr& user, Wt::WContainerWidget* parent): WContainerWidget(parent) { if (!tApp->user() || !tApp->user()->has_permission(REGISTRATION_BANNER)) { return; } model_ = new IpListModel(user, this); admin_log("List IP of " + user_a(user.id()), true); initialize(); }