diff --git a/call.cgi b/call.cgi index 5b0c3f0..71da42c 100755 --- a/call.cgi +++ b/call.cgi @@ -11,6 +11,7 @@ if sys.argv[-1] == "--test": logdir="./" + logdir = "/var/log/httpd/" else: logdir = "/var/log/httpd/" @@ -30,8 +31,12 @@ if prefix != "HSJ" and 151 <= ip[3] <= 150 + 49 or\ prefix == "HSJ" and 151 <= ip[3] <= 150 + 63: return "%s-%02d" % (prefix, ip[3]-150) + if prefix != "HSJ" and 81 <= ip[3] <= 81 + 49: + return "%s-%02d" % (prefix, ip[3]-80) if 220 <= ip[3] <= 220 + 5: return "%s-K%02d" % (prefix, ip[3]-220) + if 226 <= ip[3] <= 226 + 5: + return "%s-K%02d" % (prefix, ip[3]-225) else: return ip_str fr = datetime.strptime(form["date"].value + " " + form["from"].value, "%Y/%m/%d %H:%M") @@ -69,9 +74,9 @@ action, id_ = action.split(":") id_ = id_.lower() if date < to: + date = date.strftime(datefmt) + active = True if id_ in maildb: - date = date.strftime(datefmt) - active = True candidate.append( # 0 1 2 3 4 [machine, date, "---", action, id_, @@ -79,6 +84,15 @@ maildb[id_]["no"], maildb[id_]["name"], # 7 8 maildb[id_]["reading"], maildb[id_]["dep"]]) + else: + candidate.append( + # 0 1 2 3 4 + [machine, date, "---", action, id_, + # 5 6 + "????", id_, + # 7 8 + "--", "--"]) + elif action.startswith("reject") and candidate: # exclude double-login action, id_, host = action.split(":") if id_.lower() == candidate[-1][4]: