2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*  Copyright  ( C )  2014  Daniel  Preussker  < f0o @ devilcode . org >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  This  program  is  free  software :  you  can  redistribute  it  and / or  modify 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  it  under  the  terms  of  the  GNU  General  Public  License  as  published  by 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  the  Free  Software  Foundation ,  either  version  3  of  the  License ,  or 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  ( at  your  option )  any  later  version . 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  This  program  is  distributed  in  the  hope  that  it  will  be  useful , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  but  WITHOUT  ANY  WARRANTY ;  without  even  the  implied  warranty  of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE . See  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  GNU  General  Public  License  for  more  details . 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  You  should  have  received  a  copy  of  the  GNU  General  Public  License 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  along  with  this  program .   If  not ,  see  < http :// www . gnu . org / licenses />. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 */ 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*  
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Custom  Frontpage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ author  f0o  < f0o @ devilcode . org > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ copyright  2014  f0o ,  LibreNMS 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ license  GPL 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ package  LibreNMS 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ subpackage  Frontpage 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 */ 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								?> 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-22 22:04:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< script  src = 'https://www.google.com/jsapi' ></ script >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								< ? php  
						 
					
						
							
								
									
										
										
										
											2015-07-22 22:04:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								use  LibreNMS\Authentication\LegacyAuth ;  
						 
					
						
							
								
									
										
										
										
											2018-04-07 15:55:28 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include_once  'includes/html/object-cache.inc.php' ;  
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								echo  ' < div  class = " container-fluid " >  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        < div  class = " col-md-8 " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-22 22:04:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								include_once  'includes/html/common/globe.inc.php' ;  
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								echo  implode ( ',' ,  $common_output );  
						 
					
						
							
								
									
										
										
										
											2015-07-22 22:04:33 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								echo  '  
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        < div  class = " col-md-4 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < div  class = " container-fluid " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    < div  class = " col-md-4 " > ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        include_once ( " includes/html/device-summary-vert.inc.php " ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								echo  '                   </ div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    < div  class = " col-md-4 " > ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        include_once ( " includes/html/front/boxes.inc.php " ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								echo  '                   </ div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        < div  class = " col-md-12 " > ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            $device [ 'device_id' ]  =  '-1' ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            require_once ( 'includes/html/common/alerts.inc.php' ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            echo  implode ( '' ,  $common_output ); 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            unset ( $device [ 'device_id' ]); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								echo  '       </ div >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    </ div > 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								</ div > ' ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//From default.php - This code is not part of above license.
  
						 
					
						
							
								
									
										
										
										
											2019-06-23 00:29:12 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								if  ( \LibreNMS\Config :: get ( 'enable_syslog' ))  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    $sql  =  " SELECT *, DATE_FORMAT(timestamp, ' "  .  \LibreNMS\Config :: get ( 'dateformat.mysql.compact' )  .  " ') AS date from syslog ORDER BY seq DESC LIMIT 20 " ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    echo ( ' < div  class = " container-fluid " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								          < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < div  class = " col-md-12 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              & nbsp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < div  class = " col-md-12 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              < div  class = " panel panel-default panel-condensed " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              < div  class = " panel-heading " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                < strong > Syslog  entries </ strong > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              < table  class = " table table-hover table-condensed table-striped " > ' ); 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    foreach  ( dbFetchRows ( $sql )  as  $entry )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        $entry  =  array_merge ( $entry ,  device_by_id_cache ( $entry [ 'device_id' ])); 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-01 15:36:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        unset ( $syslog_output ); 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        include  'includes/html/print-syslog.inc.php' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-01 15:36:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        echo  $syslog_output ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </table> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  else  {  
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  ( LegacyAuth :: user () -> hasGlobalAdmin ())  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-23 00:29:12 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $query  =  " SELECT *,DATE_FORMAT(datetime, ' "  .  \LibreNMS\Config :: get ( 'dateformat.mysql.compact' )  .  " ') as humandate  FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15 " ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    }  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-23 00:29:12 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        $query  =  " SELECT *,DATE_FORMAT(datetime, ' "  .  \LibreNMS\Config :: get ( 'dateformat.mysql.compact' )  .  " ') as humandate  FROM `eventlog` AS E, devices_perms AS P WHERE E.host =
 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 07:51:35 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            P . device_id  AND  P . user_id  =  "  . LegacyAuth::id() .  "  ORDER  BY  `datetime`  DESC  LIMIT  0 , 15 " ;
 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-18 20:28:22 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    echo ( ' < div  class = " container-fluid " > 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-16 15:46:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								          < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < div  class = " col-md-12 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              & nbsp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								          < div  class = " row " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            < div  class = " col-md-12 " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              < div  class = " panel panel-default panel-condensed " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              < div  class = " panel-heading " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                < strong > Eventlog  entries </ strong > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              </ div > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								              < table  class = " table table-hover table-condensed table-striped " > ' ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    foreach  ( dbFetchRows ( $query )  as  $entry )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-11 23:26:42 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        include  'includes/html/print-event.inc.php' ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    } 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-13 20:10:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    echo ( " </table> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    echo ( " </div> " ); 
							 
						 
					
						
							
								
									
										
										
										
											2012-05-14 13:27:24 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}