From 4a230b9a4843ade82ff12fda31b771a5a9e58977 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 6 Apr 2017 17:30:12 +0200 Subject: [statistics] Handle client screens, manage projectors --- .../statistics/hooks/config-tgz.inc.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 modules-available/statistics/hooks/config-tgz.inc.php (limited to 'modules-available/statistics/hooks') diff --git a/modules-available/statistics/hooks/config-tgz.inc.php b/modules-available/statistics/hooks/config-tgz.inc.php new file mode 100644 index 00000000..1272a94f --- /dev/null +++ b/modules-available/statistics/hooks/config-tgz.inc.php @@ -0,0 +1,32 @@ + 'projector', + 'screen' => DeviceType::SCREEN, +)); + +$content = ''; +while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + $content .= $row['hwname'] . "=beamer\n"; +} + +if (!empty($content)) { + $tmpfile = '/tmp/bwlp-' . md5($content) . '.tar'; + if (!is_file($tmpfile) || !is_readable($tmpfile) || filemtime($tmpfile) + 86400 < time()) { + if (file_exists($tmpfile)) { + unlink($tmpfile); + } + try { + $a = new PharData($tmpfile); + $a->addFromString("/opt/openslx/beamergui/beamer.conf", $content); + $file = $tmpfile; + } catch (Exception $e) { + EventLog::failure('Could not include beamer.conf in config.tgz', (string)$e); + unlink($tmpfile); + } + } elseif (is_file($tmpfile) && is_readable($tmpfile)) { + $file = $tmpfile; + } +} -- cgit v1.2.3-55-g7522