Track the IP users connect with. Add an admin column to users table.

This commit is contained in:
Erik Johnston 2014-09-26 16:36:24 +01:00
parent 7a8307fe7c
commit 0fdf308874
9 changed files with 67 additions and 12 deletions

View file

@ -63,7 +63,7 @@ SCHEMAS = [
# Remember to update this number every time an incompatible change is made to
# database schema files, so the users will be informed on server restarts.
SCHEMA_VERSION = 4
SCHEMA_VERSION = 5
class _RollbackButIsFineException(Exception):
@ -294,6 +294,16 @@ class DataStore(RoomMemberStore, RoomStore,
defer.returnValue(self.min_token)
def insert_client_ip(self, user, access_token, ip):
return self._simple_insert(
"user_ips",
{
"user": user.to_string(),
"access_token": access_token,
"ip": ip
}
)
def snapshot_room(self, room_id, user_id, state_type=None, state_key=None):
"""Snapshot the room for an update by a user
Args: