summaryrefslogtreecommitdiffstats
path: root/modules-available/usblockoff/install.inc.php
diff options
context:
space:
mode:
authorroot2017-11-05 06:08:37 +0100
committerroot2017-11-05 06:08:37 +0100
commit56adda043ed5f4e04c12aec2d6ebbca2372332b8 (patch)
tree0c584a7264d8435d8c2ceac4d14679fd886627e9 /modules-available/usblockoff/install.inc.php
parent[syslog] Tweak machineuuid index in installer (diff)
downloadslx-admin-56adda043ed5f4e04c12aec2d6ebbca2372332b8.tar.gz
slx-admin-56adda043ed5f4e04c12aec2d6ebbca2372332b8.tar.xz
slx-admin-56adda043ed5f4e04c12aec2d6ebbca2372332b8.zip
Initial commit
Diffstat (limited to 'modules-available/usblockoff/install.inc.php')
-rw-r--r--modules-available/usblockoff/install.inc.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/modules-available/usblockoff/install.inc.php b/modules-available/usblockoff/install.inc.php
new file mode 100644
index 00000000..690f45d4
--- /dev/null
+++ b/modules-available/usblockoff/install.inc.php
@@ -0,0 +1,31 @@
+<?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`)
+');
+
+$t2 = $res[] = tableCreate('usb_configs', '
+ `configid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `configname` VARCHAR(200) NOT NULL,
+ `rulesconfig` BLOB,
+ `daemonconfig` BLOB,
+ PRIMARY KEY (`configid`)
+');
+
+//$ret = Database::exec("DROP TABLE `usb_devices`");
+
+if (in_array(UPDATE_DONE, $res)) {
+ finalResponse(UPDATE_DONE, 'Table created successfully');
+}
+
+finalResponse(UPDATE_NOOP, 'Everything already up to date');