summaryrefslogtreecommitdiffstats
path: root/modules/main.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/main.inc.php')
-rw-r--r--modules/main.inc.php14
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));
}