From: Michael Tremer Date: Wed, 28 Jun 2023 15:52:05 +0000 (+0000) Subject: people: Drop old SIP page X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4da6c4f83f0581129414a64e7e955539ce9f75a5;p=ipfire.org.git people: Drop old SIP page Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 8ab44b31..98c73265 100644 --- a/Makefile.am +++ b/Makefile.am @@ -276,7 +276,6 @@ templates_nopaste_modulesdir = $(templates_nopastedir)/modules templates_people_DATA = \ src/templates/people/conferences.html \ src/templates/people/index.html \ - src/templates/people/sip.html \ src/templates/people/subscribed.html \ src/templates/people/unsubscribe.html \ src/templates/people/unsubscribed.html @@ -289,10 +288,8 @@ templates_people_messages_DATA = \ templates_people_messagesdir = $(templates_peopledir)/messages templates_people_modules_DATA = \ - src/templates/people/modules/channels.html \ src/templates/people/modules/password.html \ - src/templates/people/modules/password.js \ - src/templates/people/modules/registrations.html + src/templates/people/modules/password.js templates_people_modulesdir = $(templates_peopledir)/modules diff --git a/src/templates/people/modules/channels.html b/src/templates/people/modules/channels.html deleted file mode 100644 index 27592ab2..00000000 --- a/src/templates/people/modules/channels.html +++ /dev/null @@ -1,76 +0,0 @@ -{% if channels %} - -{% end %} diff --git a/src/templates/people/modules/registrations.html b/src/templates/people/modules/registrations.html deleted file mode 100644 index eddc9a9c..00000000 --- a/src/templates/people/modules/registrations.html +++ /dev/null @@ -1,25 +0,0 @@ -{% if account.sip_registrations %} -
-
-
{{ _("Active Registrations") }}
- - - - {% for reg in account.sip_registrations %} - - - - - - {% end %} - -
{{ reg.user_agent }}{{ reg.protocol }}/{{ reg.network_ip }}:{{ reg.network_port }} - {% if reg.is_reachable() and reg.latency %} - {{ "%.2f ms" % reg.latency }} - {% else %} - {{ _("N/A") }} - {% end %} -
-
-
-{% end %} diff --git a/src/templates/people/sip.html b/src/templates/people/sip.html deleted file mode 100644 index de7c0598..00000000 --- a/src/templates/people/sip.html +++ /dev/null @@ -1,48 +0,0 @@ -{% extends "../base.html" %} - -{% block title %}{{ account }} - {{ _("SIP Status") }}{% end block %} - -{% block content %} -

{{ _("SIP Status") }}

- - {% module Channels(account) %} - - {% module Registrations(account) %} - - {% if account.uses_sip_forwarding() %} -
-
-
{{ _("SIP Forwarding Enabled") }}
- -

- {{ _("All calls to %s will be forwarded to %s") % (account.sip_id, format_phone_number(account.sip_routing_address)) }} -

-
-
- {% else %} -
-
-
{{ _("SIP Credentials") }}
- -

- {{ _("Use these credentials to connect a SIP client to our SIP server") }} -

- -
-
-
-
{{ _("SIP Server") }}
-
ipfire.org
- -
{{ _("Username") }}
-
{{ account.sip_id }}
- -
{{ _("Password") }}
-
{{ account.sip_password }}
-
-
-
-
-
- {% end %} -{% end block %} diff --git a/src/web/__init__.py b/src/web/__init__.py index 2607bdee..61e9d3fd 100644 --- a/src/web/__init__.py +++ b/src/web/__init__.py @@ -75,9 +75,7 @@ class Application(tornado.web.Application): "DocsHeader" : docs.HeaderModule, # People - "Channels" : people.ChannelsModule, "Password" : people.PasswordModule, - "Registrations" : people.RegistrationsModule, # Nopaste "Code" : nopaste.CodeModule, @@ -326,7 +324,6 @@ class Application(tornado.web.Application): (r"/activate/([a-z_][a-z0-9_-]{0,31})/(\w+)", auth.ActivateHandler), (r"/conferences", people.ConferencesHandler), (r"/register", auth.RegisterHandler), - (r"/users/([a-z_][a-z0-9_-]{0,31})/sip", people.SIPHandler), # Promotional Consent Stuff (r"/subscribe", people.SubscribeHandler), diff --git a/src/web/people.py b/src/web/people.py index 305fb1b4..953490c2 100644 --- a/src/web/people.py +++ b/src/web/people.py @@ -44,26 +44,6 @@ class UnsubscribeHandler(base.BaseHandler): self.render("people/unsubscribed.html") -class SIPHandler(base.BaseHandler): - @tornado.web.authenticated - def get(self, uid): - account = self.backend.accounts.get_by_uid(uid) - if not account: - raise tornado.web.HTTPError(404, "Could not find account %s" % uid) - - # Check for permissions - if not account.can_be_managed_by(self.current_user): - raise tornado.web.HTTPError(403, "%s cannot manage %s" % (self.current_user, account)) - - self.render("people/sip.html", account=account) - - -class ChannelsModule(ui_modules.UIModule): - def render(self, account): - return self.render_string("people/modules/channels.html", - account=account, channels=account.sip_channels) - - class PasswordModule(ui_modules.UIModule): def render(self, account=None): return self.render_string("people/modules/password.html", account=account) @@ -73,8 +53,3 @@ class PasswordModule(ui_modules.UIModule): def embedded_javascript(self): return self.render_string("people/modules/password.js") - - -class RegistrationsModule(ui_modules.UIModule): - def render(self, account): - return self.render_string("people/modules/registrations.html", account=account)