diff options
author | Simon Rettberg | 2014-05-23 20:49:02 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-05-23 20:49:02 +0200 |
commit | fe6ac16498b05d0f0c8ed7fda394273815d3d6da (patch) | |
tree | cadf5f103ef3db7ba1b40d59d85937c998aad22f /modules/ipxe.inc.php | |
parent | Server Setup page (diff) | |
download | slx-admin-fe6ac16498b05d0f0c8ed7fda394273815d3d6da.tar.gz slx-admin-fe6ac16498b05d0f0c8ed7fda394273815d3d6da.tar.xz slx-admin-fe6ac16498b05d0f0c8ed7fda394273815d3d6da.zip |
Stuff (WIP)
Diffstat (limited to 'modules/ipxe.inc.php')
-rw-r--r-- | modules/ipxe.inc.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/modules/ipxe.inc.php b/modules/ipxe.inc.php deleted file mode 100644 index d479bd15..00000000 --- a/modules/ipxe.inc.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -class Page_iPxe extends Page -{ - - protected function doPreprocess() - { - User::load(); - - if (!User::hasPermission('superadmin')) { - Message::addError('no-permission'); - Util::redirect('?do=Main'); - } - - if (isset($_POST['action'])) { - if ($_POST['action'] === 'compile') { - if (!Util::verifyToken()) { - Util::redirect('?do=Main'); - } - } - } - } - - protected function doRender() - { - $ips = array(); - $current = CONFIG_IPXE_DIR . '/last-ip'; - if (file_exists($current)) $current = file_get_contents($current); - exec('/bin/ip a', $retval); - foreach ($retval as $ip) { - if (preg_match('#inet (\d+\.\d+\.\d+\.\d+)/\d+.*scope#', $ip, $out) && $out[1] !== '127.0.0.1') { - $ips[] = array( - 'ip' => $out[1], - 'current' => ($out[1] == $current) - ); - } - } - Render::addTemplate('page-ipxe', array('ips' => $ips, 'token' => Session::get('token'))); - } -} |