diff --git a/changelog b/changelog index 4ad77e9..559785c 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,7 @@ Version 0.3.3 - 01/26/02007 * fixed bug in reinitializing of plugins (Closes: #111) * fixed broken group membership changing of webserver (Closes: #114) * fixed glitch that delayed the effect of changes made by the plugin_manager + * ignore devices without read and write permissions * completed Slovenian translation * improved German translation * added: restore network settings during startup diff --git a/plugins/encrypted_webinterface/unittests.py b/plugins/encrypted_webinterface/unittests.py index d697c84..4bf09f9 100644 --- a/plugins/encrypted_webinterface/unittests.py +++ b/plugins/encrypted_webinterface/unittests.py @@ -29,5 +29,6 @@ class unittests(WebInterfaceTestClass): url = self.url + "encrypted_webinterface" self.register_auth(url) self.cmd.go(url) - self.cmd.find("Data.Status.Plugins.encrypted_webinterface") + ## TODO: enable it, as soon as the plugin is enabled by default + #self.cmd.find("Data.Status.Plugins.encrypted_webinterface") diff --git a/plugins/language_selection/unittests.py b/plugins/language_selection/unittests.py index c3dfcfe..ed96bfd 100644 --- a/plugins/language_selection/unittests.py +++ b/plugins/language_selection/unittests.py @@ -30,7 +30,7 @@ class unittests(WebInterfaceTestClass): url = self.url + "language_selection?weblang=en" self.register_auth(url) self.cmd.go(url) - self.cmd.find('Choose an interface language') + self.cmd.find('Choose your tongue') def test_check_language_list(self): diff --git a/plugins/network/unittests.py b/plugins/network/unittests.py index b72b47f..1b9ca46 100644 --- a/plugins/network/unittests.py +++ b/plugins/network/unittests.py @@ -46,10 +46,10 @@ class unittests(WebInterfaceTestClass): self.assertEquals(4, len(orig_ip_octs)) def set_ip((ip1, ip2, ip3, ip4)): self.cmd.go(self.url + "network") - self.cmd.formvalue("set_ip", "ip1", str(ip1)) - self.cmd.formvalue("set_ip", "ip2", str(ip2)) - self.cmd.formvalue("set_ip", "ip3", str(ip3)) - self.cmd.formvalue("set_ip", "ip4", str(ip4)) + self.cmd.formvalue("network_address", "ip1", str(ip1)) + self.cmd.formvalue("network_address", "ip2", str(ip2)) + self.cmd.formvalue("network_address", "ip3", str(ip3)) + self.cmd.formvalue("network_address", "ip4", str(ip4)) self.cmd.submit() ## sleep a little bit longer than the delay necessary for ip-change time.sleep(CHANGE_IP_DELAY + 3) @@ -73,6 +73,6 @@ class unittests(WebInterfaceTestClass): self.register_auth(self.url + "network") self.cmd.go(self.url + "network" + "?redirected=1") self.cmd.notfind("problem") - self.cmd.go(self.url + "network" + "?store=1") + self.cmd.go(self.url + "network" + "?store=set_ip") self.cmd.find("invalid network address") diff --git a/plugins/user_manager/unittests.py b/plugins/user_manager/unittests.py index f4f2670..6ddf693 100644 --- a/plugins/user_manager/unittests.py +++ b/plugins/user_manager/unittests.py @@ -31,7 +31,7 @@ class unittests(WebInterfaceTestClass): def test_read_users(self): """does the 'admin' user exist?""" cur_users = self._getUsers() - self.cmd.find("Manage users") + self.cmd.find("Add new user") self.assertTrue("admin" in cur_users) diff --git a/plugins/volume_mount/unittests.py b/plugins/volume_mount/unittests.py index a0fb7ad..b345094 100644 --- a/plugins/volume_mount/unittests.py +++ b/plugins/volume_mount/unittests.py @@ -35,7 +35,7 @@ class unittests(WebInterfaceTestClass): url = self.url + "volume_mount?weblang=en&device=" + self.device_html self.register_auth(url) self.cmd.go(url) - self.cmd.find('Open volume') + self.cmd.find('Open this volume') self.cmd.find('Data.Status.Plugins.volume_mount=passive') diff --git a/plugins/volume_rename/unittests.py b/plugins/volume_rename/unittests.py index 6714066..7038b57 100644 --- a/plugins/volume_rename/unittests.py +++ b/plugins/volume_rename/unittests.py @@ -34,7 +34,7 @@ class unittests(WebInterfaceTestClass): cbox_tools.umount(self.device) ## check a language string self.cmd.go(url) - self.cmd.find('Change the name of this volume') + self.cmd.find('Change name') def test_rename(self): diff --git a/src/cryptobox/core/settings.py b/src/cryptobox/core/settings.py index 74eb212..d1dc007 100644 --- a/src/cryptobox/core/settings.py +++ b/src/cryptobox/core/settings.py @@ -51,6 +51,8 @@ class CryptoBoxSettings: config_file = self.__get_config_filename(config_file) self.log.info("loading config file: %s" % config_file) self.prefs = self.__get_preferences(config_file) + if not "PluginSettings" in self.prefs: + self.prefs["PluginSettings"] = {} self.__validate_config() self.__configure_log_handler() self.__check_unknown_preferences() diff --git a/src/cryptobox/plugins/base.py b/src/cryptobox/plugins/base.py index 01b4075..73a6c79 100644 --- a/src/cryptobox/plugins/base.py +++ b/src/cryptobox/plugins/base.py @@ -56,7 +56,23 @@ class CryptoBoxPlugin: def __init__(self, cbox, plugin_dir, site_class=None): - self.cbox = cbox + if cbox: + self.cbox = cbox + else: + ## define empty dummy class as a replacement for a cbox instance + class CBoxPrefs(dict): + plugin_conf = {} + class CBoxLogger: + def debug(self, text): + pass + info = debug + warn = debug + error = debug + class CBoxMinimal: + prefs = CBoxPrefs() + prefs["PluginSettings"] = {} + log = CBoxLogger() + self.cbox = CBoxMinimal() self.hdf = {} self.plugin_dir = plugin_dir self.hdf_prefix = "Data.Plugins.%s." % self.get_name() diff --git a/src/cryptobox/tests/test.cryptobox.py b/src/cryptobox/tests/test.cryptobox.py index 5b4c274..a05b7c5 100755 --- a/src/cryptobox/tests/test.cryptobox.py +++ b/src/cryptobox/tests/test.cryptobox.py @@ -41,9 +41,7 @@ class CryptoBoxDeviceTests(CommonTestClass): def test_allowed_devices(self): '''is_device_allowed should accept permitted devices''' - self.assertTrue(self.cb.is_device_allowed("/dev/loop")) self.assertTrue(self.cb.is_device_allowed("/dev/loop1")) - self.assertTrue(self.cb.is_device_allowed("/dev/loop/urgd")) self.assertTrue(self.cb.is_device_allowed("/dev/usb/../loop1")) @@ -52,6 +50,8 @@ class CryptoBoxDeviceTests(CommonTestClass): self.assertFalse(self.cb.is_device_allowed("/dev/hda")) self.assertFalse(self.cb.is_device_allowed("/dev/loopa/../hda")) self.assertFalse(self.cb.is_device_allowed("/")) + ## this device does not exist -> no permission check possible + self.assertFalse(self.cb.is_device_allowed("/dev/loop")) diff --git a/templates/language.hdf b/templates/language.hdf index 1a4df20..e5b0ff9 100644 --- a/templates/language.hdf +++ b/templates/language.hdf @@ -27,8 +27,8 @@ Button { AdviceMessage { VolumeIsBusy { - Title = Disk is busy - Text = This disk is currently busy. Please wait for a moment. + Title = Busy volume + Text = This volume is currently busy. Please wait for a moment. Link.Rel = / Link.Text = Show all disks }