From 8571d302ea298024611fddb23d1f5def18ef6837 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 20 Mar 2018 09:11:46 +0100 Subject: [usb-lock-off] corrected some of the language --- modules-available/usblockoff/lang/de/messages.json | 2 +- modules-available/usblockoff/lang/de/rule.json | 2 +- .../usblockoff/lang/de/template-tags.json | 14 +++++++------- modules-available/usblockoff/lang/en/messages.json | 4 ++-- modules-available/usblockoff/lang/en/rule.json | 4 ++-- .../usblockoff/lang/en/template-tags.json | 20 ++++++++++---------- 6 files changed, 23 insertions(+), 23 deletions(-) (limited to 'modules-available') diff --git a/modules-available/usblockoff/lang/de/messages.json b/modules-available/usblockoff/lang/de/messages.json index fa78c288..ae926304 100644 --- a/modules-available/usblockoff/lang/de/messages.json +++ b/modules-available/usblockoff/lang/de/messages.json @@ -2,5 +2,5 @@ "config-deleted": "Konfiguration erfolgreich gelöscht.", "config-saved": "Konfiguration erfolgreich gespeichert.", "rule-deleted": "Regel erfolgreich gelöscht.", - "invalid-rule-id": "Ungültige regel ID." + "invalid-rule-id": "Ungültige Regel ID." } \ No newline at end of file diff --git a/modules-available/usblockoff/lang/de/rule.json b/modules-available/usblockoff/lang/de/rule.json index 0af86c37..394c44fe 100644 --- a/modules-available/usblockoff/lang/de/rule.json +++ b/modules-available/usblockoff/lang/de/rule.json @@ -9,7 +9,7 @@ "hash": "Hashwert", "hash_helptext": "Hashwert des USB-Geräts. Von USBGuard mittels sodium oder gcrypt berechnet.", "parent-hash": "Parent-Hashwert", - "parent-hash_helptext": "Hashwert des Client an dem das USB-Gerät angeschlossen wurde.", + "parent-hash_helptext": "Hashwert des Clients an dem das USB-Gerät angeschlossen wurde.", "via-port": "Erlaubte Ports", "via-port_helptext": "USB-Port(s), an welche das USB-Gerät angeschlossen werden kann.", "with-interface": "Interfaces", diff --git a/modules-available/usblockoff/lang/de/template-tags.json b/modules-available/usblockoff/lang/de/template-tags.json index 16466922..096bdd19 100644 --- a/modules-available/usblockoff/lang/de/template-tags.json +++ b/modules-available/usblockoff/lang/de/template-tags.json @@ -4,20 +4,20 @@ "lang_devices": "USB Geräte", "lang_general": "Allgemein", "lang_config": "Konfiguration", - "lang_config_helptext": "Erstelle eine neue Konfiguration oder wähle eine aus, um sie zu Laden und Bearbeiten zu können", + "lang_config_helptext": "Erstelle eine neue Konfiguration oder wähle eine aus, um sie laden und bearbeiten zu können.", "lang_configName": "Konfigurationsname", "lang_configName_helptext": "Name der Konfiguration", - "lang_deleteConfig": "Konfiguration Löschen", - "lang_deleteConfig_helptext": "Löscht die Konfiguration aus der Datenbank", + "lang_deleteConfig": "Konfiguration löschen", + "lang_deleteConfig_helptext": "Löscht die Konfiguration.", "lang_createNewConfig": "", - "lang_deleteConfigMessage": "Sind sie sicher, dass sie die Konfiguration Löschen wollen?", + "lang_deleteConfigMessage": "Sind Sie sicher, dass Sie die Konfiguration löschen wollen?", "lang_genericRule": "Generische Regel", "lang_generalOptions": "Allgemeine Optionen", "lang_modeOptions": "Modus Optionen", "lang_deviceClasses": "Geräteklassen", "lang_classes-helptext": "", "lang_contains": "Beinhält Interface", - "lang_contains-helptext": "Erlaubt das Gerät selbst wenn es noch zusätzliche Interfaces hat", + "lang_contains-helptext": "Erlaubt das Gerät selbst wenn es noch zusätzliche Interfaces hat.", "lang_mass-storage": "Massenspeichergeräte", "lang_hid": "Eingabegeräte", "lang_hub": "USB Hubs", @@ -38,8 +38,8 @@ "lang_none-of": "Keins von", "lang_equals": "Gleicht", "lang_equals-ordered": "Gleicht geordnet", - "lang_saveAsNewConfig": "Als neue Konfiguration Speichern", - "lang_saveAsNewConfig-helptext": "Erstellt eine neue Konfiguration anstatt die alte zu Überschreiben.", + "lang_saveAsNewConfig": "Als neue Konfiguration speichern", + "lang_saveAsNewConfig-helptext": "Erstellt eine neue Konfiguration statt die alte zu Überschreiben.", "lang_add-generic-rule": "Generische Regel hinzufügen", "lang_device-list": "Geräte Liste", "lang_rulesConfig": "Regel Konfiguration", diff --git a/modules-available/usblockoff/lang/en/messages.json b/modules-available/usblockoff/lang/en/messages.json index 500e5e7e..6873e284 100644 --- a/modules-available/usblockoff/lang/en/messages.json +++ b/modules-available/usblockoff/lang/en/messages.json @@ -1,6 +1,6 @@ { - "config-deleted": "Config successfully deleted.", - "config-saved": "Config successfully saved.", + "config-deleted": "Configuration successfully deleted.", + "config-saved": "Configuration successfully saved.", "rule-deleted": "Rule successfully deleted.", "invalid-rule-id": "Invalid rule ID." } \ No newline at end of file diff --git a/modules-available/usblockoff/lang/en/rule.json b/modules-available/usblockoff/lang/en/rule.json index d2e7b8ca..46c8bf08 100644 --- a/modules-available/usblockoff/lang/en/rule.json +++ b/modules-available/usblockoff/lang/en/rule.json @@ -9,11 +9,11 @@ "hash": "Hash value", "hash_helptext": "Hash value of the USB-device. Calculated via USBGuard through sodium or gcrypt.", "parent-hash": "Parent-hash value", - "parent-hash_helptext": "Hash value of the Client the USB-device was connected.", + "parent-hash_helptext": "Hash value of the Client the USB-device was connected to.", "via-port": "Via port", "via-port_helptext": "Accepted USB-port(s) for the USB-device.", "with-interface": "Interfaces", "with-interface_helptext": "Interfaces of the USB-device.", - "interface-policy": "interface-policy", + "interface-policy": "interface policy", "interface-policy_helptext": "Per-interface authorisation." } diff --git a/modules-available/usblockoff/lang/en/template-tags.json b/modules-available/usblockoff/lang/en/template-tags.json index bfa52caf..99764776 100644 --- a/modules-available/usblockoff/lang/en/template-tags.json +++ b/modules-available/usblockoff/lang/en/template-tags.json @@ -1,23 +1,23 @@ { "lang_howToRuleLang": "Usage of the Rule Language.", - "lang_device": "usb device", - "lang_devices": "usb devices", + "lang_device": "USB device", + "lang_devices": "USB devices", "lang_general": "General", "lang_config": "Configuration", "lang_config_helptext": "Create a new configuration or choose one to load and edit it", "lang_configName": "Configuration name", "lang_configName_helptext": "The name of the configuration", "lang_deleteConfig": "Delete configuration", - "lang_deleteConfig_helptext": "Delets the configuration", - "lang_createNewConfig": "", + "lang_deleteConfig_helptext": "Delets the configuration.", + "lang_createNewConfig": "", "lang_deleteConfigMessage": "Are you sure you want to delete the configuration?", - "lang_genericRule": "generic rule", + "lang_genericRule": "Generic rule", "lang_generalOptions": "General options", "lang_modeOptions": "Mode options", "lang_deviceClasses": "Device classes", "lang_classes-helptext": "", "lang_contains": "Contains interface", - "lang_contains-helptext": "If true the device is allowed if it contains the interface among others", + "lang_contains-helptext": "If true the device is allowed even if it contains additional interfaces.", "lang_mass-storage": "Mass storage devices", "lang_hid": "Human interface devices", "lang_hub": "USB Hubs", @@ -38,12 +38,12 @@ "lang_none-of": "None of", "lang_equals": "Equals", "lang_equals-ordered": "Equals ordered", - "lang_saveAsNewConfig": "Save as new config", - "lang_saveAsNewConfig-helptext": "If true a new config is created instead of overriding the old one", + "lang_saveAsNewConfig": "Save as new configuration", + "lang_saveAsNewConfig-helptext": "If true a new configuration is created instead of overriding the old one", "lang_add-generic-rule": "Add generic rule", "lang_device-list": "Device list", - "lang_rulesConfig": "Rules config", - "lang_daemonConfig": "Daemon config", + "lang_rulesConfig": "Rules configuration", + "lang_daemonConfig": "Daemon configuration", "lang_assignMenu": "Assign menu", "lang_serverName": "Server name", "lang_configuration": "Configuration", -- cgit v1.2.3-55-g7522 From b1b0de62a9c6e1ffa65bedb5b68c1d911a8569a9 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 20 Mar 2018 10:26:44 +0100 Subject: [usb-lock-off] config names can now be as long as they want to + fixed table widths for nicer looks --- modules-available/usblockoff/style.css | 16 ++++++++++++++++ .../usblockoff/templates/usb-configuration-table.html | 8 ++++---- .../usblockoff/templates/usb-edit-config.html | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 modules-available/usblockoff/style.css (limited to 'modules-available') diff --git a/modules-available/usblockoff/style.css b/modules-available/usblockoff/style.css new file mode 100644 index 00000000..f2dbce70 --- /dev/null +++ b/modules-available/usblockoff/style.css @@ -0,0 +1,16 @@ +#configurationTable { + table-layout: fixed; + width: 100%; +} + +#configurationTable th, #configurationTable td { + word-wrap: break-word +} + +.width40 { + width: 40%; +} + +.width10 { + width: 10%; +} \ No newline at end of file diff --git a/modules-available/usblockoff/templates/usb-configuration-table.html b/modules-available/usblockoff/templates/usb-configuration-table.html index 3ceebce5..48ba3184 100644 --- a/modules-available/usblockoff/templates/usb-configuration-table.html +++ b/modules-available/usblockoff/templates/usb-configuration-table.html @@ -65,10 +65,10 @@ - - - - + + + + diff --git a/modules-available/usblockoff/templates/usb-edit-config.html b/modules-available/usblockoff/templates/usb-edit-config.html index 694101d4..51166138 100644 --- a/modules-available/usblockoff/templates/usb-edit-config.html +++ b/modules-available/usblockoff/templates/usb-edit-config.html @@ -14,7 +14,7 @@
- +
-- cgit v1.2.3-55-g7522 From b777775f1c4d4424d393e3b1750a8ac2164cbbd1 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 20 Mar 2018 11:43:46 +0100 Subject: [usb-lock-off] disabled add buttons if configuration isn't added to db yet --- modules-available/usblockoff/lang/de/template-tags.json | 3 ++- modules-available/usblockoff/lang/en/template-tags.json | 3 ++- modules-available/usblockoff/page.inc.php | 10 +++++++++- .../usblockoff/templates/usb-rules-config.html | 14 ++++++++------ 4 files changed, 21 insertions(+), 9 deletions(-) (limited to 'modules-available') diff --git a/modules-available/usblockoff/lang/de/template-tags.json b/modules-available/usblockoff/lang/de/template-tags.json index 096bdd19..c8092cd1 100644 --- a/modules-available/usblockoff/lang/de/template-tags.json +++ b/modules-available/usblockoff/lang/de/template-tags.json @@ -47,5 +47,6 @@ "lang_assignMenu": "Zuweisungsmenü", "lang_serverName": "Servername", "lang_configuration": "Konfiguration", - "lang_usb-lock-off": "USB Lock-Off" + "lang_usb-lock-off": "USB Lock-Off", + "lang_disabledButtons_helptext": "Sie müssen zuerst die Konfiguration speichern, um Regeln hinzufügen zu können." } diff --git a/modules-available/usblockoff/lang/en/template-tags.json b/modules-available/usblockoff/lang/en/template-tags.json index 99764776..282c83a0 100644 --- a/modules-available/usblockoff/lang/en/template-tags.json +++ b/modules-available/usblockoff/lang/en/template-tags.json @@ -47,5 +47,6 @@ "lang_assignMenu": "Assign menu", "lang_serverName": "Server name", "lang_configuration": "Configuration", - "lang_usb-lock-off": "USB lock off" + "lang_usb-lock-off": "USB lock off", + "lang_disabledButtons_helptext": "You must first save the configuration to add rules." } diff --git a/modules-available/usblockoff/page.inc.php b/modules-available/usblockoff/page.inc.php index 8c32a699..4a8e4a80 100644 --- a/modules-available/usblockoff/page.inc.php +++ b/modules-available/usblockoff/page.inc.php @@ -340,9 +340,17 @@ class Page_usblockoff extends Page $rulesArray[] = $rule; } } + + if ($configid == "new-default") { + $newConfig = true; + } else { + $newConfig = false; + } + return Render::parse('usb-rules-config', array( 'rules' => (array)$rulesArray, - 'configid' => $configid + 'configid' => $configid, + 'newConfig' => $newConfig )); } diff --git a/modules-available/usblockoff/templates/usb-rules-config.html b/modules-available/usblockoff/templates/usb-rules-config.html index 15c7a2f7..60f786c0 100644 --- a/modules-available/usblockoff/templates/usb-rules-config.html +++ b/modules-available/usblockoff/templates/usb-rules-config.html @@ -48,14 +48,16 @@
{{lang_serverName}}{{lang_ruleInfoTODO}}{{lang_edit}}{{lang_delete}}{{lang_serverName}}{{lang_ruleInfoTODO}}{{lang_edit}}{{lang_delete}}
-- cgit v1.2.3-55-g7522 From aceaace91430d14e615cfaa838a2ec7b22adeb94 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 20 Mar 2018 11:58:45 +0100 Subject: [usb-lock-off] added id-column to config-table --- modules-available/usblockoff/style.css | 8 -------- .../usblockoff/templates/usb-configuration-table.html | 10 ++++++---- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'modules-available') diff --git a/modules-available/usblockoff/style.css b/modules-available/usblockoff/style.css index f2dbce70..5867511a 100644 --- a/modules-available/usblockoff/style.css +++ b/modules-available/usblockoff/style.css @@ -5,12 +5,4 @@ #configurationTable th, #configurationTable td { word-wrap: break-word -} - -.width40 { - width: 40%; -} - -.width10 { - width: 10%; } \ No newline at end of file diff --git a/modules-available/usblockoff/templates/usb-configuration-table.html b/modules-available/usblockoff/templates/usb-configuration-table.html index 48ba3184..45d0c229 100644 --- a/modules-available/usblockoff/templates/usb-configuration-table.html +++ b/modules-available/usblockoff/templates/usb-configuration-table.html @@ -65,15 +65,17 @@ - - - - + + + + + {{#config_list}} + - - + + @@ -77,7 +77,7 @@ - + - + -- cgit v1.2.3-55-g7522
{{lang_serverName}}{{lang_ruleInfoTODO}}{{lang_edit}}{{lang_delete}}ID{{lang_configName}}{{lang_ruleInfoTODO}}{{lang_edit}}{{lang_delete}}
{{config_id}} {{config_name}} TODO: Show Rule information here -- cgit v1.2.3-55-g7522 From bfb43aa0eaf5ef581414452c4a4c2a792c94f1eb Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 20 Mar 2018 12:12:41 +0100 Subject: [usb-lock-off] tooltip that first matching rule (from top to bottom) is applied --- modules-available/usblockoff/lang/de/template-tags.json | 3 ++- modules-available/usblockoff/lang/en/template-tags.json | 3 ++- modules-available/usblockoff/templates/usb-rules-config.html | 7 ++++++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'modules-available') diff --git a/modules-available/usblockoff/lang/de/template-tags.json b/modules-available/usblockoff/lang/de/template-tags.json index c8092cd1..15a885df 100644 --- a/modules-available/usblockoff/lang/de/template-tags.json +++ b/modules-available/usblockoff/lang/de/template-tags.json @@ -48,5 +48,6 @@ "lang_serverName": "Servername", "lang_configuration": "Konfiguration", "lang_usb-lock-off": "USB Lock-Off", - "lang_disabledButtons_helptext": "Sie müssen zuerst die Konfiguration speichern, um Regeln hinzufügen zu können." + "lang_disabledButtons_helptext": "Sie müssen zuerst die Konfiguration speichern, um Regeln hinzufügen zu können.", + "lang_firstMatchingRuleCounts": "Die erste zutreffende Regel (von Oben nach Unten) wird angewendet." } diff --git a/modules-available/usblockoff/lang/en/template-tags.json b/modules-available/usblockoff/lang/en/template-tags.json index 282c83a0..78f7166f 100644 --- a/modules-available/usblockoff/lang/en/template-tags.json +++ b/modules-available/usblockoff/lang/en/template-tags.json @@ -48,5 +48,6 @@ "lang_serverName": "Server name", "lang_configuration": "Configuration", "lang_usb-lock-off": "USB lock off", - "lang_disabledButtons_helptext": "You must first save the configuration to add rules." + "lang_disabledButtons_helptext": "You must first save the configuration to add rules.", + "lang_firstMatchingRuleCounts": "First matching rule (from top to bottom) will be applied." } diff --git a/modules-available/usblockoff/templates/usb-rules-config.html b/modules-available/usblockoff/templates/usb-rules-config.html index 60f786c0..6aed254d 100644 --- a/modules-available/usblockoff/templates/usb-rules-config.html +++ b/modules-available/usblockoff/templates/usb-rules-config.html @@ -1,5 +1,10 @@
-
rules.conf
+
+ + + + rules.conf +
-- cgit v1.2.3-55-g7522 From d2862870c0ecd1e4855db1b0ec3a455fed876af1 Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 20 Mar 2018 15:35:18 +0100 Subject: [usb-lock-off] now you can add a description which is shown on the front page, edited database, added template tags, made nice red-flag for missing input name :) --- modules-available/usblockoff/install.inc.php | 7 ++++- .../usblockoff/lang/de/template-tags.json | 8 +++++- .../usblockoff/lang/en/template-tags.json | 8 +++++- modules-available/usblockoff/page.inc.php | 19 ++++++++----- modules-available/usblockoff/style.css | 5 ++++ .../templates/usb-configuration-table.html | 6 ++-- .../usblockoff/templates/usb-edit-config.html | 33 +++++++++++++++++++++- .../usblockoff/templates/usb-rules-config.html | 4 +-- 8 files changed, 74 insertions(+), 16 deletions(-) (limited to 'modules-available') diff --git a/modules-available/usblockoff/install.inc.php b/modules-available/usblockoff/install.inc.php index cf260c61..47a07573 100644 --- a/modules-available/usblockoff/install.inc.php +++ b/modules-available/usblockoff/install.inc.php @@ -16,7 +16,7 @@ $t2 = $res[] = tableCreate('usblockoff_hw_prop', ' PRIMARY KEY (`hwid`, `serial`, `prop`) '); -$res[] = tableCreate('usb_configs', ' +$t4 = $res[] = tableCreate('usb_configs', ' `configid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, `configname` VARCHAR(200) NOT NULL, `rulesconfig` VARCHAR(512), @@ -60,6 +60,11 @@ if ($t1 === UPDATE_DONE || $t2 === UPDATE_DONE) { $res[] = UPDATE_DONE; } +if ($t4 === UPDATE_NOOP) { + Database::exec("ALTER TABLE `usb_configs` + ADD `configdesc` VARCHAR(200)"); +} + if (in_array(UPDATE_DONE, $res)) { finalResponse(UPDATE_DONE, 'Table created successfully'); diff --git a/modules-available/usblockoff/lang/de/template-tags.json b/modules-available/usblockoff/lang/de/template-tags.json index 15a885df..4e623e3a 100644 --- a/modules-available/usblockoff/lang/de/template-tags.json +++ b/modules-available/usblockoff/lang/de/template-tags.json @@ -49,5 +49,11 @@ "lang_configuration": "Konfiguration", "lang_usb-lock-off": "USB Lock-Off", "lang_disabledButtons_helptext": "Sie müssen zuerst die Konfiguration speichern, um Regeln hinzufügen zu können.", - "lang_firstMatchingRuleCounts": "Die erste zutreffende Regel (von Oben nach Unten) wird angewendet." + "lang_firstMatchingRuleCounts": "Die erste zutreffende Regel (von Oben nach Unten) wird angewendet.", + "lang_description": "Beschreibung", + "lang_configurationTable": "Konfigurationstabelle", + "lang_editConfig": "Konfiguration bearbeiten", + "lang_configDesc_helptext": "Beschreibung der Konfiguration.", + "lang_attributes": "Attribute", + "lang_action": "Aktion" } diff --git a/modules-available/usblockoff/lang/en/template-tags.json b/modules-available/usblockoff/lang/en/template-tags.json index 78f7166f..1ddb6334 100644 --- a/modules-available/usblockoff/lang/en/template-tags.json +++ b/modules-available/usblockoff/lang/en/template-tags.json @@ -49,5 +49,11 @@ "lang_configuration": "Configuration", "lang_usb-lock-off": "USB lock off", "lang_disabledButtons_helptext": "You must first save the configuration to add rules.", - "lang_firstMatchingRuleCounts": "First matching rule (from top to bottom) will be applied." + "lang_firstMatchingRuleCounts": "First matching rule (from top to bottom) will be applied.", + "lang_description": "Description", + "lang_configurationTable": "Configuration Table", + "lang_editConfig": "Edit Configuration", + "lang_configDesc_helptext": "Description of the configuration.", + "lang_attributes": "Attributes", + "lang_action": "Action" } diff --git a/modules-available/usblockoff/page.inc.php b/modules-available/usblockoff/page.inc.php index 4a8e4a80..28479234 100644 --- a/modules-available/usblockoff/page.inc.php +++ b/modules-available/usblockoff/page.inc.php @@ -37,7 +37,7 @@ class Page_usblockoff extends Page $this->loadConfigChooser(); } else if ($show === "edit-config") { $configid = Request::get("configid", ""); - $configName = Database::queryFirst("SELECT configname FROM `usb_configs` WHERE configid=:id", array( + $dbquery = Database::queryFirst("SELECT configname, configdesc FROM `usb_configs` WHERE configid=:id", array( 'id' => $configid )); @@ -46,7 +46,8 @@ class Page_usblockoff extends Page Render::addTemplate('usb-edit-config', array( 'configid' => $configid, - 'configName' => $configName['configname'], + 'configName' => $dbquery['configname'], + 'configDesc' => $dbquery['configdesc'], 'rulesConfigHtml' => $rulesConfigHtml, 'daemonConfigHtml' => $daemonConfigHtml )); @@ -200,11 +201,12 @@ class Page_usblockoff extends Page protected function loadConfigChooser() { - $dbquery = Database::simpleQuery("SELECT configid, configname FROM `usb_configs`"); + $dbquery = Database::simpleQuery("SELECT configid, configname, configdesc FROM `usb_configs`"); $configs = array(); while ($dbentry = $dbquery->fetch(PDO::FETCH_ASSOC)) { $config['config_id'] = $dbentry['configid']; $config['config_name'] = $dbentry['configname']; + $config['config_desc'] = $dbentry['configdesc']; $configs[] = $config; } Render::addTemplate('usb-configuration-table', array('config_list' => array_values($configs))); @@ -254,6 +256,7 @@ class Page_usblockoff extends Page $id = Request::post('id', 0, 'int'); $configname = Request::post('configName', '', 'string'); + $configdesc = Request::post('configDesc', '', 'string'); $dbquery = Database::queryFirst("SELECT * FROM `usb_configs` WHERE configid=:id", array('id' => $id)); // Load daemon.conf from db else load default @@ -281,16 +284,18 @@ class Page_usblockoff extends Page // INSERT IN DB if ($id == '0' || $result['saveAsNewConfig']) { - $dbquery = Database::exec("INSERT INTO `usb_configs` (configname, rulesconfig, daemonconfig) VALUES (:configname, :rulesconfig, :daemonconfig)", + $dbquery = Database::exec("INSERT INTO `usb_configs` (configname, rulesconfig, daemonconfig, configdesc) VALUES (:configname, :rulesconfig, :daemonconfig, :configdesc)", array('configname' => $configname, 'rulesconfig' => json_encode($result['rules']), - 'daemonconfig' => implode($newDaemonConf))); + 'daemonconfig' => implode($newDaemonConf), + 'configdesc' => $configdesc)); } else { - $dbquery = Database::exec("UPDATE `usb_configs` SET configname=:configname, rulesconfig=:rulesconfig, daemonconfig=:daemonconfig WHERE configid=:configid", + $dbquery = Database::exec("UPDATE `usb_configs` SET configname=:configname, rulesconfig=:rulesconfig, daemonconfig=:daemonconfig, configdesc=:configdesc WHERE configid=:configid", array('configid' => $id, 'configname' => $configname, 'rulesconfig' => json_encode($result['rules']), - 'daemonconfig' => implode($newDaemonConf))); + 'daemonconfig' => implode($newDaemonConf), + 'configdesc' => $configdesc)); } Message::addSuccess('config-saved'); } diff --git a/modules-available/usblockoff/style.css b/modules-available/usblockoff/style.css index 5867511a..b54b2d88 100644 --- a/modules-available/usblockoff/style.css +++ b/modules-available/usblockoff/style.css @@ -5,4 +5,9 @@ #configurationTable th, #configurationTable td { word-wrap: break-word +} + +.missingInput { + border-color: rgba(255, 0, 0, 0.8); + box-shadow: 0 1px 1px rgba(255, 0, 0, 0.075) inset, 0 0 8px rgba(255, 0, 0, 0.6); } \ No newline at end of file diff --git a/modules-available/usblockoff/templates/usb-configuration-table.html b/modules-available/usblockoff/templates/usb-configuration-table.html index 45d0c229..35eede5a 100644 --- a/modules-available/usblockoff/templates/usb-configuration-table.html +++ b/modules-available/usblockoff/templates/usb-configuration-table.html @@ -66,8 +66,8 @@
ID{{lang_configName}}{{lang_ruleInfoTODO}}{{lang_configName}}{{lang_description}} {{lang_edit}} {{lang_delete}}
{{config_id}} {{config_name}}TODO: Show Rule information here{{config_desc}} diff --git a/modules-available/usblockoff/templates/usb-edit-config.html b/modules-available/usblockoff/templates/usb-edit-config.html index 51166138..1cd24ce7 100644 --- a/modules-available/usblockoff/templates/usb-edit-config.html +++ b/modules-available/usblockoff/templates/usb-edit-config.html @@ -14,7 +14,7 @@
- +
+
+
+
+ +
+
+ +
+
+ + + +
+
@@ -54,3 +68,20 @@ + + + + + + diff --git a/modules-available/usblockoff/templates/usb-rules-config.html b/modules-available/usblockoff/templates/usb-rules-config.html index 6aed254d..8cb63d88 100644 --- a/modules-available/usblockoff/templates/usb-rules-config.html +++ b/modules-available/usblockoff/templates/usb-rules-config.html @@ -1,9 +1,9 @@
+ rules.conf - rules.conf
@@ -14,7 +14,7 @@
{{lang_target}}{{lang_action}} {{lang_attributes}} {{lang_edit}} {{lang_delete}}