From 2f51147ad78739e72df3f6a6341a2bd5c3f77070 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 17 Mar 2015 14:13:03 +0100 Subject: [PATCH] talk: Show SIP password to the user --- templates/talk/phonebook-contact.html | 8 ++++++++ webapp/backend/accounts.py | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/templates/talk/phonebook-contact.html b/templates/talk/phonebook-contact.html index cc7e047c..7318e3c6 100644 --- a/templates/talk/phonebook-contact.html +++ b/templates/talk/phonebook-contact.html @@ -37,6 +37,14 @@ {{ account.sip_url }} + + {% if current_user == account or current_user.is_admin() %} +
  • + + {{ _("Password") }}: {{ account.sip_password }} + +
  • + {% end %} {% end %} diff --git a/webapp/backend/accounts.py b/webapp/backend/accounts.py index e3b70f55..e52b1899 100644 --- a/webapp/backend/accounts.py +++ b/webapp/backend/accounts.py @@ -249,6 +249,10 @@ class Account(Object): if "sipRoutingObject" in self.classes: return self._get_first_attribute("sipLocalAddress") + @property + def sip_password(self): + return self._get_first_attribute("sipPassword") + @property def sip_url(self): return "%s@ipfire.org" % self.sip_id -- 2.47.3