summaryrefslogtreecommitdiffstats
path: root/modules-available/runmode/install.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-08-10 15:56:58 +0200
committerSimon Rettberg2017-08-10 15:56:58 +0200
commit9abacc2da789048a83953da5622a6e588bb432a4 (patch)
treeee3b98760bc5b23b64a722fb92d7cbbce3fb7beb /modules-available/runmode/install.inc.php
parent[baseconfig] PHP 7 compat (diff)
downloadslx-admin-9abacc2da789048a83953da5622a6e588bb432a4.tar.gz
slx-admin-9abacc2da789048a83953da5622a6e588bb432a4.tar.xz
slx-admin-9abacc2da789048a83953da5622a6e588bb432a4.zip
[runmode] Add isclient property per client, implement overview page
Diffstat (limited to 'modules-available/runmode/install.inc.php')
-rw-r--r--modules-available/runmode/install.inc.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules-available/runmode/install.inc.php b/modules-available/runmode/install.inc.php
index 962a0cc9..e2b1ed0f 100644
--- a/modules-available/runmode/install.inc.php
+++ b/modules-available/runmode/install.inc.php
@@ -2,14 +2,15 @@
$res = array();
-$res[] = tableCreate('runmode', '
+$res[] = tableCreate('runmode', "
`machineuuid` char(36) CHARACTER SET ascii NOT NULL,
`module` varchar(30) CHARACTER SET ascii NOT NULL,
`modeid` varchar(60) CHARACTER SET ascii NOT NULL,
`modedata` blob DEFAULT NULL,
+ `isclient` bool DEFAULT '1',
PRIMARY KEY (`machineuuid`),
KEY `module` (`module`,`modeid`)
-');
+");
if (!tableExists('machine')) {
// Cannot add constraint yet
@@ -27,6 +28,15 @@ if (!tableExists('machine')) {
}
}
+if (!tableHasColumn('runmode', 'isclient')) {
+ $ret = Database::exec("ALTER TABLE runmode ADD COLUMN isclient bool DEFAULT '1'");
+ if ($ret === false) {
+ finalResponse(UPDATE_FAILED, 'Could not add lastchange field');
+ } elseif ($ret > 0) {
+ $ret[] = UPDATE_DONE;
+ }
+}
+
// Create response for browser
if (in_array(UPDATE_DONE, $res)) {