diff options
author | Simon Rettberg | 2013-11-16 15:42:16 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-11-16 15:42:16 +0100 |
commit | 633e43127c6d1a96d47587eed2739bdaff6c3d4f (patch) | |
tree | afe22b5cef77a5a054388d05f6a2c106dcb4d60b /modules/main.inc.php | |
parent | Add custom config.tgz upload functionality (diff) | |
download | slx-admin-633e43127c6d1a96d47587eed2739bdaff6c3d4f.tar.gz slx-admin-633e43127c6d1a96d47587eed2739bdaff6c3d4f.tar.xz slx-admin-633e43127c6d1a96d47587eed2739bdaff6c3d4f.zip |
Add minilinux download functionality and ipxe compilation scripts
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r-- | modules/main.inc.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/main.inc.php b/modules/main.inc.php index 007fb296..31aef55e 100644 --- a/modules/main.inc.php +++ b/modules/main.inc.php @@ -6,14 +6,20 @@ function render_module() { // Render::setTitle('abc'); - Render::openTag('h1', array('class' => 'wurst kacke')); - Render::closeTag('h1'); - if (!User::isLoggedIn()) { Render::addTemplate('page-main-guest'); return; } // Logged in here - Render::addTemplate('page-main', array('user' => User::getName())); + $ipxe = true; + $file = CONFIG_IPXE_DIR . '/last-ip'; + if (file_exists($file)) { + $last = file_get_contents($file); + exec('/bin/ip a', $ips); + foreach ($ips as $ip) { + if (preg_match("#inet $last/\d+.*scope#", $ip)) $ipxe = false; + } + } + Render::addTemplate('page-main', array('user' => User::getName(), 'ipxe' => $ipxe)); } |