1<?php 2# required functions 3if(!is_object(@$User)) { 4 require_once( dirname(__FILE__) . '/../../../functions/functions.php' ); 5 # classes 6 $Database = new Database_PDO; 7 $User = new User ($Database); 8 $Tools = new Tools ($Database); 9 $Subnets = new Subnets ($Database); 10 $Addresses = new Addresses ($Database); 11} 12 13# user must be authenticated 14$User->check_user_session (); 15 16# if direct request that redirect to tools page 17if($_SERVER['HTTP_X_REQUESTED_WITH']!="XMLHttpRequest") { 18 header("Location: ".create_link("tools")); 19} 20 21# set items 22# Tools 23$tools_menu['Tools'][] = array("show"=>true, "icon"=>"fa-search", "name"=>"Search", "href"=>"search", "description"=>"Search database Addresses, subnets and VLANs"); 24$tools_menu['Tools'][] = array("show"=>true, "icon"=>"fa-calculator", "name"=>"IP calculator", "href"=>"ip-calculator","description"=>"IPv4v6 calculator for subnet calculations"); 25# Subnets 26$tools_menu['Subnets'][] = array("show"=>true, "icon"=>"fa-sitemap", "name"=>"Subnets", "href"=>"subnets", "description"=>"Show all subnets"); 27if($User->get_module_permissions ("vlan")>0) 28$tools_menu['Subnets'][] = array("show"=>true, "icon"=>"fa-cloud", "name"=>"VLAN", "href"=>"vlan", "description"=>"Show VLANs and belonging subnets"); 29if($User->settings->enableVRF == 1 && $User->get_module_permissions ("vlan")>0) 30$tools_menu['Subnets'][] = array("show"=>true, "icon"=>"fa-cloud", "name"=>"VRF", "href"=>"vrf", "description"=>"Show VRFs and belonging networks"); 31if($User->get_module_permissions ("devices")>0) 32$tools_menu['Subnets'][] = array("show"=>true, "icon"=>"fa-desktop", "name"=>"Devices", "href"=>"devices", "description"=>"Show all configured devices"); 33?> 34 35 36<script type="text/javascript"> 37$(document).ready(function() { 38 if ($("[rel=tooltip]").length) { $("[rel=tooltip]").tooltip(); } 39 return false; 40}); 41</script> 42 43<style type="text/css"> 44#dashboard1 { 45 height: 210px; 46 overflow: hidden; 47} 48#dashboard1 .inner { 49 min-height: 0px; 50 margin: 0px !important; 51 padding: 0px; 52} 53#dashboard1 .icon { 54 text-align: center; 55 border-right: 1px solid #ddd; 56 width: 50px; 57 padding-left: 10px; 58 height: 60px; 59 padding-top: 20px !important; 60 61 float: left; 62 position: absolute; 63} 64#dashboard1 .icon i { 65 color: #ccc; 66 font-size: 20px; 67} 68#dashboard1 .inner { 69 margin: 3px !important; 70 border: 0px !important; 71} 72#dashboard1 .text { 73 padding: 8px !important; 74 padding-left: 60px !important; 75} 76</style> 77 78 79<div id='dashboard1' class="tools-all tools-widget"> 80<div class="row"> 81 82<?php 83# print 84foreach($tools_menu as $k=>$tool) { 85 # items 86 foreach($tool as $t) { 87 # remove unneeded 88 print " <div class='col-xs-12 col-md-6 col-lg-6 widget-dash1'>"; 89 print " <div class='inner thumbnail'>"; 90 print " <div class='hContent'>"; 91 print " <div class='icon'><a href='".create_link("tools",$t['href'])."'><i class='fa $t[icon]'></i></a></div>"; 92 print " <div class='text'><a href='".create_link("tools",$t['href'])."'>"._($t['name'])."</a><hr><span class='text-muted'>"._($t['description'])."</span></div>"; 93 print " </div>"; 94 print " </div>"; 95 print " </div>"; 96 } 97 98 # clear and break 99 print "<div class='clearfix'></div>"; 100} 101?> 102</div> 103</div> 104