From 6210a5bff6504303afefd10728d71c2fdf047812 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 8 Sep 2016 18:45:16 +0200 Subject: [roomplanner] Add option to enable/disable pvsmgr dedicated mode In dedicated mode, the pvsmgr will skip login/vmchooser and directly open the pvsmgr --- modules-available/roomplanner/install.inc.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'modules-available/roomplanner/install.inc.php') diff --git a/modules-available/roomplanner/install.inc.php b/modules-available/roomplanner/install.inc.php index 0a6c3729..a6d98384 100644 --- a/modules-available/roomplanner/install.inc.php +++ b/modules-available/roomplanner/install.inc.php @@ -6,19 +6,21 @@ $res = array(); $res[] = tableCreate('location_roomplan', " `locationid` INT(11) NOT NULL, `managerip` varchar(45) CHARACTER SET ascii DEFAULT '', + `dedicatedmgr` tinyint(1) NOT NULL DEFAULT 0, `tutoruuid` char(36) CHARACTER SET ascii DEFAULT NULL, `roomplan` BLOB DEFAULT NULL, PRIMARY KEY (`locationid`), - KEY `tutoruuid` (`tutoruuid`)"); + KEY `tutoruuid` (`tutoruuid`), + KEY `managerip` (`managerip`)"); if (!tableHasColumn('location_roomplan', 'managerip')) { - $ret = Database::exec("ALTER TABLE `location_roomplan` ADD COLUMN `managerip` varchar(45) CHARACTER SET ascii DEFAULT '' AFTER locationid") !== false; + $ret = Database::exec("ALTER TABLE `location_roomplan` ADD COLUMN `managerip` varchar(45) CHARACTER SET ascii DEFAULT '' AFTER locationid," + . " ADD KEY `managerip` (`managerip`)") !== false; if ($ret === false) { finalResponse(UPDATE_FAILED, 'Adding managerip to location_roomplan failed: ' . Database::lastError()); } $res[] = UPDATE_DONE; } - if (!tableHasColumn('location_roomplan', 'tutoruuid')) { $ret = Database::exec("ALTER TABLE `location_roomplan` ADD COLUMN `tutoruuid` char(36) CHARACTER SET ascii DEFAULT NULL AFTER managerip," . " ADD KEY `tutoruuid` (`tutoruuid`)") !== false; @@ -27,6 +29,13 @@ if (!tableHasColumn('location_roomplan', 'tutoruuid')) { } $res[] = UPDATE_DONE; } +if (!tableHasColumn('location_roomplan', 'dedicatedmgr')) { + $ret = Database::exec("ALTER TABLE `location_roomplan` ADD `dedicatedmgr` tinyint(1) NOT NULL DEFAULT 0 AFTER `managerip`") !== false; + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding dedicatedmgr to location_roomplan failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} if (in_array(UPDATE_DONE, $res)) { Database::exec("ALTER TABLE `location_roomplan` -- cgit v1.2.3-55-g7522