mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-05 17:05:03 -05:00
Merge pull request #1234 from abeloin/patch-ical_auth
Fix access to webcal without password.
This commit is contained in:
commit
c62d8f2c79
@ -521,6 +521,18 @@ class WebRoot(WebHandler):
|
||||
|
||||
return t.respond()
|
||||
|
||||
|
||||
class CalendarHandler(BaseHandler):
|
||||
def get(self, *args, **kwargs):
|
||||
if sickbeard.CALENDAR_UNPROTECTED:
|
||||
self.write(self.calendar())
|
||||
else:
|
||||
self.calendar_auth()
|
||||
|
||||
@authenticated
|
||||
def calendar_auth(self):
|
||||
self.write(self.calendar())
|
||||
|
||||
# Raw iCalendar implementation by Pedro Jose Pereira Vieito (@pvieito).
|
||||
#
|
||||
# iCalendar (iCal) - Standard RFC 5545 <http://tools.ietf.org/html/rfc5546>
|
||||
|
@ -3,7 +3,7 @@ import threading
|
||||
import sys
|
||||
import sickbeard
|
||||
|
||||
from sickbeard.webserve import LoginHandler, LogoutHandler, KeyHandler
|
||||
from sickbeard.webserve import LoginHandler, LogoutHandler, KeyHandler, CalendarHandler
|
||||
from sickbeard.webapi import ApiHandler
|
||||
from sickbeard import logger
|
||||
from sickbeard.helpers import create_https_certificates, generateApiKey
|
||||
@ -93,6 +93,11 @@ class SRWebServer(threading.Thread):
|
||||
# webui handlers
|
||||
] + route.get_routes(self.options['web_root']))
|
||||
|
||||
# Web calendar handler (Needed because option Unprotected calendar)
|
||||
self.app.add_handlers('.*$', [
|
||||
(r'%s/calendar' % self.options['web_root'], CalendarHandler),
|
||||
])
|
||||
|
||||
# Static File Handlers
|
||||
self.app.add_handlers(".*$", [
|
||||
# favicon
|
||||
|
Loading…
Reference in New Issue
Block a user