]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Drop old SIP page
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Jun 2023 15:52:05 +0000 (15:52 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Jun 2023 15:52:05 +0000 (15:52 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/templates/people/modules/channels.html [deleted file]
src/templates/people/modules/registrations.html [deleted file]
src/templates/people/sip.html [deleted file]
src/web/__init__.py
src/web/people.py

index 8ab44b31a8b3b0d20ebe620319fd3e80a67e2e11..98c732655702c3ea9f222cd323c04e1f3a2f6e16 100644 (file)
@@ -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 (file)
index 27592ab..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-{% if channels %}
-       <ul class="list-group mb-3">
-               {% for chan in channels %}
-                       <li class="list-group-item">
-                               {% if chan.direction == "inbound" %}
-                                       <span class="fas fa-arrow-right text-danger"></span>
-
-                                       {% if chan.conference %}
-                                               <a href="/conferences#{{ chan.conference.handle }}">
-                                                       {{ _("Conference Room %s") % chan.conference.number }}
-                                               </a>
-                                       {% elif chan.application == "echo" %}
-                                               {{ _("Echo Test") }}
-
-                                       {% elif chan.application == "voicemail" %}
-                                               {{ _("Voicemail") }}
-
-                                       {% elif chan.callee %}
-                                               {% if chan.callee %}
-                                                       <a href="/users/{{ chan.callee.uid }}">{{ chan.callee }}</a>
-                                               {% else %}
-                                                       {{ chan.callee_name }}
-                                               {% end %}
-
-                                               <span class="text-muted">({{ format_phone_number(chan.callee_number) }})</span>
-
-                                       {% else %}
-                                               {{ format_phone_number(chan.called_number) }}
-                                       {% end %}
-                               {% elif chan.direction == "outbound" %}
-                                       <span class="fas fa-arrow-right text-success"></span>
-
-                                       {% if chan.caller %}
-                                               <a href="/users/{{ chan.caller.uid }}">{{ chan.caller }}</a>
-                                       {% else %}
-                                               {{ chan.caller_name }}
-                                       {% end %}
-
-                                       <span class="text-muted">({{ format_phone_number(chan.caller_number) }})</span>
-                               {% end %}
-
-                               <ul class="list-inline small mb-0">
-                                       {% if chan.state == "ACTIVE" %}
-                                               {# Don't show anything #}
-                                       {% elif chan.state == "HELD" %}
-                                               <li class="list-inline-item">
-                                                       <span class="badge bg-warning">{{ _("On Hold") }}</span>
-                                               </li>
-                                       {% elif chan.state == "RINGING" %}
-                                               <li class="list-inline-item">
-                                                       <span class="badge bg-info">{{ _("Ringing") }}</span>
-                                               </li>
-                                       {% else %}
-                                               <li class="list-inline-item">
-                                                       {{ _("Unknown State: %s") % chan.state }}
-                                               </li>
-                                       {% end %}
-
-                                       <li class="list-inline-item">
-                                               {{ format_time(chan.duration) }}
-                                       </li>
-
-                                       {% if chan.is_secure() %}
-                                               <li class="list-inline-item">
-                                                       <i class="fas fa-lock" title="{{ chan.secure }}"></i>
-                                               </li>
-                                       {% end %}
-
-                                       <li class="list-inline-item">
-                                               {{ chan.codec }}
-                                       </li>
-                               </ul>
-                       </li>
-               {% end %}
-       </ul>
-{% end %}
diff --git a/src/templates/people/modules/registrations.html b/src/templates/people/modules/registrations.html
deleted file mode 100644 (file)
index eddc9a9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-{% if account.sip_registrations %}
-       <div class="card mb-3">
-               <div class="card-body">
-                       <h6 class="card-title">{{ _("Active Registrations") }}</h6>
-
-                       <table class="table table-sm mb-0">
-                               <tbody>
-                                       {% for reg in account.sip_registrations %}
-                                               <tr>
-                                                       <td>{{ reg.user_agent }}</td>
-                                                       <td>{{ reg.protocol }}/{{ reg.network_ip }}:{{ reg.network_port }}</td>
-                                                       <td class="text-end">
-                                                               {% if reg.is_reachable() and reg.latency %}
-                                                                       {{ "%.2f ms" % reg.latency }}
-                                                               {% else %}
-                                                                       <span class="text-muted">{{ _("N/A") }}</span>
-                                                               {% end %}
-                                                       </td>
-                                               </tr>
-                                       {% end %}
-                               </tbody>
-                       </table>
-               </div>
-       </div>
-{% end %}
diff --git a/src/templates/people/sip.html b/src/templates/people/sip.html
deleted file mode 100644 (file)
index de7c059..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-{% extends "../base.html" %}
-
-{% block title %}{{ account }} - {{ _("SIP Status") }}{% end block %}
-
-{% block content %}
-       <h1>{{ _("SIP Status") }}</h1>
-
-       {% module Channels(account) %}
-
-       {% module Registrations(account) %}
-
-       {% if account.uses_sip_forwarding() %}
-               <div class="card">
-                       <div class="card-body">
-                               <h6 class="card-title">{{ _("SIP Forwarding Enabled") }}</h6>
-
-                               <p class="card-text">
-                                       {{ _("All calls to %s will be forwarded to %s") % (account.sip_id, format_phone_number(account.sip_routing_address)) }}
-                               </p>
-                       </div>
-               </div>
-       {% else %}
-               <div class="card">
-                       <div class="card-body">
-                               <h6 class="card-title">{{ _("SIP Credentials") }}</h6>
-
-                               <p>
-                                       {{ _("Use these credentials to connect a SIP client to our SIP server") }}
-                               </p>
-
-                               <div class="row justify-content-center">
-                                       <div class="col-12 col-sm-8 col-md-6">
-                                               <dl class="row mb-0">
-                                                       <dt class="col-sm-6">{{ _("SIP Server") }}</dt>
-                                                       <dd class="col-sm-6">ipfire.org</dd>
-
-                                                       <dt class="col-sm-6">{{ _("Username") }}</dt>
-                                                       <dd class="col-sm-6">{{ account.sip_id }}</dd>
-
-                                                       <dt class="col-sm-6">{{ _("Password") }}</dt>
-                                                       <dd class="col-sm-6 font-monospace text-nowrap">{{ account.sip_password }}</dd>
-                                               </dl>
-                                       </div>
-                               </div>
-                       </div>
-               </div>
-       {% end %}
-{% end block %}
index 2607bdeebe85a987cf95dab5de7e57e05deed19c..61e9d3fde4071454567d11533c34750a8064eaba 100644 (file)
@@ -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),
index 305fb1b4d21e2c405a998a95fb17161c5db4290e..953490c2307dc4ec2dd32a072d3d0793e1c8a49a 100644 (file)
@@ -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)