summaryrefslogtreecommitdiffstats
path: root/py-bin
diff options
context:
space:
mode:
authoralice <alice@immerda.ch>2012-09-21 14:38:10 +0200
committeralice <alice@immerda.ch>2012-10-19 15:20:07 +0200
commit52828ed8e4254fec8a41f67e9c9537531995d85d (patch)
tree8e95771c93f491c31d071a0448d3ba702917b4fa /py-bin
parent23ab03581259b016ada96a2f3aabdaae99a0d492 (diff)
support changing of pw of primary jid as well
Diffstat (limited to 'py-bin')
-rw-r--r--py-bin/jabberman.py1
-rw-r--r--py-bin/setup.py11
-rw-r--r--py-bin/templates/setup_main.em2
3 files changed, 7 insertions, 7 deletions
diff --git a/py-bin/jabberman.py b/py-bin/jabberman.py
index 04d4cb4..09115e5 100644
--- a/py-bin/jabberman.py
+++ b/py-bin/jabberman.py
@@ -10,6 +10,7 @@ class JabberUser:
def __init__(self, id, jid, password, web_user_id):
self.id, self.jid, self.password, self.web_user_id = id, jid, password, web_user_id
+ # FIXME: get rid of this getter
def get_jabber_id(self):
return self.jid
diff --git a/py-bin/setup.py b/py-bin/setup.py
index 8e489ec..a188a9b 100644
--- a/py-bin/setup.py
+++ b/py-bin/setup.py
@@ -8,16 +8,16 @@ class SetupMixIn:
if not user:
return
- paras = dict(user_id=str(user.email), jabber_id=str(user.get_primary_jid()))
-
+ changePrimPwUrl = self.make_url([("cmd","set_pw_form"), ("account",user.get_primary_jid())])
acc_list = map(self.__get_jid_tuple, self.jman.get_extra_account_list(user.email))
- self.render_template(req, "setup_main.em", paras, dict(account_list=acc_list))
+ self.render_template(req, "setup_main.em",
+ dict(user_id=str(user.email), jabber_id=str(user.get_primary_jid()), changePrimPwUrl=changePrimPwUrl, account_list=acc_list))
setup_main.web_callable = True
def __get_jid_tuple(self, account):
deleteUrl = self.make_url([("cmd","delete_account_ask"), ("account",account.jid)])
changePwUrl = self.make_url([("cmd","set_pw_form"), ("account",account.jid)])
- return (html_encode(account.jid), deleteUrl, changePwUrl)
+ return (str(account.jid), deleteUrl, changePwUrl)
def set_pw_form(self, req):
user = self.__authenticate(req)
@@ -89,9 +89,8 @@ class SetupMixIn:
account = req.params.get("account", "")
- raw = dict(account_urlenc = url_encode(account))
self.render_template(req, "delete_account_ask.em",
- dict(account=account, user_id=str(user.email)), raw)
+ dict(account=account, user_id=str(user.email), account_urlenc=url_encode(account)))
delete_account_ask.web_callable = True
def delete_account_process(self, req):
diff --git a/py-bin/templates/setup_main.em b/py-bin/templates/setup_main.em
index 4919255..dc41d4c 100644
--- a/py-bin/templates/setup_main.em
+++ b/py-bin/templates/setup_main.em
@@ -3,7 +3,7 @@
<p>Jabber Konten: [<a href="main.py?cmd=add_account_form">Hinzufügen</a>]</p>
<ul>
- <li><b><i>@jabber_id</i></b> (Standard)</li>
+ <li><b><i>@jabber_id</i></b> (Standard) [<a href="@changePrimPwUrl">Passwort ändern</a>]</li>
@[for jabber_id, deleteUrl, changePwUrl in account_list]
<li><i>@jabber_id</i> [<a href="@deleteUrl">Löschen</a>] [<a href="@changePwUrl">Passwort ändern</a>]</li>
@[end for]