Commit cb82c0d7 authored by Benoit Rat's avatar Benoit Rat Committed by Adam Wujek

[BUG: 1570]: www: user can only see sysinfo.php if logged-in

parent 0b552b8b
......@@ -2,5 +2,9 @@
<a href='http://www.ohwr.org/projects/wr-switch-sw' target="_blank"><IMG SRC='img/ohr.png' align=left , vspace=7, hspace=5, width=35 , hight=100 , border=0 , alt='OHR'></a>
<p>White Rabbit Project - Open Hardware and Source Project <a class="footer-link" target="_blank"
href="http://www.ohwr.org/projects/white-rabbit/wiki">White-Rabbit OHR</a>
<a href='sysinfo.php' target="_blank"><IMG SRC='img/light_php.png' align=right , vspace=7, hspace=5, width=100 , hight=100 , border=0 , alt='PHP Info'></a>
<?php
if(isset($_SESSION['myusername'])) echo "<a href='sysinfo.php' target='_blank'>";
echo "<IMG SRC='img/light_php.png' align=right , vspace=7, hspace=5, width=100 , hight=100 , border=0 , alt='PHP Info'>";
if(isset($_SESSION['myusername'])) echo "</a>";
?>
</p>
<?php
<?php
include 'functions.php';
ob_start();
if(strcmp($_SESSION['LASTIME'],filectime($GLOBALS['kconfigfile'])) &&
strcmp(basename($_SERVER['PHP_SELF']), "reboot.php")){
echo "<script>
alert('WARNING: Dotconfig has been modified. Realoading configuration...');
window.location.href='index.php';
</script>";
load_kconfig();
}
if (isset($_SESSION['LAST_ACTIVITY'])
&& (!empty($_SESSION["myusername"]))
&& (time() - $_SESSION['LAST_ACTIVITY'] > 600)) {
// last request was more than 10 minutes ago
session_unset();
session_destroy();
header('Location: index.php');
}
$_SESSION['LAST_ACTIVITY'] = time();
phpinfo();
if(isset($_SESSION['myusername']))
{
phpinfo();
}
else
{
header('Location: index.php');
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment