コード例 #1
0
ファイル: audit.py プロジェクト: vzelmanov/OpenWireless
def record_login(address, timestamp=None):
    if not timestamp:
        timestamp = datetime.utcnow()
    if last_login():
        uci.set(previous_login_ip, uci.get(last_login_ip))
        uci.set(previous_login_timestamp, uci.get(last_login_timestamp))
    uci.set(last_login_timestamp, timestamp.strftime('%Y-%m-%dT%H:%M:%S'))
    uci.set(last_login_ip, address)

    uci.commit("openwireless")
コード例 #2
0
ファイル: audit.py プロジェクト: EFForg/OpenWireless
def record_login(address, timestamp = None):
    if not timestamp:
        timestamp = datetime.utcnow()
    if last_login():
        uci.set(previous_login_ip, uci.get(last_login_ip))
        uci.set(previous_login_timestamp, uci.get(last_login_timestamp))
    uci.set(last_login_timestamp, timestamp.strftime('%Y-%m-%dT%H:%M:%S'))
    uci.set(last_login_ip, address)

    uci.commit("openwireless")
コード例 #3
0
def enabled(index):
    return uci.get("wireless.@wifi-iface[%d].disabled" % index) != "1"
コード例 #4
0
ファイル: audit.py プロジェクト: vzelmanov/OpenWireless
def _get_date(key):
    date_string = uci.get(key)
    return date_string and datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S')
コード例 #5
0
ファイル: audit.py プロジェクト: vzelmanov/OpenWireless
def previous_login():
    address = uci.get(previous_login_ip)
    timestamp = _get_date(previous_login_timestamp)
    return _build_login(address, timestamp)
コード例 #6
0
ファイル: audit.py プロジェクト: vzelmanov/OpenWireless
def last_login():
    address = uci.get(last_login_ip)
    timestamp = _get_date(last_login_timestamp)
    return _build_login(address, timestamp)
コード例 #7
0
ファイル: audit.py プロジェクト: EFForg/OpenWireless
def _get_date(key):
    date_string = uci.get(key)
    return date_string and datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S')
コード例 #8
0
ファイル: audit.py プロジェクト: EFForg/OpenWireless
def previous_login():
    address = uci.get(previous_login_ip)
    timestamp = _get_date(previous_login_timestamp)
    return _build_login(address, timestamp)
コード例 #9
0
ファイル: audit.py プロジェクト: EFForg/OpenWireless
def last_login():
    address = uci.get(last_login_ip)
    timestamp = _get_date(last_login_timestamp)
    return _build_login(address, timestamp)
コード例 #10
0
def enabled(index):
    return uci.get("wireless.@wifi-iface[%d].disabled" % index) != "1"