summaryrefslogtreecommitdiffstats
path: root/modules-available/usblockoff/install.inc.php
diff options
context:
space:
mode:
authorJannik Schönartz2018-03-13 11:23:22 +0100
committerJannik Schönartz2018-03-13 11:23:22 +0100
commitea62e9679dd003c50ef04cb2ce9a361aad343f3e (patch)
tree483fb86206e3e4e73d61bc3eaae5bbf1b435baaf /modules-available/usblockoff/install.inc.php
parentMerge branch 'origin/master' into usb-lock-off (diff)
downloadslx-admin-ea62e9679dd003c50ef04cb2ce9a361aad343f3e.tar.gz
slx-admin-ea62e9679dd003c50ef04cb2ce9a361aad343f3e.tar.xz
slx-admin-ea62e9679dd003c50ef04cb2ce9a361aad343f3e.zip
[usb-lock-off] Big rework. Moved from client side (modal) stuff to server side (new page) system. Removed the rules.conf textfield and added an UI prototype for the rules creation.
Diffstat (limited to 'modules-available/usblockoff/install.inc.php')
-rw-r--r--modules-available/usblockoff/install.inc.php36
1 files changed, 19 insertions, 17 deletions
diff --git a/modules-available/usblockoff/install.inc.php b/modules-available/usblockoff/install.inc.php
index 967771d1..cf260c61 100644
--- a/modules-available/usblockoff/install.inc.php
+++ b/modules-available/usblockoff/install.inc.php
@@ -1,47 +1,49 @@
<?php
$res = array();
-/*
-$t1 = $res[] = tableCreate('usb_devices', '
- `uid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- `id` varchar(50),
- `serial` varchar(512) NOT NULL DEFAULT 0,
- `name` varchar(1024) CHARACTER SET ascii DEFAULT NULL,
- `machineuuid` char(36) CHARACTER SET ascii DEFAULT NULL,
- `time` INT(11) NOT NULL DEFAULT 0,
- `user` varchar(8),
- `ruleInformation` varchar(1024),
- PRIMARY KEY (`uid`)
-');
-*/
$t1 = $res[] = tableCreate('usblockoff_hw', '
- `hwid` INT(10) UNSIGNED NOT NULL ,
+ `hwid` INT(10) UNSIGNED NOT NULL,
`serial` VARCHAR(128),
PRIMARY KEY (`hwid`, `serial`)
');
$t2 = $res[] = tableCreate('usblockoff_hw_prop', '
- `hwid` INT(10) UNSIGNED NOT NULL ,
+ `hwid` INT(10) UNSIGNED NOT NULL,
`serial` VARCHAR(128),
`prop` CHAR(16),
`value` VARCHAR(500),
PRIMARY KEY (`hwid`, `serial`, `prop`)
');
-// TODO: ADD CONSTRAINT
-
$res[] = tableCreate('usb_configs', '
`configid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`configname` VARCHAR(200) NOT NULL,
+ `rulesconfig` VARCHAR(512),
+ `daemonconfig` BLOB,
+ PRIMARY KEY (`configid`)
+');
+
+$t3 = $res[] = tableCreate('usb_rule_prop', '
+ `ruleid` INT(10) UNSIGNED NOT NULL,
+ `prop` CHAR(16),
+ `value` VARCHAR(500)
+');
+
+/*
+$res[] = tableCreate('usb_configs', '
+ `configid` int(10) UNSIGNED NOT NULL AUTO_INCREMENTloadAddDeviceModal,
+ `configname` VARCHAR(200) NOT NULL,
`rulesconfig` BLOB,
`daemonconfig` BLOB,
PRIMARY KEY (`configid`)
');
+*/
//$ret = Database::exec("DROP TABLE `usb_devices`");
//$ret = Database::exec("DROP TABLE `usblockoff_hw`");
//$ret = Database::exec("DROP TABLE `usblockoff_hw_prop`");
+//$ret = Database::exec("DROP TABLE `usb_configs`");
if ($t1 === UPDATE_DONE || $t2 === UPDATE_DONE) {
$ret = Database::exec('ALTER TABLE `usblockoff_hw`