mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Rebased from upstream
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
session_start();
|
||||
if(isset($_REQUEST['width']) AND isset($_REQUEST['height'])) {
|
||||
$_SESSION['screen_width'] = $_REQUEST['width'];
|
||||
$_SESSION['screen_height'] = $_REQUEST['height'];
|
||||
}
|
||||
echo $_SESSION['screen_width'];
|
||||
echo $_SESSION['screen_height'];
|
||||
+57
-1
@@ -1764,4 +1764,60 @@ tr.search:nth-child(odd) {
|
||||
|
||||
label {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.nav>li>a.dropdown-toggle {
|
||||
padding: 15px 6px;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 480px) {
|
||||
.thumbnail_graph_table b { font-size : 6px;}
|
||||
.thumbnail_graph_table img {
|
||||
max-width: 45px;
|
||||
max-height: 50px;
|
||||
}
|
||||
.device-header-table .device_icon img {
|
||||
max-width: 20px;
|
||||
max-height: 20px;
|
||||
}
|
||||
.device-header-table img {
|
||||
max-width: 115px;
|
||||
max-height: 40px;
|
||||
}
|
||||
.device-header-table {font-size : 8px;}
|
||||
.device-header-table a {font-size : 11px;}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 768px) and (min-width: 481px) {
|
||||
.thumbnail_graph_table b { font-size : 8px;}
|
||||
.thumbnail_graph_table img {
|
||||
max-width: 60px;
|
||||
max-height: 55px;
|
||||
}
|
||||
.device-header-table img {
|
||||
max-width: 150px;
|
||||
max-height: 50px;
|
||||
}
|
||||
.device-header-table {font-size : 10px;}
|
||||
.device-header-table a {font-size : 17px;}
|
||||
}
|
||||
|
||||
|
||||
@media only screen and (max-width: 800px) and (min-width: 721px) {
|
||||
.thumbnail_graph_table b { font-size : 8px;}
|
||||
.thumbnail_graph_table img {
|
||||
max-width: 75px;
|
||||
max-height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1024px) and (min-width: 801px) {
|
||||
.thumbnail_graph_table b { font-size : 9px;}
|
||||
.thumbnail_graph_table img {
|
||||
max-width: 105px;
|
||||
max-height: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1024px) {
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
@@ -86,7 +86,16 @@ function auth_usermanagement() {
|
||||
function adduser($username) {
|
||||
// Check to see if user is already added in the database
|
||||
if (!user_exists_in_db($username)) {
|
||||
return dbInsert(array('username' => $username, 'user_id' => get_userid($username), 'level' => "0", 'can_modify_passwd' => 0, 'twofactor' => 0), 'users');
|
||||
$userid = dbInsert(array('username' => $username, 'user_id' => get_userid($username), 'level' => "0", 'can_modify_passwd' => 0, 'twofactor' => 0), 'users');
|
||||
if ($userid == false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
foreach (dbFetchRows('select notifications.* from notifications where not exists( select 1 from notifications_attribs where notifications.notifications_id = notifications_attribs.notifications_id and notifications_attribs.user_id = ?) order by notifications.notifications_id desc',array($userid)) as $notif) {
|
||||
dbInsert(array('notifications_id'=>$notif['notifications_id'],'user_id'=>$userid,'key'=>'read','value'=>1),'notifications_attribs');
|
||||
}
|
||||
}
|
||||
return $userid;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
||||
@@ -44,11 +44,20 @@ function auth_usermanagement() {
|
||||
}
|
||||
|
||||
|
||||
function adduser($username, $password, $level, $email='', $realname='', $can_modify_passwd='1') {
|
||||
function adduser($username, $password, $level, $email='', $realname='', $can_modify_passwd=1, $description='', $twofactor=0) {
|
||||
if (!user_exists($username)) {
|
||||
$hasher = new PasswordHash(8, false);
|
||||
$encrypted = $hasher->HashPassword($password);
|
||||
return dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname), 'users');
|
||||
$userid = dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname, 'can_modify_passwd' => $can_modify_passwd, 'descr' => $description, 'twofactor' => $twofactor), 'users');
|
||||
if ($userid == false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
foreach (dbFetchRows('select notifications.* from notifications where not exists( select 1 from notifications_attribs where notifications.notifications_id = notifications_attribs.notifications_id and notifications_attribs.user_id = ?) order by notifications.notifications_id desc',array($userid)) as $notif) {
|
||||
dbInsert(array('notifications_id'=>$notif['notifications_id'],'user_id'=>$userid,'key'=>'read','value'=>1),'notifications_attribs');
|
||||
}
|
||||
}
|
||||
return $userid;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
||||
@@ -104,7 +104,16 @@ function adduser($username, $password, $level, $email='', $realname='', $can_mod
|
||||
if (!user_exists($username)) {
|
||||
$hasher = new PasswordHash(8, false);
|
||||
$encrypted = $hasher->HashPassword($password);
|
||||
return dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname, 'can_modify_passwd' => $can_modify_passwd, 'descr' => $description, 'twofactor' => $twofactor), 'users');
|
||||
$userid = dbInsert(array('username' => $username, 'password' => $encrypted, 'level' => $level, 'email' => $email, 'realname' => $realname, 'can_modify_passwd' => $can_modify_passwd, 'descr' => $description, 'twofactor' => $twofactor), 'users');
|
||||
if ($userid == false) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
foreach (dbFetchRows('select notifications.* from notifications where not exists( select 1 from notifications_attribs where notifications.notifications_id = notifications_attribs.notifications_id and notifications_attribs.user_id = ?) order by notifications.notifications_id desc',array($userid)) as $notif) {
|
||||
dbInsert(array('notifications_id'=>$notif['notifications_id'],'user_id'=>$userid,'key'=>'read','value'=>1),'notifications_attribs');
|
||||
}
|
||||
}
|
||||
return $userid;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
|
||||
@@ -30,7 +30,7 @@ if ($config['map']['engine'] == 'leaflet') {
|
||||
<div class="col-sm-4">
|
||||
<label for="init_lat" class="control-label">Initial Latitude: </label>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" name="init_lat" id="input_lat_'.$unique_id.'" value="'.$widget_settings['init_lat'].'" placeholder="ie. 51.4800 for Greenwich">
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,7 +46,7 @@ if ($config['map']['engine'] == 'leaflet') {
|
||||
<div class="col-sm-4">
|
||||
<label for="init_zoom" class="control-label">Initial Zoom: </label>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="init_zoom" id="select_zoom'.$unique_id.'">
|
||||
';
|
||||
for ($i=0; $i<19; $i++) {
|
||||
@@ -65,10 +65,35 @@ if ($config['map']['engine'] == 'leaflet') {
|
||||
<div class="col-sm-4">
|
||||
<label for="group_radius" class="control-label">Grouping radius: </label>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" name="group_radius" id="input_radius_'.$unique_id.'" value="'.$widget_settings['group_radius'].'" placeholder="default 80">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-4">
|
||||
<label for="status" class="control-label">Show devices: </label>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<select class="form-control" name="status" id="status_'.$unique_id.'">';
|
||||
|
||||
$temp_output .= '<option value="0,1"';
|
||||
if ($widget_settings['status'] == '0,1') {
|
||||
$temp_output .= ' selected';
|
||||
}
|
||||
$temp_output .= '>Up + Down</option>
|
||||
<option value="1"';
|
||||
if ($widget_settings['status'] == '1') {
|
||||
$temp_output .= ' selected';
|
||||
}
|
||||
$temp_output .= '>Up</option>
|
||||
<option value="0"';
|
||||
if ($widget_settings['status'] == '0') {
|
||||
$temp_output .= ' selected';
|
||||
}
|
||||
$temp_output .= '>Down</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-2">
|
||||
<button type="submit" class="btn btn-default">Set</button>
|
||||
@@ -101,6 +126,9 @@ if ($config['map']['engine'] == 'leaflet') {
|
||||
else {
|
||||
$group_radius = 80;
|
||||
}
|
||||
if (empty($widget_settings['status']) && $widget_settings['status'] != '0') {
|
||||
$widget_settings['status'] = '0,1';
|
||||
}
|
||||
$map_init = "[" . $init_lat . ", " . $init_lng . "], " . sprintf("%01.0f", $init_zoom);
|
||||
$temp_output .= 'var map = L.map(\'leaflet-map\').setView('.$map_init.');
|
||||
L.tileLayer(\'//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\', {
|
||||
@@ -122,24 +150,31 @@ var greenMarker = L.AwesomeMarkers.icon({
|
||||
// Checking user permissions
|
||||
if (is_admin() || is_read()) {
|
||||
// Admin or global read-only - show all devices
|
||||
$sql = "SELECT DISTINCT(`device_id`),`hostname`,`os`,`status`,`lat`,`lng` FROM `devices`
|
||||
$sql = "SELECT DISTINCT(`device_id`),`devices`.`location`,`hostname`,`os`,`status`,`lat`,`lng` FROM `devices`
|
||||
LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location`
|
||||
WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != ''
|
||||
WHERE `disabled`=0 AND `ignore`=0 AND ((`lat` != '' AND `lng` != '') OR (`devices`.`location` REGEXP '\[[0-9\.\, ]+\]'))
|
||||
AND `status` IN (".$widget_settings['status'].")
|
||||
ORDER BY `status` ASC, `hostname`";
|
||||
}
|
||||
else {
|
||||
// Normal user - grab devices that user has permissions to
|
||||
$sql = "SELECT DISTINCT(`devices`.`device_id`) as `device_id`,`hostname`,`os`,`status`,`lat`,`lng`
|
||||
$sql = "SELECT DISTINCT(`devices`.`device_id`) as `device_id`,`devices`.`location`,`hostname`,`os`,`status`,`lat`,`lng`
|
||||
FROM `devices_perms`, `devices`
|
||||
LEFT JOIN `locations` ON `devices`.`location`=`locations`.`location`
|
||||
WHERE `disabled`=0 AND `ignore`=0 AND `lat` != '' AND `lng` != ''
|
||||
WHERE `disabled`=0 AND `ignore`=0 AND ((`lat` != '' AND `lng` != '') OR (`devices`.`location` REGEXP '\[[0-9\.\, ]+\]'))
|
||||
AND `devices`.`device_id` = `devices_perms`.`device_id`
|
||||
AND `devices_perms`.`user_id` = ?
|
||||
AND `devices_perms`.`user_id` = ? AND `status` IN (".$widget_settings['status'].")
|
||||
ORDER BY `status` ASC, `hostname`";
|
||||
$param[] = $_SESSION['user_id'];
|
||||
}
|
||||
foreach (dbFetchRows($sql, array($_SESSION['user_id'])) as $map_devices) {
|
||||
foreach (dbFetchRows($sql, $param) as $map_devices) {
|
||||
$icon = 'greenMarker';
|
||||
$z_offset = 0;
|
||||
$tmp_loc = parse_location($map_devices['location']);
|
||||
if (!empty($tmp_loc['lat']) && !empty($tmp_loc['lng'])) {
|
||||
$map_devices['lat'] = $tmp_loc['lat'];
|
||||
$map_devices['lng'] = $tmp_loc['lng'];
|
||||
}
|
||||
if ($map_devices['status'] == 0) {
|
||||
$icon = 'redMarker';
|
||||
$z_offset = 10000; // move marker to foreground
|
||||
|
||||
@@ -78,7 +78,10 @@ if ($device['location']) {
|
||||
}
|
||||
}
|
||||
|
||||
$loc = dbFetchRow("SELECT `lat`,`lng` FROM `locations` WHERE `location`=? LIMIT 1", array($device['location']));
|
||||
$loc = parse_location($device['location']);
|
||||
if (!is_array($loc)) {
|
||||
$loc = dbFetchRow("SELECT `lat`,`lng` FROM `locations` WHERE `location`=? LIMIT 1", array($device['location']));
|
||||
}
|
||||
if (is_array($loc)) {
|
||||
echo '<tr>
|
||||
<td>Lat / Lng</td>
|
||||
|
||||
@@ -24,9 +24,9 @@ $image = getImage($device);
|
||||
|
||||
echo '
|
||||
<tr bgcolor="'.$device_colour.'" class="alert '.$class.'">
|
||||
<td width="40" align=center valign=middle style="padding: 21px;">'.$image.'</td>
|
||||
<td width="40" align=center valign=middle style="padding: 21px;"><span class="device_icon">'.$image.'</span></td>
|
||||
<td valign=middle style="padding: 0 15px;"><span style="font-size: 20px;">'.generate_device_link($device).'</span>
|
||||
<br />'.$device['location'].'</td>
|
||||
<br />'.generate_link($device['location'], array('page' => 'devices', 'location' => $device['location'])).'</td>
|
||||
<td>';
|
||||
|
||||
if (isset($config['os'][$device['os']]['over'])) {
|
||||
|
||||
@@ -30,10 +30,13 @@ $config_extra = mres($_POST['config_extra']);
|
||||
$config_room_id = mres($_POST['config_room_id']);
|
||||
$config_from = mres($_POST['config_from']);
|
||||
$config_userkey = mres($_POST['config_userkey']);
|
||||
$config_user = mres($_POST['config_user']);
|
||||
$config_to = mres($_POST['config_to']);
|
||||
$config_token = mres($_POST['config_token']);
|
||||
$status = 'error';
|
||||
$message = 'Error with config';
|
||||
|
||||
if ($action == 'remove' || $action == 'remove-slack' || $action == 'remove-hipchat' || $action == 'remove-pushover' || $action == 'remove-boxcar') {
|
||||
if ($action == 'remove' || $action == 'remove-slack' || $action == 'remove-hipchat' || $action == 'remove-pushover' || $action == 'remove-boxcar' || $action == 'remove-clickatell' || $action == 'remove-playsms') {
|
||||
$config_id = mres($_POST['config_id']);
|
||||
if (empty($config_id)) {
|
||||
$message = 'No config id passed';
|
||||
@@ -52,6 +55,12 @@ if ($action == 'remove' || $action == 'remove-slack' || $action == 'remove-hipch
|
||||
elseif ($action == 'remove-boxcar') {
|
||||
dbDelete('config', "`config_name` LIKE 'alert.transports.boxcar.$config_id.%'");
|
||||
}
|
||||
elseif ($action == 'remove-clickatell') {
|
||||
dbDelete('config', "`config_name` LIKE 'alert.transports.clickatell.$config_id.%'");
|
||||
}
|
||||
elseif ($action == 'remove-playsms') {
|
||||
dbDelete('config', "`config_name` LIKE 'alert.transports.playsms.$config_id.%'");
|
||||
}
|
||||
|
||||
$status = 'ok';
|
||||
$message = 'Config item removed';
|
||||
@@ -156,6 +165,66 @@ else if ($action == 'add-boxcar') {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($action == 'add-clickatell') {
|
||||
if (empty($config_value)) {
|
||||
$message = 'No Clickatell token provided';
|
||||
}
|
||||
elseif (empty($config_to)) {
|
||||
$message = 'No mobile numbers provided';
|
||||
}
|
||||
else {
|
||||
$config_id = dbInsert(array('config_name' => 'alert.transports.clickatell.', 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $config_value, 'config_descr' => 'Clickatell Transport'), 'config');
|
||||
if ($config_id > 0) {
|
||||
dbUpdate(array('config_name' => 'alert.transports.clickatell.'.$config_id.'.token'), 'config', 'config_id=?', array($config_id));
|
||||
$status = 'ok';
|
||||
$message = 'Config item created';
|
||||
$mobiles = explode('\n', $config_to);
|
||||
$x=0;
|
||||
foreach ($mobiles as $mobile) {
|
||||
if (!empty($mobile)) {
|
||||
dbInsert(array('config_name' => 'alert.transports.clickatell.'.$config_id.'.to.'.$x, 'config_value' => $mobile, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'Clickatell mobile'), 'config');
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$message = 'Could not create config item';
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'add-playsms') {
|
||||
if (empty($config_value)) {
|
||||
$message = 'No PlaySMS URL provided';
|
||||
}
|
||||
elseif (empty($config_user)) {
|
||||
$message = 'No PlaySMS User provided';
|
||||
}
|
||||
elseif (empty($config_to)) {
|
||||
$message = 'No mobile numbers provided';
|
||||
}
|
||||
else {
|
||||
$config_id = dbInsert(array('config_name' => 'alert.transports.playsms.', 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $config_value, 'config_descr' => 'PlaySMS Transport'), 'config');
|
||||
if ($config_id > 0) {
|
||||
dbUpdate(array('config_name' => 'alert.transports.playsms.'.$config_id.'.url'), 'config', 'config_id=?', array($config_id));
|
||||
$additional_id['from'] = dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.from', 'config_value' => $config_from, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $config_from, 'config_descr' => 'PlaySMS From'), 'config');
|
||||
$additional_id['user'] = dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.user', 'config_value' => $config_user, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $config_user, 'config_descr' => 'PlaySMS User'), 'config');
|
||||
$additional_id['token'] = dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.token', 'config_value' => $config_token, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $config_token, 'config_descr' => 'PlaySMS Token'), 'config');
|
||||
$status = 'ok';
|
||||
$message = 'Config item created';
|
||||
$mobiles = explode('\n', $config_to);
|
||||
$x=0;
|
||||
foreach ($mobiles as $mobile) {
|
||||
if (!empty($mobile)) {
|
||||
dbInsert(array('config_name' => 'alert.transports.playsms.'.$config_id.'.to.'.$x, 'config_value' => $mobile, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'PlaySMS mobile'), 'config');
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$message = 'Could not create config item';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (empty($config_group) || empty($config_sub_group) || empty($config_name) || empty($config_value)) {
|
||||
$message = 'Missing config name or value';
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Daniel Preussker, QuxLabs UG <preussker@quxlabs.com>
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/**
|
||||
* Notification Page
|
||||
* @author Daniel Preussker
|
||||
* @copyright 2015 Daniel Preussker, QuxLabs UG
|
||||
* @license GPL
|
||||
* @package LibreNMS
|
||||
* @subpackage Notifications
|
||||
*/
|
||||
|
||||
$status = 'error';
|
||||
$message = 'unknown error';
|
||||
if (isset($_REQUEST['notification_id']) && isset($_REQUEST['action'])) {
|
||||
if ($_REQUEST['action'] == 'read' && dbInsert(array('notifications_id'=>$_REQUEST['notification_id'],'user_id'=>$_SESSION['user_id'],'key'=>'read','value'=>1),'notifications_attribs')) {
|
||||
$status = 'ok';
|
||||
$message = 'Set as Read';
|
||||
}
|
||||
elseif ($_SESSION['userlevel'] == 10 && $_REQUEST['action'] == 'stick' && dbInsert(array('notifications_id'=>$_REQUEST['notification_id'],'user_id'=>$_SESSION['user_id'],'key'=>'sticky','value'=>1),'notifications_attribs')) {
|
||||
$status = 'ok';
|
||||
$message = 'Set as Sticky';
|
||||
}
|
||||
elseif ($_SESSION['userlevel'] == 10 && $_REQUEST['action'] == 'unstick' && dbUpdate(array('key'=>'sticky','value'=>0),'notifications_attribs','notifications_id = ? && user_id = ?',array($_REQUEST['notification_id'],$_SESSION['user_id']))) {
|
||||
$status = 'ok';
|
||||
$message = 'Removed Sticky';
|
||||
}
|
||||
}
|
||||
elseif ($_REQUEST['action'] == 'create' && $_SESSION['userlevel'] == 10 && (isset($_REQUEST['title']) && isset($_REQUEST['body']))) {
|
||||
if (dbInsert(array('title'=>$_REQUEST['title'],'body'=>$_REQUEST['body'],'checksum'=>hash('sha512',$_SESSION['user_id'].'.LOCAL.'.$_REQUEST['title']),'source'=>$_SESSION['user_id']),'notifications')) {
|
||||
$status = 'ok';
|
||||
$message = 'Created';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$status = 'error';
|
||||
$message = 'ERROR: Missing Params';
|
||||
}
|
||||
|
||||
die(json_encode(array(
|
||||
'status' => $status,
|
||||
'message' => $message,
|
||||
)));
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$status = 'error';
|
||||
$message = 'unknown error';
|
||||
$data_param = mres($_POST['data_param']);
|
||||
$query_param = mres($_POST['query_param']);
|
||||
if (isset($data_param) && isset($query_param)) {
|
||||
$status = 'ok';
|
||||
$message = 'Queried';
|
||||
$output = get_ripe_api_whois_data_json($data_param, $query_param);
|
||||
}
|
||||
else {
|
||||
$status = 'error';
|
||||
$message = 'ERROR: Could not query';
|
||||
}
|
||||
die(json_encode(array(
|
||||
'status' => $status,
|
||||
'message' => $message,
|
||||
'data_param' => $data_param,
|
||||
'query_param' => $query_param,
|
||||
'output' => $output
|
||||
)));
|
||||
@@ -25,23 +25,32 @@ $status = 'error';
|
||||
if (!is_numeric($config_id)) {
|
||||
$message = 'ERROR: No config item';
|
||||
}
|
||||
else if ($action == 'update-textarea') {
|
||||
elseif ($action == 'update-textarea') {
|
||||
$extras = explode(PHP_EOL, $_POST['config_value']);
|
||||
$x=0;
|
||||
foreach ($extras as $option) {
|
||||
list($k,$v) = explode('=', $option, 2);
|
||||
if (!empty($k) || !empty($v)) {
|
||||
if ($config_type == 'slack') {
|
||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.slack.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Slack Transport'), 'config');
|
||||
}
|
||||
else if ($config_type == 'hipchat') {
|
||||
elseif ($config_type == 'hipchat') {
|
||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.hipchat.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Hipchat Transport'), 'config');
|
||||
}
|
||||
else if ($config_type == 'pushover') {
|
||||
elseif ($config_type == 'pushover') {
|
||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.pushover.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Pushover Transport'), 'config');
|
||||
}
|
||||
elseif ($config_type == 'boxcar') {
|
||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.boxcar.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Boxcar Transport'), 'config');
|
||||
}
|
||||
elseif ($config_type == 'clickatell') {
|
||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.clickatell.to.'.$x, 'config_value' => $k, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'Clickatell Transport'), 'config');
|
||||
$x++;
|
||||
}
|
||||
elseif ($config_type == 'playsms') {
|
||||
$db_id[] = dbInsert(array('config_name' => 'alert.transports.playsms.to.'.$x, 'config_value' => $k, 'config_group' => 'alerting', 'config_sub_group' => 'transports', 'config_default' => $v, 'config_descr' => 'PlaySMS Transport'), 'config');
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,15 +63,21 @@ else if ($action == 'update-textarea') {
|
||||
if ($config_type == 'slack') {
|
||||
dbDelete('config', "(`config_name` LIKE 'alert.transports.slack.$config_id.%' AND `config_name` != 'alert.transports.slack.$config_id.url' AND `config_id` NOT IN ($db_inserts))");
|
||||
}
|
||||
else if ($config_type == 'hipchat') {
|
||||
elseif ($config_type == 'hipchat') {
|
||||
dbDelete('config', "(`config_name` LIKE 'alert.transports.hipchat.$config_id.%' AND (`config_name` != 'alert.transports.hipchat.$config_id.url' AND `config_name` != 'alert.transports.hipchat.$config_id.room_id' AND `config_name` != 'alert.transports.hipchat.$config_id.from') AND `config_id` NOT IN ($db_inserts))");
|
||||
}
|
||||
else if ($config_type == 'pushover') {
|
||||
elseif ($config_type == 'pushover') {
|
||||
dbDelete('config', "(`config_name` LIKE 'alert.transports.pushover.$config_id.%' AND (`config_name` != 'alert.transports.pushover.$config_id.appkey' AND `config_name` != 'alert.transports.pushover.$config_id.userkey') AND `config_id` NOT IN ($db_inserts))");
|
||||
}
|
||||
else if ($config_type == 'boxcar') {
|
||||
elseif ($config_type == 'boxcar') {
|
||||
dbDelete('config', "(`config_name` LIKE 'alert.transports.boxcar.$config_id.%' AND (`config_name` != 'alert.transports.boxcar.$config_id.access_token' AND `config_name` != 'alert.transports.boxcar.$config_id.userkey') AND `config_id` NOT IN ($db_inserts))");
|
||||
}
|
||||
elseif ($config_type == 'clickatell') {
|
||||
dbDelete('config', "(`config_name` LIKE 'alert.transports.clickatell.to.%' AND `config_id` NOT IN ($db_inserts))");
|
||||
}
|
||||
elseif ($config_type == 'playsms') {
|
||||
dbDelete('config', "(`config_name` LIKE 'alert.transports.playsms.to.%' AND `config_id` NOT IN ($db_inserts))");
|
||||
}
|
||||
}
|
||||
|
||||
$message = 'Config item has been updated:';
|
||||
|
||||
@@ -476,7 +476,7 @@ function generate_lazy_graph_tag($args) {
|
||||
$urlargs[] = $key."=".urlencode($arg);
|
||||
}
|
||||
|
||||
return '<img class="lazy" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&',$urlargs).'" border="0" />';
|
||||
return '<img class="lazy graphs" width="'.$w.'" height="'.$h.'" data-original="graph.php?' . implode('&',$urlargs).'" border="0" />';
|
||||
|
||||
}//end generate_lazy_graph_tag()
|
||||
|
||||
@@ -1097,7 +1097,7 @@ function get_config_like_name($name) {
|
||||
$name = array($name);
|
||||
$items = array();
|
||||
foreach (dbFetchRows("SELECT * FROM `config` WHERE `config_name` LIKE '%?%'", array($name)) as $config_item) {
|
||||
$items[$config_item['config_name']] = $config_item;
|
||||
$items[$config_item['config_id']] = $config_item;
|
||||
}
|
||||
|
||||
return $items;
|
||||
@@ -1252,3 +1252,9 @@ function generate_dynamic_config_panel($title,$end_panel=true,$config_groups,$it
|
||||
}
|
||||
return $output;
|
||||
}//end generate_dynamic_config_panel()
|
||||
|
||||
function get_ripe_api_whois_data_json($ripe_data_param, $ripe_query_param) {
|
||||
$ripe_whois_url = 'https://stat.ripe.net/data/'. $ripe_data_param . '/data.json?resource=' . $ripe_query_param;
|
||||
return json_decode(file_get_contents($ripe_whois_url) , true);
|
||||
}//end get_ripe_api_whois_data_json()
|
||||
|
||||
|
||||
@@ -37,6 +37,22 @@ else {
|
||||
);
|
||||
}//end if
|
||||
|
||||
if($_SESSION['screen_width']) {
|
||||
if($_SESSION['screen_width'] < 1024 && $_SESSION['screen_width'] > 700) {
|
||||
$graph_array['width'] = round(($_SESSION['screen_width'] - 90 )/2,0);
|
||||
}
|
||||
else {
|
||||
if($_SESSION['screen_width'] > 1024) {
|
||||
$graph_array['width'] = round(($_SESSION['screen_width'] - 90 )/count($periods)+1,0);
|
||||
}
|
||||
else {
|
||||
$graph_array['width'] = $_SESSION['screen_width'] - 70;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$graph_array['height'] = round($graph_array['width'] /2.15);
|
||||
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
|
||||
$graph_data = array();
|
||||
|
||||
@@ -36,8 +36,8 @@ else {
|
||||
$mac = '';
|
||||
}
|
||||
|
||||
echo "<tr style=\"background-color: $row_colour;\" valign=top onmouseover=\"this.style.backgroundColor='$list_highlight';\" onmouseout=\"this.style.backgroundColor='$row_colour';\" onclick=\"location.href='".generate_port_url($port)."'\" style='cursor: pointer;'>
|
||||
<td valign=top width=350>";
|
||||
echo "<tr style=\"background-color: $row_colour;\" valign=top onmouseover=\"this.style.backgroundColor='$list_highlight';\" onmouseout=\"this.style.backgroundColor='$row_colour';\" style='cursor: pointer;'>
|
||||
<td valign=top width=350 onclick=\"location.href='".generate_port_url($port)."'\">";
|
||||
echo ' <span class=list-large>
|
||||
'.generate_port_link($port, $port['ifIndex'].'. '.$port['label'])." $error_img $mac
|
||||
</span><br /><span class=interface-desc>".$port['ifAlias'].'</span>';
|
||||
@@ -62,7 +62,7 @@ if ($port_details) {
|
||||
|
||||
echo '</span>';
|
||||
|
||||
echo '</td><td width=100>';
|
||||
echo "</td><td width=100 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
|
||||
if ($port_details) {
|
||||
$port['graph_type'] = 'port_bits';
|
||||
@@ -73,7 +73,7 @@ if ($port_details) {
|
||||
echo generate_port_link($port, "<img src='graph.php?type=port_errors&id=".$port['port_id'].'&from='.$config['time']['day'].'&to='.$config['time']['now'].'&width=100&height=20&legend=no&bg='.str_replace('#', '', $row_colour)."'>");
|
||||
}
|
||||
|
||||
echo '</td><td width=120>';
|
||||
echo "</td><td width=120 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
|
||||
if ($port['ifOperStatus'] == 'up') {
|
||||
$port['in_rate'] = ($port['ifInOctets_rate'] * 8);
|
||||
@@ -86,7 +86,7 @@ if ($port['ifOperStatus'] == 'up') {
|
||||
<img src='images/icons/arrow_pps_out.png' align=absmiddle> ".format_bi($port['ifOutUcastPkts_rate']).'pps</span>';
|
||||
}
|
||||
|
||||
echo '</td><td width=75>';
|
||||
echo "</td><td width=75 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
if ($port['ifSpeed']) {
|
||||
echo '<span class=box-desc>'.humanspeed($port['ifSpeed']).'</span>';
|
||||
}
|
||||
@@ -130,19 +130,19 @@ if ($device['os'] == 'ios' || $device['os'] == 'iosxe') {
|
||||
}//end if
|
||||
|
||||
if ($port_adsl['adslLineCoding']) {
|
||||
echo '</td><td width=150>';
|
||||
echo "</td><td width=150 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
echo $port_adsl['adslLineCoding'].'/'.rewrite_adslLineType($port_adsl['adslLineType']);
|
||||
echo '<br />';
|
||||
echo 'Sync:'.formatRates($port_adsl['adslAtucChanCurrTxRate']).'/'.formatRates($port_adsl['adslAturChanCurrTxRate']);
|
||||
echo '<br />';
|
||||
echo 'Max:'.formatRates($port_adsl['adslAtucCurrAttainableRate']).'/'.formatRates($port_adsl['adslAturCurrAttainableRate']);
|
||||
echo '</td><td width=150>';
|
||||
echo "</td><td width=150 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
echo 'Atten:'.$port_adsl['adslAtucCurrAtn'].'dB/'.$port_adsl['adslAturCurrAtn'].'dB';
|
||||
echo '<br />';
|
||||
echo 'SNR:'.$port_adsl['adslAtucCurrSnrMgn'].'dB/'.$port_adsl['adslAturCurrSnrMgn'].'dB';
|
||||
}
|
||||
else {
|
||||
echo '</td><td width=150>';
|
||||
echo "</td><td width=150 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
if ($port['ifType'] && $port['ifType'] != '') {
|
||||
echo '<span class=box-desc>'.fixiftype($port['ifType']).'</span>';
|
||||
}
|
||||
@@ -158,7 +158,7 @@ else {
|
||||
echo '-';
|
||||
}
|
||||
|
||||
echo '</td><td width=150>';
|
||||
echo "</td><td width=150 onclick=\"location.href='".generate_port_url($port)."'\" >";
|
||||
if ($port['ifPhysAddress'] && $port['ifPhysAddress'] != '') {
|
||||
echo '<span class=box-desc>'.formatMac($port['ifPhysAddress']).'</span>';
|
||||
}
|
||||
@@ -176,13 +176,17 @@ else {
|
||||
}//end if
|
||||
|
||||
echo '</td>';
|
||||
echo '<td width=375 valign=top class=interface-desc>';
|
||||
echo '<td width=375 valign=top class="interface-desc">';
|
||||
|
||||
$neighborsCount=0;
|
||||
$nbLinks=0;
|
||||
if (strpos($port['label'], 'oopback') === false && !$graph_type) {
|
||||
foreach (dbFetchRows('SELECT * FROM `links` AS L, `ports` AS I, `devices` AS D WHERE L.local_port_id = ? AND L.remote_port_id = I.port_id AND I.device_id = D.device_id', array($if_id)) as $link) {
|
||||
// echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generate_port_link($link, makeshortif($link['label'])) . " on " . generate_device_link($link, shorthost($link['hostname'])) . "</a><br />");
|
||||
// $br = "<br />";
|
||||
$int_links[$link['port_id']] = $link['port_id'];
|
||||
$int_links_phys[$link['port_id']] = 1;
|
||||
$nbLinks++;
|
||||
}
|
||||
|
||||
unset($br);
|
||||
@@ -233,10 +237,23 @@ if (strpos($port['label'], 'oopback') === false && !$graph_type) {
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
if(count($int_links) > 3)
|
||||
{
|
||||
echo '<div class="collapse-neighbors"><span class="neighbors-button glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
<span class="neighbors-interface-list-firsts" style="display: inline;">';
|
||||
}
|
||||
|
||||
|
||||
if ($port_details && $config['enable_port_relationship'] === true && port_permitted($int_link,$device['device_id'])) {
|
||||
foreach ($int_links as $int_link) {
|
||||
$neighborsCount++;
|
||||
if($neighborsCount == 4)
|
||||
{
|
||||
echo '<span class="neighbors-list-continued" style="display: inline;"></br>[...]</span>';
|
||||
echo '</span>';
|
||||
echo '<span class="neighbors-interface-list" style="display: none;">';
|
||||
}
|
||||
$link_if = dbFetchRow('SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.port_id = ?', array($int_link));
|
||||
|
||||
echo "$br";
|
||||
|
||||
if ($int_links_phys[$int_link]) {
|
||||
@@ -304,6 +321,10 @@ if ($port_details && $config['enable_port_relationship'] === true && port_permit
|
||||
|
||||
unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
|
||||
|
||||
if($nbLinks > 3)
|
||||
{
|
||||
echo '</span></div>';
|
||||
}
|
||||
echo '</td></tr>';
|
||||
|
||||
// If we're showing graphs, generate the graph and print the img tags
|
||||
|
||||
@@ -47,7 +47,7 @@ else {
|
||||
<div class="collapse navbar-collapse" id="navHeaderCollapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown">
|
||||
<a href="<?php echo(generate_url(array('page'=>'overview'))); ?>" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-lightbulb-o fa-fw fa-lg fa-nav-icons"></i> Overview</a>
|
||||
<a href="<?php echo(generate_url(array('page'=>'overview'))); ?>" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-lightbulb-o fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Overview</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'overview'))); ?>"><i class="fa fa-lightbulb-o fa-fw fa-lg"></i> Overview</a></li>
|
||||
<li class="dropdown-submenu">
|
||||
@@ -74,6 +74,12 @@ if ($_SESSION['userlevel'] >= '10') {
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'availability-map'))); ?>"><i class="fa fa-arrow-circle-up fa-fw fa-lg"></i> Availability</a></li>
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'map'))); ?>"><i class="fa fa-desktop fa-fw fa-lg"></i> Network</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown-submenu">
|
||||
<a href="<?php echo(generate_url(array('page'=>'overview'))); ?>"><i class="fa fa-wrench fa-fw fa-lg"></i> Tools</a>
|
||||
<ul class="dropdown-menu scrollable-menu">
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'ripenccapi'))); ?>"><i class="fa fa-arrow-circle-up fa-fw fa-lg"></i> RIPE NCC API</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li><a href="<?php echo(generate_url(array('page'=>'eventlog'))); ?>"><i class="fa fa-book fa-fw fa-lg"></i> Eventlog</a></li>
|
||||
@@ -107,7 +113,7 @@ if ( dbFetchCell("SELECT 1 from `packages` LIMIT 1") ) {
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="devices/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-server fa-fw fa-lg fa-nav-icons"></i> Devices</a>
|
||||
<a href="devices/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-server fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Devices</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="dropdown-submenu">
|
||||
<a href="devices/"><i class="fa fa-server fa-fw fa-lg"></i> All Devices</a>
|
||||
@@ -181,7 +187,7 @@ if ($_SESSION['userlevel'] >= '10') {
|
||||
if ($config['show_services']) {
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="services/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-cogs fa-fw fa-lg fa-nav-icons"></i> Services</a>
|
||||
<a href="services/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-cogs fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Services</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="services/"><i class="fa fa-cogs fa-fw fa-lg"></i> All Services </a></li>
|
||||
|
||||
@@ -210,7 +216,7 @@ if ($_SESSION['userlevel'] >= '10') {
|
||||
|
||||
<!-- PORTS -->
|
||||
<li class="dropdown">
|
||||
<a href="ports/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-link fa-fw fa-lg fa-nav-icons"></i> Ports</a>
|
||||
<a href="ports/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-link fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Ports</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="ports/"><i class="fa fa-link fa-fw fa-lg"></i> All Ports</a></li>
|
||||
|
||||
@@ -316,7 +322,7 @@ $menu_sensors = $used_sensors;
|
||||
?>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="health/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-heartbeat fa-fw fa-lg fa-nav-icons"></i> Health</a>
|
||||
<a href="health/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-heartbeat fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Health</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="health/metric=mempool/"><i class="fa fa-gears fa-fw fa-lg"></i> Memory</a></li>
|
||||
<li><a href="health/metric=processor/"><i class="fa fa-desktop fa-fw fa-lg"></i> Processor</a></li>
|
||||
@@ -367,7 +373,7 @@ $app_list = dbFetchRows("SELECT DISTINCT(`app_type`) AS `app_type` FROM `applica
|
||||
if ($_SESSION['userlevel'] >= '5' && count($app_list) > "0") {
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="apps/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-tasks fa-fw fa-lg fa-nav-icons"></i> Apps</a>
|
||||
<a href="apps/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-tasks fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Apps</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
|
||||
@@ -405,7 +411,7 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
|
||||
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="routing/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-arrows fa-fw fa-lg fa-nav-icons"></i> Routing</a>
|
||||
<a href="routing/" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-arrows fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Routing</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
$separator = 0;
|
||||
@@ -452,7 +458,7 @@ if ($_SESSION['userlevel'] >= '5' && ($routing_count['bgp']+$routing_count['ospf
|
||||
?>
|
||||
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-plug fa-fw fa-lg fa-nav-icons"></i> <span class="hidden-md hidden-sm">Plugins</span></a>
|
||||
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-plug fa-fw fa-lg fa-nav-icons hidden-md"></i> <span class="hidden-sm">Plugins</span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<?php
|
||||
Plugins::call('menu');
|
||||
@@ -482,6 +488,10 @@ if(is_file("includes/print-menubar-custom.inc.php")) {
|
||||
</div>
|
||||
</form>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<?php
|
||||
$notifications = new ObjCache('notifications');
|
||||
echo ' <li><a href="notifications/"><span class="badge count-notif">'.($notifications['sticky_count']+$notifications['count']).'</span></a></li>';
|
||||
?>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown"><i class="fa fa-cog fa-fw fa-lg fa-nav-icons"></i></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
||||
@@ -184,6 +184,10 @@ else {
|
||||
|
||||
<?php
|
||||
|
||||
if(empty($_SESSION['screen_width']) && empty($_SESSION['screen_height'])) {
|
||||
echo "<script>updateResolution();</script>";
|
||||
}
|
||||
|
||||
if ((isset($vars['bare']) && $vars['bare'] != "yes") || !isset($vars['bare'])) {
|
||||
if ($_SESSION['authenticated']) {
|
||||
require 'includes/print-menubar.php';
|
||||
|
||||
+2
-2
@@ -32,5 +32,5 @@ $(document).ready(function(){
|
||||
function lazyload_done() {
|
||||
//Since RRD takes the width and height params for only the canvas, we must unset them
|
||||
//from the final (larger) image to prevent the browser from resizing them.
|
||||
$(this).removeAttr('width').removeAttr('height').removeClass('lazy');
|
||||
}
|
||||
$(this).removeAttr('height').removeClass('lazy');
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ function override_config(event, state, tmp_this) {
|
||||
});
|
||||
}
|
||||
|
||||
var oldH;
|
||||
var oldW;
|
||||
$(document).ready(function() {
|
||||
// Device override ajax calls
|
||||
$("[name='override_config']").bootstrapSwitch('offColor','danger');
|
||||
@@ -126,6 +128,9 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
oldW=$(window).width();
|
||||
oldH=$(window).height();
|
||||
});
|
||||
|
||||
function submitCustomRange(frmdata) {
|
||||
@@ -139,3 +144,82 @@ function submitCustomRange(frmdata) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateResolution(refresh)
|
||||
{
|
||||
$.post('ajax_setresolution.php',
|
||||
{
|
||||
width: $(window).width(),
|
||||
height:$(window).height()
|
||||
},
|
||||
function(data) {
|
||||
if(refresh == true) {
|
||||
location.reload();
|
||||
}
|
||||
},'json'
|
||||
);
|
||||
}
|
||||
|
||||
var rtime;
|
||||
var timeout = false;
|
||||
var delta = 500;
|
||||
var newH;
|
||||
var newW;
|
||||
|
||||
$(window).on('resize', function(){
|
||||
rtime = new Date();
|
||||
if (timeout === false) {
|
||||
timeout = true;
|
||||
setTimeout(resizeend, delta);
|
||||
}
|
||||
});
|
||||
|
||||
function resizeend() {
|
||||
if (new Date() - rtime < delta) {
|
||||
setTimeout(resizeend, delta);
|
||||
}
|
||||
else {
|
||||
newH=$(window).height();
|
||||
newW=$(window).width();
|
||||
timeout = false;
|
||||
if(Math.abs(oldW - newW) >= 200)
|
||||
{
|
||||
refresh = true;
|
||||
}
|
||||
else {
|
||||
refresh = false;
|
||||
resizeGraphs();
|
||||
}
|
||||
updateResolution(refresh);
|
||||
}
|
||||
};
|
||||
|
||||
function resizeGraphs() {
|
||||
ratioW=newW/oldW;
|
||||
ratioH=newH/oldH;
|
||||
|
||||
$('.graphs').each(function (){
|
||||
var img = jQuery(this);
|
||||
img.attr('width',img.width() * ratioW);
|
||||
});
|
||||
oldH=newH;
|
||||
oldW=newW;
|
||||
}
|
||||
|
||||
|
||||
$(document).on("click", '.collapse-neighbors', function(event)
|
||||
{
|
||||
var caller = $(this);
|
||||
var button = caller.find('.neighbors-button');
|
||||
var list = caller.find('.neighbors-interface-list');
|
||||
var continued = caller.find('.neighbors-list-continued');
|
||||
|
||||
if(button.hasClass("glyphicon-plus")) {
|
||||
button.addClass('glyphicon-minus').removeClass('glyphicon-plus');
|
||||
}
|
||||
else {
|
||||
button.addClass('glyphicon-plus').removeClass('glyphicon-minus');
|
||||
}
|
||||
|
||||
list.toggle();
|
||||
continued.toggle();
|
||||
});
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
<form name="form1" action="" method="post" class="form-horizontal">
|
||||
<link rel="stylesheet" href="<?php echo $config['base_url']; ?>/css/bootstrap.min.css">
|
||||
<script type="text/javascript">
|
||||
function showWarning(checked) {
|
||||
$('#warning').toggle();
|
||||
@@ -12,22 +10,24 @@
|
||||
}
|
||||
</script>
|
||||
<input type="hidden" name="action" value="delete_bill">
|
||||
<fieldset>
|
||||
<legend>Delete Bill</legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="confirm"><strong>Confirm</strong></label>
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="confirm" value="confirm" onchange="javascript: showWarning(this.checked);">
|
||||
Yes, please delete this bill!
|
||||
<h3>Delete Bill</h3>
|
||||
<hr>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="confirm"><strong>Confirm</strong></label>
|
||||
<div class="controls">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="confirm" value="confirm" onchange="javascript: showWarning(this.checked);">
|
||||
Yes, please delete this bill!
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-message" id="warning" style="display: none;">
|
||||
<h4 class="alert-heading"><i class="icon-warning-sign"></i> Warning!</h4>
|
||||
Are you sure you want to delete his bill?
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<br>
|
||||
<div class="alert alert-danger" id="warning" style="display: none;">
|
||||
<h4 class="alert-heading"><i class="fa fa-exclamation-triangle"></i> Warning</h4>
|
||||
You are about to delete this bill.
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button id="deleteBtn" type="submit" class="btn btn-danger" disabled="disabled"><i class="icon-trash icon-white"></i> <strong>Delete Bill</strong></button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<form name="form1" action="" method="post" class="form-horizontal">
|
||||
<link rel="stylesheet" href="<?php echo $config['base_url']; ?>/css/bootstrap.min.css">
|
||||
<script type="text/javascript">
|
||||
function showWarning() {
|
||||
var checked = $('input:checked').length;
|
||||
@@ -13,27 +12,31 @@
|
||||
}
|
||||
</script>
|
||||
<input type="hidden" name="action" value="reset_bill">
|
||||
<fieldset>
|
||||
<legend>Reset Bill</legend>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="confirm"><strong>Confirm</strong></label>
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="confirm" value="mysql" onchange="javascript: showWarning();">
|
||||
Yes, please reset MySQL data for all interfaces on this bill!
|
||||
<h3>Reset Bill</h3>
|
||||
<hr>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="confirm"><strong>Confirm</strong></label>
|
||||
<div class="controls">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="confirm" value="mysql" onchange="javascript: showWarning();">
|
||||
Yes, please reset MySQL data for all interfaces on this bill!
|
||||
</label>
|
||||
<label class="checkbox">
|
||||
<input disabled type="checkbox" name="confirm" value="rrd" onchange="javascript: showWarning();">
|
||||
Yes, please reset RRD data for all interfaces on this bill!
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input disabled type="checkbox" name="confirm" value="rrd" onchange="javascript: showWarning();">
|
||||
Yes, please reset RRD data for all interfaces on this bill!
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="alert alert-message" id="warning" style="display: none;">
|
||||
<h4 class="alert-heading"><i class="icon-warning-sign"></i> Warning!</h4>
|
||||
Are you sure you want to reset all <strong>MySQL</strong> and/or <strong>RRD</strong> data for all interface on this bill?
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<br>
|
||||
<div class="alert alert-danger" id="warning" style="display: none;">
|
||||
<h4 class="alert-heading"><i class="fa fa-exclamation-triangle"></i> Warning</h4>
|
||||
Are you sure you want to reset all <strong>MySQL</strong> and/or <strong>RRD</strong> data for all interface on this bill?
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button id="resetBtn" type="submit" class="btn btn-danger" disabled="disabled"><i class="icon-refresh icon-white"></i> <strong>Reset Bill</strong></button>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
@@ -33,7 +33,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
|
||||
}
|
||||
|
||||
echo '<div class="panel panel-default">';
|
||||
echo '<table style="margin: 0px 7px 7px 7px;" cellspacing="0" class="devicetable" width="99%">';
|
||||
echo '<table class="device-header-table" style="margin: 0px 7px 7px 7px;" cellspacing="0" class="devicetable" width="99%">';
|
||||
require 'includes/device-header.inc.php';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'processor_usage';
|
||||
|
||||
$processors = dbFetchRows('SELECT * FROM `processors` WHERE device_id = ?', array($device['device_id']));
|
||||
|
||||
if (count($processors)) {
|
||||
@@ -16,44 +14,90 @@ if (count($processors)) {
|
||||
echo '</div>
|
||||
<table class="table table-hover table-condensed table-striped">';
|
||||
|
||||
$graph_array = array();
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['type'] = 'processor_usage';
|
||||
$graph_array['from'] = $config['time']['day'];
|
||||
$graph_array['legend'] = 'no';
|
||||
|
||||
$totalPercent=0;
|
||||
|
||||
foreach ($processors as $proc) {
|
||||
$text_descr = rewrite_entity_descr($proc['processor_descr']);
|
||||
|
||||
// disable short hrDeviceDescr. need to make this prettier.
|
||||
// $text_descr = short_hrDeviceDescr($proc['processor_descr']);
|
||||
$percent = $proc['processor_usage'];
|
||||
$background = get_percentage_colours($percent);
|
||||
$graph_colour = str_replace('#', '', $row_colour);
|
||||
if ($config['cpu_details_overview'] === true)
|
||||
{
|
||||
|
||||
$graph_array = array();
|
||||
$background = get_percentage_colours($percent);
|
||||
|
||||
$graph_array['id'] = $proc['processor_id'];
|
||||
|
||||
//Generate tooltip graphs
|
||||
$graph_array['height'] = '100';
|
||||
$graph_array['width'] = '210';
|
||||
$link_array = $graph_array;
|
||||
$link_array['page'] = 'graphs';
|
||||
unset($link_array['height'], $link_array['width'], $link_array['legend']);
|
||||
$link = generate_url($link_array);
|
||||
$overlib_content = generate_overlib_content($graph_array, $device['hostname'].' - '.$text_descr);
|
||||
|
||||
//Generate the minigraph
|
||||
$graph_array['width'] = 80;
|
||||
$graph_array['height'] = 20;
|
||||
$graph_array['bg'] = 'ffffff00'; // the 00 at the end makes the area transparent.
|
||||
$minigraph = generate_lazy_graph_tag($graph_array);
|
||||
|
||||
echo '<tr>
|
||||
<td>'.overlib_link($link, $text_descr, $overlib_content).'</td>
|
||||
<td>'.overlib_link($link, $minigraph, $overlib_content).'</td>
|
||||
<td>'.overlib_link($link, print_percentage_bar(200, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']), $overlib_content).'
|
||||
</a></td>
|
||||
</tr>';
|
||||
}
|
||||
else {
|
||||
$totalPercent = $totalPercent + $percent;
|
||||
}
|
||||
|
||||
}//end foreach
|
||||
|
||||
if ($config['cpu_details_overview'] === false)
|
||||
{
|
||||
|
||||
//Generate average cpu graph
|
||||
$graph_array['height'] = '100';
|
||||
$graph_array['width'] = '210';
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['id'] = $proc['processor_id'];
|
||||
$graph_array['type'] = $graph_type;
|
||||
$graph_array['from'] = $config['time']['day'];
|
||||
$graph_array['legend'] = 'no';
|
||||
$graph_array['width'] = '485';
|
||||
$graph_array['device'] = $device['device_id'];
|
||||
$graph_array['type'] = 'device_processor';
|
||||
$graph = generate_lazy_graph_tag($graph_array);
|
||||
|
||||
//Generate link to graphs
|
||||
$link_array = $graph_array;
|
||||
$link_array['page'] = 'graphs';
|
||||
unset($link_array['height'], $link_array['width'], $link_array['legend']);
|
||||
unset($link_array['height'], $link_array['width']);
|
||||
$link = generate_url($link_array);
|
||||
|
||||
$overlib_content = generate_overlib_content($graph_array, $device['hostname'].' - '.$text_descr);
|
||||
|
||||
$graph_array['width'] = 80;
|
||||
$graph_array['height'] = 20;
|
||||
$graph_array['bg'] = 'ffffff00';
|
||||
// the 00 at the end makes the area transparent.
|
||||
$minigraph = generate_lazy_graph_tag($graph_array);
|
||||
//Generate tooltip
|
||||
$graph_array['width'] = '210';
|
||||
$overlib_content = generate_overlib_content($graph_array, $device['hostname'].' - CPU usage');
|
||||
|
||||
echo '<tr>
|
||||
<td>'.overlib_link($link, $text_descr, $overlib_content).'</td>
|
||||
<td>'.overlib_link($link, $minigraph, $overlib_content).'</td>
|
||||
<td>'.overlib_link($link, print_percentage_bar(200, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']), $overlib_content).'
|
||||
</a></td>
|
||||
</tr>';
|
||||
}//end foreach
|
||||
<td colspan="4">';
|
||||
echo overlib_link($link, $graph, $overlib_content, null);
|
||||
echo ' </td>
|
||||
</tr>';
|
||||
|
||||
//Add a row with CPU desc, count and percent graph
|
||||
$totalPercent=$totalPercent/count($processors);
|
||||
$background = get_percentage_colours($totalPercent);
|
||||
|
||||
echo '<tr>
|
||||
<td>'.overlib_link($link, $text_descr, $overlib_content).'</td>
|
||||
<td>'.overlib_link($link,'x'.count($processors),$overlib_content).'</td>
|
||||
<td>'.overlib_link($link, print_percentage_bar(200, 20, $totalPercent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']), $overlib_content).'</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
|
||||
echo '</table>
|
||||
</div>
|
||||
|
||||
@@ -103,9 +103,11 @@ if ($vars['view'] == 'minigraphs') {
|
||||
echo "<div style='display: block; padding: 3px; margin: 3px; min-width: 183px; max-width:183px; min-height:90px; max-height:90px; text-align: center; float: left; background-color: #e9e9e9;'>
|
||||
<div style='font-weight: bold;'>".makeshortif($port['ifDescr']).'</div>
|
||||
<a href="'.generate_port_url($port)."\" onmouseover=\"return overlib('\
|
||||
<div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #e5e5e5;\'>".$device['hostname'].' - '.$port['ifDescr'].'</div>\
|
||||
<div style=\'background-color: #ffffff;\'>\
|
||||
<div style=\'font-size: 16px; padding:5px; font-weight: bold; color: #555;\'>".$device['hostname'].' - '.$port['ifDescr'].'</div>\
|
||||
'.$port['ifAlias']." \
|
||||
<img src=\'graph.php?type=".$graph_type.'&id='.$port['port_id'].'&from='.$from.'&to='.$config['time']['now']."&width=450&height=150\'>\
|
||||
</div>\
|
||||
', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" >"."<img src='graph.php?type=".$graph_type.'&id='.$port['port_id'].'&from='.$from.'&to='.$config['time']['now']."&width=180&height=45&legend=no'>
|
||||
</a>
|
||||
<div style='font-size: 9px;'>".truncate(short_port_descr($port['ifAlias']), 32, '').'</div>
|
||||
@@ -121,8 +123,19 @@ else {
|
||||
if ($vars['view'] == 'details') {
|
||||
$port_details = 1;
|
||||
}
|
||||
?>
|
||||
<div style='margin: 0px;'><table class='table'>
|
||||
<tr>
|
||||
<th width="350"><A href="<?php echo generate_url($vars, array('sort' => "port")); ?>">Port</a></th>
|
||||
<th width="100"></th>
|
||||
<th width="120"><a href="<?php echo generate_url($vars, array('sort' => "traffic")); ?>">Traffic</a></th>
|
||||
<th width="75">Speed</th>
|
||||
<th width="100">Media</th>
|
||||
<th width="100">Mac Address</th>
|
||||
<th width="375"></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
echo "<div style='margin: 0px;'><table class='table'>";
|
||||
$i = '1';
|
||||
|
||||
global $port_cache, $port_index_cache;
|
||||
@@ -130,9 +143,20 @@ else {
|
||||
$ports = dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `deleted` = '0' ORDER BY `ifIndex` ASC", array($device['device_id']));
|
||||
// As we've dragged the whole database, lets pre-populate our caches :)
|
||||
// FIXME - we should probably split the fetching of link/stack/etc into functions and cache them here too to cut down on single row queries.
|
||||
foreach ($ports as $port) {
|
||||
|
||||
foreach ($ports as $key => $port) {
|
||||
$port_cache[$port['port_id']] = $port;
|
||||
$port_index_cache[$port['device_id']][$port['ifIndex']] = $port;
|
||||
$ports[$key]["ifOctets_rate"] = $port["ifInOctets_rate"] + $port["ifOutOctets_rate"];
|
||||
}
|
||||
|
||||
switch ($vars["sort"]) {
|
||||
case 'traffic':
|
||||
$ports = array_sort($ports, 'ifOctets_rate', SORT_DESC);
|
||||
break;
|
||||
default:
|
||||
$ports = array_sort($ports, 'ifIndex', SORT_ASC);
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($ports as $port) {
|
||||
|
||||
@@ -98,13 +98,13 @@ if ($_SESSION['userlevel'] >= '7') {
|
||||
list($oid,$date,$version) = explode('|',mres($_POST['config']));
|
||||
$text = file_get_contents($config['oxidized']['url'].'/node/version/view?node='.$device['hostname'].'&group=&oid='.$oid.'&date='.urlencode($date).'&num='.$version.'&format=text');
|
||||
if ($text == 'node not found') {
|
||||
$text = file_get_contents($config['oxidized']['url'].'/node/version/view?node='.$device['hostname'].'&group='.$device['os'].'&oid='.$oid.'&date='.urlencode($date).'&num='.$version.'&format=text');
|
||||
$text = file_get_contents($config['oxidized']['url'].'/node/version/view?node='.$device['hostname'].'&group='.(is_array($node_info) ? $node_info['group'] : $device['os']).'&oid='.$oid.'&date='.urlencode($date).'&num='.$version.'&format=text');
|
||||
}
|
||||
}
|
||||
else {
|
||||
$text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.$device['hostname']);
|
||||
if ($text == 'node not found') {
|
||||
$text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.$device['os'].'/'.$device['hostname']);
|
||||
$text = file_get_contents($config['oxidized']['url'].'/node/fetch/'.(is_array($node_info) ? $node_info['group'] : $device['os']).'/'.$device['hostname']);
|
||||
}
|
||||
}
|
||||
if ($config['oxidized']['features']['versioning'] === true) {
|
||||
|
||||
@@ -194,14 +194,10 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
|
||||
|
||||
<span class="message" id="message"></span>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="gridster grid">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -237,9 +233,12 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
dashboard_collapse();
|
||||
gridster = $(".gridster ul").gridster({
|
||||
widget_base_dimensions: [100, 100],
|
||||
widget_base_dimensions: ['auto', 100],
|
||||
autogenerate_stylesheet: true,
|
||||
widget_margins: [5, 5],
|
||||
avoid_overlapped_widgets: true,
|
||||
min_cols: 1,
|
||||
max_cols: 20,
|
||||
draggable: {
|
||||
handle: 'header, span',
|
||||
stop: function(e, ui, $widget) {
|
||||
@@ -263,6 +262,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
|
||||
};
|
||||
}
|
||||
}).data('gridster');
|
||||
$('.gridster ul').css({'width': $(window).width()});
|
||||
|
||||
gridster.remove_all_widgets();
|
||||
gridster.disable();
|
||||
|
||||
@@ -85,7 +85,7 @@ else {
|
||||
$thumb_array = array('sixhour' => '6 Hours', 'day' => '24 Hours', 'twoday' => '48 Hours', 'week' => 'One Week', 'twoweek' => 'Two Weeks',
|
||||
'month' => 'One Month', 'twomonth' => 'Two Months','year' => 'One Year', 'twoyear' => 'Two Years');
|
||||
|
||||
echo('<table width=100%><tr>');
|
||||
echo('<table width=100% class="thumbnail_graph_table"><tr>');
|
||||
|
||||
foreach ($thumb_array as $period => $text) {
|
||||
$graph_array['from'] = $config['time'][$period];
|
||||
@@ -111,6 +111,24 @@ else {
|
||||
$graph_array['height'] = "300";
|
||||
$graph_array['width'] = $graph_width;
|
||||
|
||||
if($_SESSION['screen_width']) {
|
||||
if($_SESSION['screen_width'] > 800) {
|
||||
$graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/10));
|
||||
}
|
||||
else {
|
||||
$graph_array['width'] = ($_SESSION['screen_width'] - ($_SESSION['screen_width']/4));
|
||||
}
|
||||
}
|
||||
|
||||
if($_SESSION['screen_height']) {
|
||||
if($_SESSION['screen_height'] > 960 ) {
|
||||
$graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/2));
|
||||
}
|
||||
else {
|
||||
$graph_array['height'] = ($_SESSION['screen_height'] - ($_SESSION['screen_height']/1.5));
|
||||
}
|
||||
}
|
||||
|
||||
echo("<hr />");
|
||||
|
||||
include_once 'includes/print-date-selector.inc.php';
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Daniel Preussker, QuxLabs UG <preussker@quxlabs.com>
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/**
|
||||
* Notification Page
|
||||
* @author Daniel Preussker
|
||||
* @copyright 2015 Daniel Preussker, QuxLabs UG
|
||||
* @license GPL
|
||||
* @package LibreNMS
|
||||
* @subpackage Notifications
|
||||
*/
|
||||
|
||||
$notifications = new ObjCache('notifications');
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1><a href="/notifications">Notifications</a></h1>
|
||||
<h4><strong class="count-notif"><?php echo $notifications['count']; ?></strong> Unread Notifications <?php echo ($_SESSION['userlevel'] == 10 ? '<button class="btn btn-success pull-right new-notif" style="margin-top:-10px;">New</button>' : ''); ?></h4>
|
||||
<hr/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container new-notif-collapse">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form class="form-horizontal new-notif-form">
|
||||
<div class="form-group">
|
||||
<label for="notif_title" class="col-sm-2 control-label">Title</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="notif_title" name="notif_title" placeholder="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="notif_body" class="col-sm-2 control-label">Message</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="notif_body" name="notif_body"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-success">Add Notification</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!isset($vars['archive'])) { ?>
|
||||
<div class="container">
|
||||
<?php
|
||||
foreach ($notifications['sticky'] as $notif) {
|
||||
if (is_numeric($notif['source'])) {
|
||||
$notif['source'] = dbFetchCell('select username from users where user_id =?',array($notif['source']));
|
||||
} ?>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 class="text-warning" id="<?php echo $notif['notifications_id']; ?>"><strong><i class="fa fa-bell-o"></i> <?php echo $notif['title']; ?></strong> <span class="pull-right"><?php echo ($notif['user_id'] != $_SESSION['user_id'] ? '<code>Sticky by '.dbFetchCell('select username from users where user_id = ?',array($notif['user_id'])).'</code>' : '<button class="btn btn-primary fa fa-bell-slash-o unstick-notif" data-toggle="tooltip" data-placement="bottom" title="Remove Sticky" style="margin-top:-10px;"></button>'); ?></span></h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<blockquote>
|
||||
<p><?php echo $notif['body']; ?></p>
|
||||
<footer>Source: <code><?php echo $notif['source']; ?></code></footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php if ($notifications['sticky_count'] != 0) { ?>
|
||||
<hr/>
|
||||
<?php } ?>
|
||||
<?php
|
||||
foreach ($notifications['unread'] as $notif) {
|
||||
if (is_numeric($notif['source'])) {
|
||||
$notif['source'] = dbFetchCell('select username from users where user_id =?',array($notif['source']));
|
||||
} ?>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 class="text-success" id="<?php echo $notif['notifications_id']; ?>"><strong><?php echo $notif['title']; ?></strong><span class="pull-right">
|
||||
<?php echo ($_SESSION['userlevel'] == 10 ? '<button class="btn btn-primary fa fa-bell-o stick-notif" data-toggle="tooltip" data-placement="bottom" title="Mark as Sticky" style="margin-top:-10px;"></button>' : ''); ?>
|
||||
|
||||
<button class="btn btn-primary fa fa-eye read-notif" data-toggle="tooltip" data-placement="bottom" title="Mark as Read" style="margin-top:-10px;"></button>
|
||||
</span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<blockquote>
|
||||
<p><?php echo $notif['body']; ?></p>
|
||||
<footer>Source: <code><?php echo $notif['source']; ?></code></footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h3><a class="btn btn-default" href="/notifications/archive">Show Archive</a></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else if (isset($vars['archive'])) { ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Archive</h2>
|
||||
</div>
|
||||
</div>
|
||||
<?php foreach (array_reverse($notifications['read']) as $notif) { ?>
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h4 id="<?php echo $notif['notifications_id']; ?>"><?php echo $notif['title']; echo ($_SESSION['userlevel'] == 10 ? '<span class="pull-right"><button class="btn btn-primary fa fa-bell-o stick-notif" data-toggle="tooltip" data-placement="bottom" title="Mark as Sticky" style="margin-top:-10px;"></button></span>' : ''); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<blockquote>
|
||||
<p><?php echo $notif['body']; ?></p>
|
||||
<footer>Source: <code><?php echo $notif['source']; ?></code></footer>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<script>
|
||||
$(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.new-notif-collapse').fadeOut(0);
|
||||
$(document).on( "click", ".new-notif", function() {
|
||||
$('.new-notif-collapse').fadeToggle();
|
||||
});
|
||||
|
||||
$(document).on( "submit", ".new-notif-form", function() {
|
||||
var notif = {};
|
||||
data = $(this).serializeArray();
|
||||
for( var field in data ) {
|
||||
notif[data[field].name] = data[field].value;
|
||||
}
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: {type: 'notifications', title: notif.notif_title, body: notif.notif_body, action: 'create'},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if( data.status == "ok" ) {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
window.location.href="/notifications";
|
||||
}
|
||||
else {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$(document).on( "click", ".read-notif", function() {
|
||||
$(this).attr("disabled", true);
|
||||
var notif = $(this).parent().parent().attr('id');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: {type: 'notifications', notification_id: notif, action: 'read'},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if( data.status == "ok" ) {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
$("#"+notif).parent().parent().parent().fadeOut();
|
||||
$(".count-notif").each(function(){
|
||||
this.innerHTML = this.innerHTML-1;
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(this).attr("disabled", false);
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on( "click", ".stick-notif", function() {
|
||||
var notif = $(this).parent().parent().attr('id');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: {type: 'notifications', notification_id: notif, action: 'stick'},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if( data.status == "ok" ) {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
window.location.href="/notifications";
|
||||
}
|
||||
else {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on( "click", ".unstick-notif", function() {
|
||||
var notif = $(this).parent().parent().attr('id');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: {type: 'notifications', notification_id: notif, action: 'unstick'},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if( data.status == "ok" ) {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
window.location.href="/notifications";
|
||||
}
|
||||
else {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* 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. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
$pagetitle[] = 'RIPE NCC - API Tools';
|
||||
?>
|
||||
<h3> RIPE NCC API Tools </h3>
|
||||
<hr>
|
||||
<form class="form-horizontal" action="" method="post">
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="data_radio" value="abuse-contact-finder">Abuse Contact Finder</label>
|
||||
</div>
|
||||
<div class="radio">
|
||||
<label><input type="radio" name="data_radio" value="whois">Whois</label>
|
||||
</div>
|
||||
<br />
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="input-parameter" placeholder="IP, ASN etc.">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" name="btn-query" id="btn-query" class="btn btn-primary">Query</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
<br />
|
||||
<div id="ripe-output" class="alert alert-success" style="display: none;"></div>
|
||||
<br />
|
||||
<script>
|
||||
$("[name='btn-query']").on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this);
|
||||
var data_param = $('input[name=data_radio]:checked').val();
|
||||
var query_param = $("#input-parameter").val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: {
|
||||
type: "query-ripenccapi",
|
||||
data_param: data_param,
|
||||
query_param: query_param
|
||||
},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$('#ripe-output').empty();
|
||||
$("#ripe-output").show();
|
||||
if (data.output.data.records)
|
||||
$.each(data.output.data.records[0], function(row, value) {
|
||||
$('#ripe-output').append(value['key'] + ' = ' + value['value'] + '<br />');
|
||||
});
|
||||
else if (data.output.data.anti_abuse_contacts.abuse_c)
|
||||
$.each(data.output.data.anti_abuse_contacts.abuse_c, function(row, value) {
|
||||
$('#ripe-output').append(value['description'] + ' = ' + value['email'] + '<br />');
|
||||
});
|
||||
},
|
||||
error: function() {
|
||||
toastr.error('Error');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -266,7 +266,7 @@ else {
|
||||
$peer_ip = $peer['bgpLocalAddr'];
|
||||
}
|
||||
|
||||
$localaddresslink = "<span class=list-large><a href='device/device=".$peer['device_id']."/tab=routing/proto=bgp/' onmouseover=\"return overlib('<img src=\'$local_daily_url\'>', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer_ip.'</a></span>';
|
||||
$localaddresslink = "<span class=list-large><a href='device/device=".$peer['device_id']."/tab=routing/proto=bgp/' onmouseover=\"return overlib('<div style=\'background-color: #ffffff;\'><img src=\'$local_daily_url\'></div>', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer_ip.'</a></span>';
|
||||
|
||||
$graph_type = 'bgp_updates';
|
||||
$peer_daily_url = 'graph.php?id='.$peer['bgpPeer_id'].'&type='.$graph_type.'&from='.$config['time']['day'].'&to='.$config['time']['now'].'&width=500&height=150';
|
||||
@@ -277,7 +277,7 @@ else {
|
||||
$peer_ident = $peer['bgpPeerIdentifier'];
|
||||
}
|
||||
|
||||
$peeraddresslink = "<span class=list-large><a href='device/device=".$peer['device_id']."/tab=routing/proto=bgp/' onmouseover=\"return overlib('<img src=\'$peer_daily_url\'>', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer_ident.'</a></span>';
|
||||
$peeraddresslink = "<span class=list-large><a href='device/device=".$peer['device_id']."/tab=routing/proto=bgp/' onmouseover=\"return overlib('<div style=\'background-color: #ffffff;\'><img src=\'$peer_daily_url\'></div>', LEFT".$config['overlib_defaults'].');" onmouseout="return nd();">'.$peer_ident.'</a></span>';
|
||||
|
||||
echo '<tr class="bgp"'.($peer['alert'] ? ' bordercolor="#cc0000"' : '').($peer['disabled'] ? ' bordercolor="#cccccc"' : '').'>';
|
||||
|
||||
|
||||
@@ -720,6 +720,116 @@ echo '<div id="boxcar_appkey_template" class="hide">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#victorops_transport_expand">VictorOps</a> <button name="test-alert" id="test-alert" type="button" data-transport="victorops" class="btn btn-primary btn-xs pull-right">Test transport</button>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="victorops_transport_expand" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group has-feedback">
|
||||
<label for="victorops" class="col-sm-4 control-label">Post URL </label>
|
||||
<div data-toggle="tooltip" title="'.$config_groups['alert.transports.victorops.url']['config_descr'].'" class="toolTip glyphicon glyphicon-question-sign"></div>
|
||||
<div class="col-sm-4">
|
||||
<input id="victorops" class="form-control" type="text" name="global-config-input" value="'.$config_groups['alert.transports.victorops.url']['config_value'].'" data-config_id="'.$config_groups['alert.transports.victorops.url']['config_id'].'">
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$clickatell = get_config_by_name('alert.transports.clickatell.token');
|
||||
$mobiles = get_config_like_name('alert.transports.clickatell.to.%');
|
||||
$new_mobiles = array();
|
||||
foreach ($mobiles as $mobile) {
|
||||
$new_mobiles[] = $mobile['config_value'];
|
||||
}
|
||||
$upd_mobiles = implode(PHP_EOL, $new_mobiles);
|
||||
|
||||
echo '
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#clickatell_transport_expand">Clickatell transport</a> <button name="test-alert" id="test-alert" type="button" data-transport="clickatell" class="btn btn-primary btn-xs pull-right">Test transport</button>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="clickatell_transport_expand" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group has-feedback">
|
||||
<label for="clickatell_token" class="col-sm-4 control-label">Clickatell Token </label>
|
||||
<div class="col-sm-4">
|
||||
<input id="clickatell_token" class="form-control" type="text" name="global-config-input" value="'.$clickatell['config_value'].'" data-config_id="'.$clickatell['config_id'].'">
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label for="clickatell_to" class="col-sm-4 control-label">Mobile numbers</label>
|
||||
<div class="col-sm-4">
|
||||
<textarea class="form-control" name="global-config-textarea" id="clickatell_to" placeholder="Enter the config options" data-config_id="'.$clickatell['config_id'].'" data-type="clickatell">'.$upd_mobiles.'</textarea>
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
$playsms_url = get_config_by_name('alert.transports.playsms.url');
|
||||
$playsms_user = get_config_by_name('alert.transports.playsms.user');
|
||||
$playsms_token = get_config_by_name('alert.transports.playsms.token');
|
||||
$playsms_from = get_config_by_name('alert.transports.playsms.from');
|
||||
$mobiles = get_config_like_name('alert.transports.playsms.to.%');
|
||||
$new_mobiles = array();
|
||||
foreach ($mobiles as $mobile) {
|
||||
$new_mobiles[] = $mobile['config_value'];
|
||||
}
|
||||
$upd_mobiles = implode(PHP_EOL, $new_mobiles);
|
||||
echo '
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#playsms_transport_expand">PlaySMS transport</a> <button name="test-alert" id="test-alert" type="button" data-transport="playsms" class="btn btn-primary btn-xs pull-right">Test transport</button>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="playsms_transport_expand" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group has-feedback">
|
||||
<label for="playsms_url" class="col-sm-4 control-label">PlaySMS URL </label>
|
||||
<div class="col-sm-4">
|
||||
<input id="playsms_url" class="form-control" type="text" name="global-config-input" value="'.$playsms_url['config_value'].'" data-config_id="'.$playsms_url['config_id'].'">
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label for="playsms_user" class="col-sm-4 control-label">User</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="playsms_user" class="form-control" type="text" name="global-config-input" value="'.$playsms_user['config_value'].'" data-config_id="'.$playsms_user['config_id'].'">
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label for="playsms_token" class="col-sm-4 control-label">Token</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="playsms_token" class="form-control" type="text" name="global-config-input" value="'.$playsms_token['config_value'].'" data-config_id="'.$playsms_token['config_id'].'">
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label for="playsms_from" class="col-sm-4 control-label">From</label>
|
||||
<div class="col-sm-4">
|
||||
<input id="playsms_from" class="form-control" type="text" name="global-config-input" value="'.$playsms_from['config_value'].'" data-config_id="'.$playsms_from['config_id'].'">
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<label for="clickatell_to" class="col-sm-4 control-label">Mobiles</label>
|
||||
<div class="col-sm-4">
|
||||
<textarea class="form-control" name="global-config-textarea" id="playsms_to" placeholder="Enter the config options" data-config_id="'.$playsms_url['config_id'].'" data-type="playsms">'.$upd_mobiles.'</textarea>
|
||||
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
';
|
||||
|
||||
Reference in New Issue
Block a user