mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
Merged async actions.
This commit is contained in:
commit
e23650232b
5 files changed
+70
-57
No files matched your search
@@ -4,7 +4,7 @@ from modules.auth import require
|
||||
from plugin_mount import PagePlugin, FormPlugin
|
||||
import cfg
|
||||
from forms import Form
|
||||
from privilegedactions import privilegedaction_run
|
||||
from actions import superuser_run
|
||||
from util import Message
|
||||
|
||||
class xmpp(PagePlugin):
|
||||
@@ -30,7 +30,7 @@ class configure(FormPlugin, PagePlugin):
|
||||
sidebar_right = _("<strong>Configure XMPP Server</strong>")
|
||||
|
||||
def main(self, xmpp_inband_enable=False, message=None, *args, **kwargs):
|
||||
output, error = privilegedaction_run("xmpp-setup", 'status')
|
||||
output, error = superuser_run("xmpp-setup", 'status')
|
||||
if error:
|
||||
raise Exception("something is wrong: " + error)
|
||||
if "inband_enable" in output.split():
|
||||
@@ -40,7 +40,7 @@ class configure(FormPlugin, PagePlugin):
|
||||
action=cfg.server_dir + "/services/xmpp/configure/index",
|
||||
name="configure_xmpp_form",
|
||||
message=message)
|
||||
form.checkbox(_("Allow In-Band Registration"), name="xmpp_inband_enable",
|
||||
form.checkbox(_("Allow In-Band Registration"), name="xmpp_inband_enable",
|
||||
id="xmpp_inband_enable", checked=xmpp_inband_enable)
|
||||
# hidden field is needed because checkbox doesn't post if not checked
|
||||
form.hidden(name="submitted", value="True")
|
||||
@@ -92,7 +92,7 @@ class register(FormPlugin, PagePlugin):
|
||||
if not password: msg.add = _("Must specify a password!")
|
||||
|
||||
if username and password:
|
||||
output, error = privilegedaction_run("xmpp-register", [username, password])
|
||||
output, error = superuser_run("xmpp-register", [username, password])
|
||||
if error:
|
||||
raise Exception("something is wrong: " + error)
|
||||
|
||||
|
||||
Reference in new issue
Block a user