diff --git a/pythonrewrite/plugins/date/date.py b/pythonrewrite/plugins/date/date.py index a44ed0d..f726d9c 100644 --- a/pythonrewrite/plugins/date/date.py +++ b/pythonrewrite/plugins/date/date.py @@ -5,6 +5,7 @@ class date(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "system" ] requestAuth = False + rank = 10 def doAction(self, store=None, year=0, month=0, day=0, hour=0, minute=0): import datetime diff --git a/pythonrewrite/plugins/date/lang/en.hdf b/pythonrewrite/plugins/date/lang/en.hdf index a9c9fb0..df00df5 100644 --- a/pythonrewrite/plugins/date/lang/en.hdf +++ b/pythonrewrite/plugins/date/lang/en.hdf @@ -1,6 +1,5 @@ Name = Change date and time Link = Set date/time -Rank = 10 Title.ConfigDate = Date and time setting diff --git a/pythonrewrite/plugins/format_fs/format_fs.py b/pythonrewrite/plugins/format_fs/format_fs.py index cd32640..d579fbb 100644 --- a/pythonrewrite/plugins/format_fs/format_fs.py +++ b/pythonrewrite/plugins/format_fs/format_fs.py @@ -4,6 +4,7 @@ class format_fs(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "volume" ] requestAuth = True + rank = 60 ## map filesystem types to the appropriate arguments for 'mkfs' fsTypes = { @@ -67,11 +68,11 @@ class format_fs(CryptoBoxPlugin.CryptoBoxPlugin): def __format_luks(self, fsType, pw, pw2): if not pw: - self.hdf["Data.Warning"] = "EmptyCryptoPassword" + self.hdf["Data.Warning"] = "EmptyPassword" self.cbox.log.warn("no crypto password was supplied for initialization of device '%s'" % self.device) return "volume_format" if pw != pw2: - self.hdf["Data.Warning"] = "DifferentCryptoPasswords" + self.hdf["Data.Warning"] = "DifferentPasswords" self.cbox.log.warn("the crypto password was not repeated correctly for initialization of device '%s'" % self.device) return "volume_format" container = self.cbox.getContainer(self.device) diff --git a/pythonrewrite/plugins/format_fs/lang/en.hdf b/pythonrewrite/plugins/format_fs/lang/en.hdf index a9c8822..fc3d7fe 100644 --- a/pythonrewrite/plugins/format_fs/lang/en.hdf +++ b/pythonrewrite/plugins/format_fs/lang/en.hdf @@ -1,6 +1,5 @@ Name = Create filesystems Link = Format -Rank = 60 Title.Format = Initializing filesystem diff --git a/pythonrewrite/plugins/format_fs/volume_format_luks.cs b/pythonrewrite/plugins/format_fs/volume_format_luks.cs index c610e71..d2ecc75 100644 --- a/pythonrewrite/plugins/format_fs/volume_format_luks.cs +++ b/pythonrewrite/plugins/format_fs/volume_format_luks.cs @@ -19,8 +19,8 @@ var:html_escape(Lang.Plugins.format_fs.Text.Yes) ?>
--
+
+
diff --git a/pythonrewrite/plugins/logs/lang/en.hdf b/pythonrewrite/plugins/logs/lang/en.hdf index 58e8d50..c81fbc4 100644 --- a/pythonrewrite/plugins/logs/lang/en.hdf +++ b/pythonrewrite/plugins/logs/lang/en.hdf @@ -1,6 +1,5 @@ Name = Show the content of the log file Link = Show log file -Rank = 90 Title.Log = CryptoBox logfiles diff --git a/pythonrewrite/plugins/logs/logs.py b/pythonrewrite/plugins/logs/logs.py index cb4d76d..683056a 100644 --- a/pythonrewrite/plugins/logs/logs.py +++ b/pythonrewrite/plugins/logs/logs.py @@ -5,6 +5,7 @@ class logs(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "system" ] requestAuth = False + rank = 90 def doAction(self): self.__prepareFormData() diff --git a/pythonrewrite/plugins/network/lang/en.hdf b/pythonrewrite/plugins/network/lang/en.hdf index 4fef621..0828755 100644 --- a/pythonrewrite/plugins/network/lang/en.hdf +++ b/pythonrewrite/plugins/network/lang/en.hdf @@ -1,6 +1,5 @@ Name = Configure network Link = Configure network -Rank = 30 Title.Network = Network settings diff --git a/pythonrewrite/plugins/network/network.py b/pythonrewrite/plugins/network/network.py index 02478b2..d6b4b30 100644 --- a/pythonrewrite/plugins/network/network.py +++ b/pythonrewrite/plugins/network/network.py @@ -10,6 +10,7 @@ class network(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "system" ] requestAuth = True + rank = 30 def doAction(self, store=None, redirected="", ip1="", ip2="", ip3="", ip4=""): ## if we were redirected, then we should display the default page diff --git a/pythonrewrite/plugins/partition/lang/en.hdf b/pythonrewrite/plugins/partition/lang/en.hdf index 07222d5..b25e841 100644 --- a/pythonrewrite/plugins/partition/lang/en.hdf +++ b/pythonrewrite/plugins/partition/lang/en.hdf @@ -1,6 +1,5 @@ Name = Disk partitioning Link = Disk partitioning -Rank = 80 Title.Partition = Disk partitions diff --git a/pythonrewrite/plugins/partition/partition.py b/pythonrewrite/plugins/partition/partition.py index 5e2ce03..a28887b 100644 --- a/pythonrewrite/plugins/partition/partition.py +++ b/pythonrewrite/plugins/partition/partition.py @@ -8,6 +8,7 @@ class partition(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "system" ] requestAuth = True + rank = 80 PartTypes = { "windows" : ["0xC", "vfat"], diff --git a/pythonrewrite/plugins/plugin-interface.txt b/pythonrewrite/plugins/plugin-interface.txt index 50cec84..7431b0e 100644 --- a/pythonrewrite/plugins/plugin-interface.txt +++ b/pythonrewrite/plugins/plugin-interface.txt @@ -29,6 +29,9 @@ Python code interface: "volume") - the class variable "requestAuth" is boolean and defines, if admin authentication is necessary for this plugin + - the class variable "rank" is an integer in the range of 0..100 - it determines the order + of plugins in listings (lower value -> higher priority) + - the class variable "enabled" is boolean and detemines the default availability of the plugin - volume plugins contain the attribute "device" (you may trust this value - a volume plugin will never get called with an invalid device) diff --git a/pythonrewrite/plugins/plugin_manager/lang/en.hdf b/pythonrewrite/plugins/plugin_manager/lang/en.hdf new file mode 100644 index 0000000..07cb05a --- /dev/null +++ b/pythonrewrite/plugins/plugin_manager/lang/en.hdf @@ -0,0 +1,15 @@ +Name = Plugin Manager +Link = Plugin Manager + +Title.PluginManager = Plugin Manager + +Button.SaveSettings = Save settings + +Text { + PluginName = Plugin + PluginRank = Priority + PluginEnabled = Enabled? + RequestsAuth = Requires admin? + VolumePlugins = Volume plugins + SystemPlugins = System plugins +} diff --git a/pythonrewrite/plugins/plugin_manager/plugin_list.cs b/pythonrewrite/plugins/plugin_manager/plugin_list.cs new file mode 100644 index 0000000..c384da1 --- /dev/null +++ b/pythonrewrite/plugins/plugin_manager/plugin_list.cs @@ -0,0 +1,64 @@ + + + + + + + + + + + +
+
+ | + | + | + |
---|---|---|---|
+ | + | checked="checked" /> | +checked="checked" /> | +
+
+ | + | + | + |
---|---|---|---|
+ | + | checked="checked" /> | +checked="checked" /> | +
+ + + +
+ + diff --git a/pythonrewrite/plugins/plugin_manager/plugin_manager.py b/pythonrewrite/plugins/plugin_manager/plugin_manager.py new file mode 100644 index 0000000..3b6a839 --- /dev/null +++ b/pythonrewrite/plugins/plugin_manager/plugin_manager.py @@ -0,0 +1,52 @@ +import CryptoBoxPlugin + + +class plugin_manager(CryptoBoxPlugin.CryptoBoxPlugin): + + pluginCapabilities = [ "system" ] + requestAuth = True + rank = 90 + + def doAction(self, store=None, **args): + import re + if store: + for key in args.keys(): + if key.endswith("_listed"): + if not re.search(u'\W',key): + self.__setConfig(key[:-7], args) + else: + self.cbox.log.info("plugin_manager: invalid plugin name (%s)" % str(key[:-7])) + try: + self.cbox.prefs.pluginConf.write() + except IOError: + self.cbox.log.warn("failed to write plugin configuration") + return "plugin_list" + + + def getStatus(self): + return "no status" + + + def __setConfig(self, name, args): + setting = {} + setting["enabled"] = False + try: + if args[name + "_enabled"]: + setting["enabled"] = True + except KeyError: + pass + setting["rank"] = "80" + try: + r = int(args[name + "_rank"]) + if r>=0 and r<=100: + setting["rank"] = r + except KeyError, ValueError: + pass + setting["requestAuth"] = False + try: + if args[name + "_auth"]: + setting["requestAuth"] = True + except KeyError, ValueError: + pass + self.cbox.prefs.pluginConf[name] = setting + diff --git a/pythonrewrite/plugins/shutdown/lang/en.hdf b/pythonrewrite/plugins/shutdown/lang/en.hdf index 0a9efe2..fc9ba52 100644 --- a/pythonrewrite/plugins/shutdown/lang/en.hdf +++ b/pythonrewrite/plugins/shutdown/lang/en.hdf @@ -1,6 +1,5 @@ Name = Shutdown or reboot the computer Link = Shutdown/Reboot -Rank = 70 Title.Shutdown = Shutdown computer diff --git a/pythonrewrite/plugins/shutdown/shutdown.py b/pythonrewrite/plugins/shutdown/shutdown.py index bd40e38..fa36879 100644 --- a/pythonrewrite/plugins/shutdown/shutdown.py +++ b/pythonrewrite/plugins/shutdown/shutdown.py @@ -6,6 +6,7 @@ class shutdown(CryptoBoxPlugin.CryptoBoxPlugin): pluginCapabilities = [ "system" ] requestAuth = False + rank = 70 def doAction(self, type=None): if not type: diff --git a/pythonrewrite/plugins/user_manager/lang/en.hdf b/pythonrewrite/plugins/user_manager/lang/en.hdf new file mode 100644 index 0000000..548b81b --- /dev/null +++ b/pythonrewrite/plugins/user_manager/lang/en.hdf @@ -0,0 +1,51 @@ +Name = User Manager +Link = User Manager + +Title { + UserManager = Manage users + AddUser = Add new user + DelUser = Remove user + ChangePassword = Change password +} + +Button { + AddUser = Add new user + DelUser = Remove + ChangePassword = Change password +} + +Text { + NewUser = Name of the new user + DelUser = User to remove + ChangePasswordUser = Change user's password +} + +SuccessMessage { + UserAdded { + Title = User added + Text = The new user was added successfully. + } + + UserRemoved { + Title = User removed + Text = The user was removed successfully. + } + + PasswordChanged { + Title = Password changed + Text = The password was changed successfully. + } +} + + +WarningMessage { + InvalidUserName { + Title = Invalid username + Text = The choosen username is invalid: only letters and digits are allowed. + } + + UserAlreadyExists { + Title = User exists + Text = The choosen username does already exist. Please choose another one. + } +} diff --git a/pythonrewrite/plugins/user_manager/user_list.cs b/pythonrewrite/plugins/user_manager/user_list.cs new file mode 100644 index 0000000..72ade6f --- /dev/null +++ b/pythonrewrite/plugins/user_manager/user_list.cs @@ -0,0 +1,80 @@ + + + + + + + + + + ++ +
+ | ++ | |
+ | ++ | |
+ | ++ | + + |
+ +
+ | ++ | |
+ | ++ | |
+ | ++ | + + |
+
+ + + + + |