Add per-user history logging toggle. Uncheck to disable history logging for specific user.

On SSL cert bypass check that the method is available before allowing.
This commit is contained in:
Tim 2015-08-13 23:05:09 +02:00
parent b0ded77571
commit 0877a6bf21
6 changed files with 61 additions and 15 deletions

View file

@ -386,7 +386,8 @@ def dbcheck():
'CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, '
'user_id INTEGER DEFAULT NULL UNIQUE, username TEXT NOT NULL UNIQUE, '
'friendly_name TEXT, thumb TEXT, email TEXT, is_home_user INTEGER DEFAULT NULL, '
'is_allow_sync INTEGER DEFAULT NULL, is_restricted INTEGER DEFAULT NULL, do_notify INTEGER DEFAULT 1)'
'is_allow_sync INTEGER DEFAULT NULL, is_restricted INTEGER DEFAULT NULL, do_notify INTEGER DEFAULT 1, '
'keep_history INTEGER DEFAULT 1)'
)
# Upgrade sessions table from earlier versions
@ -540,6 +541,15 @@ def dbcheck():
'ALTER TABLE users ADD COLUMN do_notify INTEGER DEFAULT 1'
)
# Upgrade sessions table from earlier versions
try:
c_db.execute('SELECT keep_history from users')
except sqlite3.OperationalError:
logger.debug(u"Altering database. Updating database table sessions.")
c_db.execute(
'ALTER TABLE users ADD COLUMN keep_history INTEGER DEFAULT 1'
)
conn_db.commit()
c_db.close()