always umount config partitions during shutdown - otherwise tmpfs would stay mounted
prepare the "help" dataset values for multiple reloading of the dataset clarify text for no-write-allowed keep only some specific link parameters during dis/enabling help
This commit is contained in:
parent
8519e2514d
commit
acac61fcbd
4 changed files with 22 additions and 11 deletions
|
@ -72,8 +72,8 @@ class CryptoBox:
|
|||
self.log.info("Storing local settings ...")
|
||||
## problems with storing are logged automatically
|
||||
self.prefs.write()
|
||||
if self.prefs.get_active_partition():
|
||||
self.prefs.umount_partition()
|
||||
# TODO: improve the configuration partition handling
|
||||
self.prefs.umount_partition()
|
||||
## shutdown logging as the last step
|
||||
try:
|
||||
self.log.info("Turning off logging ...")
|
||||
|
|
|
@ -76,7 +76,10 @@ class WebInterfaceDataset(dict):
|
|||
self["Settings.LinkAttrs.help"] = "1"
|
||||
except (AttributeError, KeyError):
|
||||
## no setting or first start before request
|
||||
pass
|
||||
## reset values - just in case we are called more than once
|
||||
self["Settings.Help"] = "0"
|
||||
if "Settings.LinkAttrs.help" in self:
|
||||
del self["Settings.LinkAttrs.help"]
|
||||
|
||||
try:
|
||||
self["Data.ScriptURL.Prot"] = cherrypy.request.scheme
|
||||
|
|
|
@ -92,7 +92,7 @@ WarningMessage {
|
|||
|
||||
DeviceNotWriteable {
|
||||
Title = No write permissions
|
||||
Text = Sorry - the CryptoBox is not allowed to write on this device. Anyway it is still possible, that you can open it for writing. Please ask the administrator of the CryptoBox in case you believe, that this is a mistake.
|
||||
Text = Sorry - the CryptoBox is not allowed to write on this device. Anyway it is still possible, that you can open it and change its content. Please ask the administrator of the CryptoBox in case you believe, that this is a mistake.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,12 @@ def:reload_link(attr, value) ?><?cs
|
|||
?><?cs set:attrs = ""
|
||||
?><?cs /each
|
||||
?><?cs each:attrs = Data.ScriptParams
|
||||
?><?cs set:Temp[name(attrs)] = attrs
|
||||
?><?cs # do not keep _all_ params - just the necessary ones
|
||||
otherwise it could happen, that a previous action is repeated
|
||||
accidently by reloading - or given passwords can be exposed in the url
|
||||
?><?cs if:(name(attrs) == "weblang") || (name(attrs) == "device") ||
|
||||
(name(attrs) == "help") ?><?cs
|
||||
set:Temp[name(attrs)] = attrs ?><?cs /if
|
||||
?><?cs /each
|
||||
?><?cs if:attr != "" ?><?cs set:Temp[attr] = value ?><?cs /if
|
||||
?><?cs set:first_attr = 1
|
||||
|
@ -190,18 +195,21 @@ def:reload_link(attr, value) ?><?cs
|
|||
|
||||
|
||||
def:help_link() ?><?cs
|
||||
# show an iconed link to a specific help page for the current form ?>
|
||||
# show a link for enabling or disabling the help texts ?>
|
||||
<div class="help_link">
|
||||
<?cs if:Settings.Help ?>
|
||||
<a href="<?cs call:reload_link("help","0") ?>"
|
||||
title="<?cs var:html_escape(Lang.Button.DisableHelp) ?>">
|
||||
<?cs var:html_escape(Lang.Button.DisableHelp) ?>
|
||||
<?cs else ?>
|
||||
<?cs var:html_escape(Lang.Button.DisableHelp) ?><?cs
|
||||
set:icon_file = "icon_get_help.gif" ?><?cs
|
||||
# TODO: create different icons for "enable" and "disable" ?><?cs
|
||||
else ?>
|
||||
<a href="<?cs call:reload_link("help","1") ?>"
|
||||
title="<?cs var:html_escape(Lang.Button.EnableHelp) ?>">
|
||||
<?cs var:html_escape(Lang.Button.EnableHelp) ?>
|
||||
<?cs /if ?>
|
||||
<img class="message_symbol" src="cryptobox-misc/icon_get_help.gif" alt="icon: help" />
|
||||
<?cs var:html_escape(Lang.Button.EnableHelp) ?><?cs
|
||||
set:icon_file = "icon_get_help.gif" ?><?cs
|
||||
/if ?>
|
||||
<img class="message_symbol" src="cryptobox-misc/<?cs var:icon_file ?>" alt="icon: help" />
|
||||
</a></div><?cs
|
||||
/def ?><?cs
|
||||
|
||||
|
|
Loading…
Reference in a new issue