mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +00:00
Renamed privilegedactions to actions.
This commit is contained in:
parent
8343946de9
commit
6567dc1758
@ -3,7 +3,7 @@ from gettext import gettext as _
|
|||||||
from modules.auth import require
|
from modules.auth import require
|
||||||
from plugin_mount import PagePlugin
|
from plugin_mount import PagePlugin
|
||||||
from forms import Form
|
from forms import Form
|
||||||
from privilegedactions import privilegedaction_run
|
from actions import superuser_run
|
||||||
import cfg
|
import cfg
|
||||||
|
|
||||||
class Apps(PagePlugin):
|
class Apps(PagePlugin):
|
||||||
@ -57,9 +57,9 @@ some other websites business model.</p>
|
|||||||
opts.append(key)
|
opts.append(key)
|
||||||
else:
|
else:
|
||||||
opts.append('no'+key)
|
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:
|
if error:
|
||||||
raise Exception("something is wrong: " + error)
|
raise Exception("something is wrong: " + error)
|
||||||
for option in output.split():
|
for option in output.split():
|
||||||
|
|||||||
@ -4,7 +4,7 @@ from modules.auth import require
|
|||||||
from plugin_mount import PagePlugin, FormPlugin
|
from plugin_mount import PagePlugin, FormPlugin
|
||||||
import cfg
|
import cfg
|
||||||
from forms import Form
|
from forms import Form
|
||||||
from privilegedactions import privilegedaction_run
|
from actions import superuser_run
|
||||||
from util import Message
|
from util import Message
|
||||||
|
|
||||||
class xmpp(PagePlugin):
|
class xmpp(PagePlugin):
|
||||||
@ -33,9 +33,9 @@ class xmpp(PagePlugin):
|
|||||||
opts.append(key)
|
opts.append(key)
|
||||||
else:
|
else:
|
||||||
opts.append('no'+key)
|
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:
|
if error:
|
||||||
raise Exception("something is wrong: " + error)
|
raise Exception("something is wrong: " + error)
|
||||||
for option in output.split():
|
for option in output.split():
|
||||||
@ -81,7 +81,7 @@ class register(FormPlugin, PagePlugin):
|
|||||||
if not password: msg.add = _("Must specify a password!")
|
if not password: msg.add = _("Must specify a password!")
|
||||||
|
|
||||||
if username and password:
|
if username and password:
|
||||||
output, error = privilegedaction_run("xmpp-register", [username, password])
|
output, error = superuser_run("xmpp-register", [username, password])
|
||||||
if error:
|
if error:
|
||||||
raise Exception("something is wrong: " + error)
|
raise Exception("something is wrong: " + error)
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ from gettext import gettext as _
|
|||||||
from filedict import FileDict
|
from filedict import FileDict
|
||||||
from modules.auth import require
|
from modules.auth import require
|
||||||
from plugin_mount import PagePlugin, FormPlugin
|
from plugin_mount import PagePlugin, FormPlugin
|
||||||
from privilegedactions import privilegedaction_run
|
from actions import superuser_run
|
||||||
import cfg
|
import cfg
|
||||||
from forms import Form
|
from forms import Form
|
||||||
from model import User
|
from model import User
|
||||||
@ -55,7 +55,7 @@ def set_hostname(hostname):
|
|||||||
|
|
||||||
cfg.log.info("Changing hostname to '%s'" % hostname)
|
cfg.log.info("Changing hostname to '%s'" % hostname)
|
||||||
try:
|
try:
|
||||||
privilegedaction_run("hostname-change", hostname)
|
superuser_run("hostname-change", hostname)
|
||||||
# don't persist/cache change unless it was saved successfuly
|
# don't persist/cache change unless it was saved successfuly
|
||||||
sys_store = filedict_con(cfg.store_file, 'sys')
|
sys_store = filedict_con(cfg.store_file, 'sys')
|
||||||
sys_store['hostname'] = hostname
|
sys_store['hostname'] = hostname
|
||||||
@ -141,7 +141,7 @@ class general(FormPlugin, PagePlugin):
|
|||||||
time_zone = time_zone.strip()
|
time_zone = time_zone.strip()
|
||||||
if time_zone != sys_store['time_zone']:
|
if time_zone != sys_store['time_zone']:
|
||||||
cfg.log.info("Setting timezone to %s" % 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
|
sys_store['time_zone'] = time_zone
|
||||||
return message or "Settings updated."
|
return message or "Settings updated."
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user