From 6567dc175853f6f5f532eeedc933cb78b0b2eb20 Mon Sep 17 00:00:00 2001 From: Nick Daly Date: Sun, 24 Nov 2013 18:29:27 -0600 Subject: [PATCH] Renamed privilegedactions to actions. --- privilegedactions.py => actions.py | 0 modules/installed/apps/apps.py | 12 ++++++------ modules/installed/services/xmpp.py | 10 +++++----- modules/installed/system/config.py | 6 +++--- tests/{privelegedactions_test.py => actions_test.py} | 0 5 files changed, 14 insertions(+), 14 deletions(-) rename privilegedactions.py => actions.py (100%) rename tests/{privelegedactions_test.py => actions_test.py} (100%) diff --git a/privilegedactions.py b/actions.py similarity index 100% rename from privilegedactions.py rename to actions.py diff --git a/modules/installed/apps/apps.py b/modules/installed/apps/apps.py index 2706110ce..537b174d2 100644 --- a/modules/installed/apps/apps.py +++ b/modules/installed/apps/apps.py @@ -3,7 +3,7 @@ from gettext import gettext as _ from modules.auth import require from plugin_mount import PagePlugin from forms import Form -from privilegedactions import privilegedaction_run +from actions import superuser_run import cfg class Apps(PagePlugin): @@ -18,7 +18,7 @@ class Apps(PagePlugin): def index(self): main = """

User Applications are web apps hosted on your %s.

- +

Eventually this box could be your photo sharing site, your instant messaging site, your social networking site, your news site. Remember web portals? We can be one of those too. @@ -57,9 +57,9 @@ some other websites business model.

opts.append(key) else: opts.append('no'+key) - privilegedaction_run("owncloud-setup", opts) + superuser_run("owncloud-setup", opts) - output, error = privilegedaction_run("owncloud-setup", ['status']) + output, error = superuser_run("owncloud-setup", ['status']) if error: raise Exception("something is wrong: " + error) for option in output.split(): @@ -67,8 +67,8 @@ some other websites business model.

main=""" """ - form = Form(title="Configuration", - action=cfg.server_dir + "/apps/owncloud", + form = Form(title="Configuration", + action=cfg.server_dir + "/apps/owncloud", name="configure_owncloud", message='') form.checkbox(_("Enable Owncloud"), name="owncloud_enable", id="owncloud_enable", checked=checkedinfo['enable']) diff --git a/modules/installed/services/xmpp.py b/modules/installed/services/xmpp.py index 8881a2bd0..e0b4b94d2 100644 --- a/modules/installed/services/xmpp.py +++ b/modules/installed/services/xmpp.py @@ -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): @@ -33,9 +33,9 @@ class xmpp(PagePlugin): opts.append(key) else: opts.append('no'+key) - privilegedaction_run("xmpp-setup", opts) + superuser_run("xmpp-setup", opts) - output, error = privilegedaction_run("xmpp-setup", ['status']) + output, error = superuser_run("xmpp-setup", ['status']) if error: raise Exception("something is wrong: " + error) for option in output.split(): @@ -46,7 +46,7 @@ class xmpp(PagePlugin): action=cfg.server_dir + "/services/xmpp", name="configure_xmpp", 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=checkedinfo['inband_enable']) form.hidden(name="submitted", value="True") form.html(_("

When enabled, anyone who can reach this server will be allowed to register an account through an XMPP client.

")) @@ -81,7 +81,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) diff --git a/modules/installed/system/config.py b/modules/installed/system/config.py index 159811f69..7d352beb9 100644 --- a/modules/installed/system/config.py +++ b/modules/installed/system/config.py @@ -9,7 +9,7 @@ from gettext import gettext as _ from filedict import FileDict from modules.auth import require from plugin_mount import PagePlugin, FormPlugin -from privilegedactions import privilegedaction_run +from actions import superuser_run import cfg from forms import Form from model import User @@ -55,7 +55,7 @@ def set_hostname(hostname): cfg.log.info("Changing hostname to '%s'" % hostname) try: - privilegedaction_run("hostname-change", hostname) + superuser_run("hostname-change", hostname) # don't persist/cache change unless it was saved successfuly sys_store = filedict_con(cfg.store_file, 'sys') sys_store['hostname'] = hostname @@ -141,7 +141,7 @@ class general(FormPlugin, PagePlugin): time_zone = time_zone.strip() if time_zone != sys_store['time_zone']: cfg.log.info("Setting timezone to %s" % time_zone) - privilegedaction_run("timezone-change", [time_zone]) + superuser_run("timezone-change", [time_zone]) sys_store['time_zone'] = time_zone return message or "Settings updated." diff --git a/tests/privelegedactions_test.py b/tests/actions_test.py similarity index 100% rename from tests/privelegedactions_test.py rename to tests/actions_test.py