| 
									
										
										
										
											2009-09-07 11:07:59 +00:00
										 |  |  | <?php | 
					
						
							| 
									
										
										
										
											2010-01-08 23:47:54 +00:00
										 |  |  |   ob_start(); | 
					
						
							|  |  |  |    | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |   ini_set('allow_url_fopen', 0); | 
					
						
							| 
									
										
										
										
											2007-11-23 11:37:28 +00:00
										 |  |  |   ini_set('display_errors', 0); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-11 18:20:32 +00:00
										 |  |  | #$debug=1;
 | 
					
						
							| 
									
										
										
										
											2009-10-02 13:20:24 +00:00
										 |  |  | if($debug) { | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |   ini_set('display_errors', 1); | 
					
						
							|  |  |  |   ini_set('display_startup_errors', 1); | 
					
						
							|  |  |  |   ini_set('log_errors', 1); | 
					
						
							|  |  |  |   ini_set('error_reporting', E_ALL); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-27 14:44:38 +00:00
										 |  |  |   include("../includes/defaults.inc.php"); | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |   include("../config.php");  | 
					
						
							|  |  |  |   include("../includes/functions.php");   | 
					
						
							| 
									
										
										
										
											2009-10-02 13:20:24 +00:00
										 |  |  |   include("includes/functions.inc.php"); | 
					
						
							| 
									
										
										
										
											2010-02-20 17:37:42 +00:00
										 |  |  |   include("includes/authenticate.inc.php"); | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |   $start = utime(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   $now = time(); | 
					
						
							|  |  |  |   $day = time() - (24 * 60 * 60); | 
					
						
							|  |  |  |   $twoday = time() - (2 * 24 * 60 * 60); | 
					
						
							|  |  |  |   $week = time() - (7 * 24 * 60 * 60); | 
					
						
							|  |  |  |   $month = time() - (31 * 24 * 60 * 60); | 
					
						
							|  |  |  |   $year = time() - (365 * 24 * 60 * 60); | 
					
						
							|  |  |  | ?>
 | 
					
						
							| 
									
										
										
										
											2010-01-09 21:47:08 +00:00
										 |  |  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | 
					
						
							|  |  |  | <head> | 
					
						
							| 
									
										
										
										
											2008-10-30 21:27:48 +00:00
										 |  |  |   <title><?php echo($config['page_title']); ?></title>
 | 
					
						
							| 
									
										
										
										
											2008-03-15 17:58:15 +00:00
										 |  |  |   <base href="<?php echo($config['base_url']); ?>" /> | 
					
						
							| 
									
										
										
										
											2009-03-17 20:29:54 +00:00
										 |  |  |   <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | 
					
						
							|  |  |  |   <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> | 
					
						
							|  |  |  |   <meta http-equiv="content-language" content="en-us" /> | 
					
						
							| 
									
										
										
										
											2008-03-23 21:32:54 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  |   if($config['page_refresh']) { echo("<meta http-equiv='refresh' content='".$config['page_refresh']."'>"); } | 
					
						
							|  |  |  | ?>
 | 
					
						
							| 
									
										
										
										
											2010-01-09 00:17:02 +00:00
										 |  |  |   <link href="<?php  echo($config['stylesheet']);  ?>" rel="stylesheet" type="text/css" /> | 
					
						
							| 
									
										
										
										
											2008-03-15 17:58:15 +00:00
										 |  |  |   <link rel="shortcut icon" href="<?php  echo($config['favicon']);  ?>" /> | 
					
						
							| 
									
										
										
										
											2010-01-09 00:17:02 +00:00
										 |  |  |   <link rel="stylesheet" href="css/mktree.css" type="text/css" /> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | </head> | 
					
						
							| 
									
										
										
										
											2010-01-09 00:17:02 +00:00
										 |  |  | <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"> | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |   <script type="text/javascript" src="js/mktree.js"></script> | 
					
						
							|  |  |  |   <script type="text/javascript"> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | <!-- Begin | 
					
						
							|  |  |  | function popUp(URL) { | 
					
						
							|  |  |  |   day = new Date(); | 
					
						
							|  |  |  |   id = day.getTime(); | 
					
						
							|  |  |  |   eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=550,height=600');");  | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | // End -->
 | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |   </script> | 
					
						
							|  |  |  |   <script type="text/javascript" src="js/overlib.js"></script> | 
					
						
							|  |  |  |   <div id="center"> | 
					
						
							|  |  |  |     <div id="top" style="background: <?php echo($config['header_color']); ?>;"> | 
					
						
							|  |  |  |       <table cellpadding="0" cellspacing="0" width="100%"> | 
					
						
							|  |  |  |         <tr> | 
					
						
							|  |  |  |           <td align="left"></td> | 
					
						
							|  |  |  |           <td align="right"> | 
					
						
							| 
									
										
										
										
											2009-09-07 11:07:59 +00:00
										 |  |  |   <?php | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |      if($_SESSION['authenticated']) {  | 
					
						
							| 
									
										
										
										
											2008-03-15 17:58:15 +00:00
										 |  |  |        echo("Logged in as <b>".$_SESSION['username']."</b> (<a href='?logout=yes'>Logout</a>)");  | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |      } else {  | 
					
						
							|  |  |  |        echo("Not logged in!");  | 
					
						
							|  |  |  |      }  | 
					
						
							| 
									
										
										
										
											2008-04-10 14:52:51 +00:00
										 |  |  |       if( Net_IPv6::checkIPv6($_SERVER['REMOTE_ADDR'])) { echo(" via <b>IPv6</b>"); } else { echo(" via <b>IPv4</b>"); } | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |   ?>
 | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |           </td> | 
					
						
							|  |  |  |         </tr> | 
					
						
							|  |  |  |       </table> | 
					
						
							|  |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |     <div id="header" style="border: 1px none #ccf;"> | 
					
						
							|  |  |  |       <table width="100%" style="padding: 0px; margin:0px;"> | 
					
						
							|  |  |  |         <tr> | 
					
						
							|  |  |  |           <td style="padding: 0px; margin:0px; border: none;"> | 
					
						
							|  |  |  |             <div id="logo" style="padding: 10px"><a href="index.php"><img src="<?php echo($config['title_image']); ?>" alt="Logo" border="0" /></a></div> | 
					
						
							|  |  |  |           </td> | 
					
						
							|  |  |  |           <td align="center"><?php | 
					
						
							| 
									
										
										
										
											2009-03-24 15:14:01 +00:00
										 |  |  |          | 
					
						
							|  |  |  |         $data = trim(shell_exec("cat " . $config['install_dir'] . "/rrd/version.txt")); | 
					
						
							|  |  |  |                | 
					
						
							|  |  |  |         list($major, $minor, $release) = explode(".", $data); | 
					
						
							| 
									
										
										
										
											2010-01-16 23:16:58 +00:00
										 |  |  |                 if (strstr('-',$config['version'])) { list($cur, $tag) = explode("-", $config['version']); } else { $cur = $config['version']; } | 
					
						
							| 
									
										
										
										
											2009-03-24 15:14:01 +00:00
										 |  |  |                 list($cur_major, $cur_minor, $cur_release) = explode(".", $cur); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 if($major > $cur_major) { | 
					
						
							|  |  |  |                   echo("<a href='http://www.observernms.org'><span class=red>New Version! <br /> <b>$major.$minor.$release</b></span></a>"); | 
					
						
							|  |  |  |                 } elseif ($major == $cur_major && $minor > $cur_minor) { | 
					
						
							|  |  |  | 		  echo("<a href='http://www.observernms.org'><span class=red>New Version! <br /> <b>$major.$minor.$release</b></span></a>"); | 
					
						
							|  |  |  |                 } elseif ($major == $cur_major && $minor == $cur_minor && $release > $cur_release) { | 
					
						
							|  |  |  | 		  echo("<a href='http://www.observernms.org'><span class=red>New Version! <br /> <b>$major.$minor.$release</b></span></a>"); | 
					
						
							|  |  |  |                 } elseif($major < $cur_major || ($major == $cur_major && $minor < $cur_minor) || ($major == $cur_major && $minor == $cur_minor && $release < $cur_release)) { | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  | ?>
 | 
					
						
							|  |  |  |           </td> | 
					
						
							|  |  |  |           <td align="right" style="margin-right: 10px;"> | 
					
						
							|  |  |  |             <div id="topnav" style="float: right;"> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |  	  <?php if($_SESSION['authenticated']) { | 
					
						
							|  |  |  | 	    include("includes/topnav.inc");		 | 
					
						
							|  |  |  | 	  } ?>
 | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |             </div> | 
					
						
							|  |  |  |           </td> | 
					
						
							|  |  |  |         </tr> | 
					
						
							|  |  |  |       </table> | 
					
						
							|  |  |  |     </div> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-06-19 10:43:02 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-09 21:47:08 +00:00
										 |  |  | <?php if($_SESSION['authenticated']) {include("includes/print-menubar.php");} else {echo('<hr color="#444444" />');} ?>
 | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |     <div class="clearer"></div> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |     <div class="content-mat" style="border: 1px none #fcc;"> | 
					
						
							|  |  |  |       <div id="content" style="border: 1px none #ccc; min-height:650px;"> | 
					
						
							|  |  |  |         <div style="margin: 7px;"></div> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  |   if($_SESSION['authenticated']) { | 
					
						
							| 
									
										
										
										
											2010-02-20 17:22:22 +00:00
										 |  |  |     include("includes/warn-deleted-ports.inc.php"); | 
					
						
							| 
									
										
										
										
											2008-07-22 08:24:34 +00:00
										 |  |  |     ## Authenticated. Print a page.
 | 
					
						
							| 
									
										
										
										
											2010-01-16 23:16:58 +00:00
										 |  |  |     if(isset($_GET['page']) && !strstr("..", $_GET['page']) &&  is_file("pages/" . $_GET['page'] . ".php")) { | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |       include("pages/" . $_GET['page'] . ".php"); | 
					
						
							|  |  |  |     } else {  | 
					
						
							| 
									
										
										
										
											2008-11-04 12:34:46 +00:00
										 |  |  |       if($config['front_page']) { | 
					
						
							|  |  |  |         include($config['front_page']); | 
					
						
							|  |  |  |       } else { | 
					
						
							|  |  |  |         include("pages/front/default.php"); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2008-07-22 08:24:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |   } else { | 
					
						
							| 
									
										
										
										
											2008-07-22 08:24:34 +00:00
										 |  |  |     ## Not Authenticated. Print login.
 | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  |     include("pages/logon.inc"); | 
					
						
							|  |  |  |     exit; | 
					
						
							|  |  |  |   }  | 
					
						
							|  |  |  | ?>
 | 
					
						
							|  |  |  |         </div> | 
					
						
							| 
									
										
										
										
											2010-01-10 18:47:32 +00:00
										 |  |  |       <div class="clearer"></div> | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   </div> | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | <?php | 
					
						
							|  |  |  |     $end = utime(); $run = $end - $start; | 
					
						
							|  |  |  |     $gentime = substr($run, 0, 5); | 
					
						
							| 
									
										
										
										
											2010-01-10 18:19:15 +00:00
										 |  |  |     echo('<br /> <div id="footer">Generated in ' . $gentime . ' seconds  | 
					
						
							| 
									
										
										
										
											2010-01-11 17:59:58 +00:00
										 |  |  |           <br /> <a href="http://www.observernms.org">Observer ' . $config['version']); | 
					
						
							|  |  |  |     if (file_exists('.svn/entries')) | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       $svn = File('.svn/entries'); | 
					
						
							|  |  |  |       echo '-SVN r' . trim($svn[3]); | 
					
						
							|  |  |  |       unset($svn); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     echo ('</a> © 2006-2010 Adam Armstrong | 
					
						
							| 
									
										
										
										
											2010-01-10 18:19:15 +00:00
										 |  |  |           <br />This work is licensed under the <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html">GPL, version 3</a>.</div>'); | 
					
						
							| 
									
										
										
										
											2009-04-29 15:44:12 +00:00
										 |  |  | 	             | 
					
						
							| 
									
										
										
										
											2007-04-03 14:10:23 +00:00
										 |  |  | ?>
 | 
					
						
							|  |  |  | </body> | 
					
						
							|  |  |  | </html> | 
					
						
							|  |  |  | 
 |