Just make sure redirects include http_root

This commit is contained in:
JonnyWong16 2016-05-16 18:18:30 -07:00
parent 8b58f6b861
commit 9ecabc3faf
2 changed files with 8 additions and 8 deletions

View file

@ -119,7 +119,7 @@ def check_auth(*args, **kwargs):
if not condition(): if not condition():
raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT) raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT)
else: else:
raise cherrypy.HTTPRedirect("auth/logout") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "auth/logout")
def requireAuth(*conditions): def requireAuth(*conditions):
"""A decorator that appends conditions to the auth.require config """A decorator that appends conditions to the auth.require config
@ -204,7 +204,7 @@ class AuthController(object):
@cherrypy.expose @cherrypy.expose
def index(self): def index(self):
raise cherrypy.HTTPRedirect("login") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "auth/login")
@cherrypy.expose @cherrypy.expose
def login(self, username=None, password=None, remember_me='0', admin_login='0'): def login(self, username=None, password=None, remember_me='0', admin_login='0'):
@ -257,4 +257,4 @@ class AuthController(object):
if _session and _session['user']: if _session and _session['user']:
cherrypy.request.login = None cherrypy.request.login = None
self.on_logout(_session['user'], _session['user_group']) self.on_logout(_session['user'], _session['user_group'])
raise cherrypy.HTTPRedirect("login") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "auth/login")

View file

@ -82,9 +82,9 @@ class WebInterface(object):
@requireAuth() @requireAuth()
def index(self): def index(self):
if plexpy.CONFIG.FIRST_RUN_COMPLETE: if plexpy.CONFIG.FIRST_RUN_COMPLETE:
raise cherrypy.HTTPRedirect("home") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
else: else:
raise cherrypy.HTTPRedirect("welcome") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "welcome")
##### Welcome ##### ##### Welcome #####
@ -118,7 +118,7 @@ class WebInterface(object):
# The setup wizard just refreshes the page on submit so we must redirect to home if config set. # The setup wizard just refreshes the page on submit so we must redirect to home if config set.
if plexpy.CONFIG.FIRST_RUN_COMPLETE: if plexpy.CONFIG.FIRST_RUN_COMPLETE:
plexpy.initialize_scheduler() plexpy.initialize_scheduler()
raise cherrypy.HTTPRedirect("home") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
else: else:
return serve_template(templatename="welcome.html", title="Welcome", config=config) return serve_template(templatename="welcome.html", title="Welcome", config=config)
@ -2215,7 +2215,7 @@ class WebInterface(object):
log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE) log_dir=plexpy.CONFIG.LOG_DIR, verbose=plexpy.VERBOSE)
logger.info(u"Verbose toggled, set to %s", plexpy.VERBOSE) logger.info(u"Verbose toggled, set to %s", plexpy.VERBOSE)
logger.debug(u"If you read this message, debug logging is available") logger.debug(u"If you read this message, debug logging is available")
raise cherrypy.HTTPRedirect("logs") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "logs")
@cherrypy.expose @cherrypy.expose
@requireAuth() @requireAuth()
@ -2857,7 +2857,7 @@ class WebInterface(object):
@requireAuth(member_of("admin")) @requireAuth(member_of("admin"))
def checkGithub(self): def checkGithub(self):
versioncheck.checkGithub() versioncheck.checkGithub()
raise cherrypy.HTTPRedirect("home") raise cherrypy.HTTPRedirect(plexpy.HTTP_ROOT + "home")
@cherrypy.expose @cherrypy.expose
@requireAuth(member_of("admin")) @requireAuth(member_of("admin"))