Guest access per user disabled by default

This commit is contained in:
JonnyWong16 2016-04-24 12:00:11 -07:00
parent 6b990ee78a
commit af9786f149
3 changed files with 4 additions and 4 deletions

View file

@ -522,7 +522,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents()
<label>
<input type="checkbox" id="allow_guest_access" name="allow_guest_access" value="1" ${config['allow_guest_access']}> Allow Guest Access to PlexPy
</label>
<p class="help-block">Allow shared users to login to PlexPy using their Plex.tv account.</p>
<p class="help-block">Allow shared users to login to PlexPy using their Plex.tv account. Individual user access needs to be enabled from Users > Edit Mode.</p>
</div>
<div class="padded-header">

View file

@ -447,7 +447,7 @@ def dbcheck():
'user_id INTEGER DEFAULT NULL UNIQUE, username TEXT NOT NULL, friendly_name TEXT, '
'thumb TEXT, custom_avatar_url 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, '
'keep_history INTEGER DEFAULT 1, deleted_user INTEGER DEFAULT 0, allow_guest INTEGER DEFAULT 1, '
'keep_history INTEGER DEFAULT 1, deleted_user INTEGER DEFAULT 0, allow_guest INTEGER DEFAULT 0, '
'user_token TEXT, server_token TEXT)'
)
@ -749,7 +749,7 @@ def dbcheck():
except sqlite3.OperationalError:
logger.debug(u"Altering database. Updating database table users.")
c_db.execute(
'ALTER TABLE users ADD COLUMN allow_guest INTEGER DEFAULT 1'
'ALTER TABLE users ADD COLUMN allow_guest INTEGER DEFAULT 0'
)
c_db.execute(
'ALTER TABLE users ADD COLUMN user_token TEXT'

View file

@ -45,7 +45,7 @@ def user_login(username=None, password=None):
not user_details['deleted_user'] and user_details['allow_guest']:
# The user is in the database, so try to retrieve a new server token.
# If a server token is returned, then the user is a vaild friend
# If a server token is returned, then the user is a valid friend
plex_tv = plextv.PlexTV(token=user_token)
server_token = plex_tv.get_server_token()
if server_token: