Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • dev_api
  • github/fork/vyskocilpavel/bootstrap
  • main
  • v1.0
  • v1.1
  • v1.2
  • v1.3
  • v1.4
  • v1.5
  • v2.0
  • v3.0
  • v3.1
  • v3.2
  • v4.0
  • v4.1
  • v4.2
  • v4.3
  • v1.0.0
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v2.0.0
  • v2.1.0
  • v3.0.0
  • v3.1.0
  • v3.2.0
  • v3.2.1
  • v4.0.0
  • v4.1.0
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.3.0
  • v5.0.0
  • v6.0.0
  • v7.0.0
  • v7.0.1
  • v7.0.2
  • v7.1.0
  • v7.1.1
  • v8.0.0
  • v8.1.0
  • v8.1.1
  • v8.2.0
  • v8.3.0
  • v8.4.0
  • v8.5.0
51 results

Target

Select target project
  • perun/perun-proxyidp/v1/simplesamlphp-module-proxystatistics
1 result
Select Git revision
  • dev_api
  • github/fork/vyskocilpavel/bootstrap
  • main
  • v1.0
  • v1.1
  • v1.2
  • v1.3
  • v1.4
  • v1.5
  • v2.0
  • v3.0
  • v3.1
  • v3.2
  • v4.0
  • v4.1
  • v4.2
  • v4.3
  • v1.0.0
  • v1.1.0
  • v1.2.0
  • v1.2.1
  • v1.3.0
  • v1.4.0
  • v1.4.1
  • v1.5.0
  • v2.0.0
  • v2.1.0
  • v3.0.0
  • v3.1.0
  • v3.2.0
  • v3.2.1
  • v4.0.0
  • v4.1.0
  • v4.2.0
  • v4.2.1
  • v4.2.2
  • v4.3.0
  • v5.0.0
  • v6.0.0
  • v7.0.0
  • v7.0.1
  • v7.0.2
  • v7.1.0
  • v7.1.1
  • v8.0.0
  • v8.1.0
  • v8.1.1
  • v8.2.0
  • v8.3.0
  • v8.4.0
  • v8.5.0
51 results
Show changes
{
"extends": [
"config:base",
":automergeBranch",
":automergeLinters",
":automergePatch",
":automergeTesters",
":enableVulnerabilityAlertsWithLabel(security)",
":maintainLockFilesWeekly",
":pinOnlyDevDependencies",
":prNotPending",
":rebaseStalePrs",
":semanticCommits",
"npm:unpublishSafe"
],
"composerIgnorePlatformReqs": ["ext-json"],
"stabilityDays": 3,
"transitiveRemediation": true
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>perun-proxy-aai/renovate-config"]
}
<?php
declare(strict_types=1);
/**
* Script for migrate statistics data from version < 1.6.x to version > 2.0.0.
*
......@@ -14,6 +12,8 @@ declare(strict_types=1);
* @author: Pavel Vyskocil <vyskocilpavel@muni.cz>
*/
declare(strict_types=1);
// Absolute path to CSV file with data about identityProviders
$identityProvidersFileName = '';
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module\proxystatistics\Templates;
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
?>
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module\proxystatistics\Templates;
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
use SimpleSAML\Module\proxystatistics\Config;
use SimpleSAML\Module\proxystatistics\Templates;
......
<?php declare(strict_types=1);
<?php
declare(strict_types=1);
?>
<div class="timeRange">
......
......@@ -381,10 +381,6 @@
"@dl-horizontal-breakpoint": "@grid-float-breakpoint",
"@hr-border": "@gray-lighter"
},
"css": [
"type.less",
"grid.less",
"tables.less"
],
"css": ["type.less", "grid.less", "tables.less"],
"js": []
}
\ No newline at end of file
}
#content, #languagebar, #header {
max-width: 100%;
padding: 0 40px;
#content,
#languagebar,
#header {
max-width: 100%;
padding: 0 40px;
}
#content, #footer {
padding: 0;
#content,
#footer {
padding: 0;
}
h1, h2, h3 {
h1,
h2,
h3 {
padding: 0 40px;
}
#wrap {
max-width: 100%;
max-width: 100%;
}
#loginsDashboard {
height: 500px;
height: 500px;
}
#line_div {
height: 260px;
height: 260px;
}
#control_div {
height: 40px;
height: 40px;
}
#dateSelector label{
font-weight: normal;
#dateSelector label {
font-weight: normal;
}
#summaryIDP {
padding-bottom: 20px;
padding-bottom: 20px;
}
.tabset_tabs {
padding-left: 20px;
padding-left: 20px;
}
.timeRange {
padding-left: 40px;
padding-left: 40px;
}
.legend-logins {
padding-left: 40px;
padding-left: 40px;
}
.legend {
padding-left: 40px;
padding-bottom: 20px;
padding-left: 40px;
padding-bottom: 20px;
}
.go-to-stats-btn {
padding-left: 40px;
padding-left: 40px;
}
.legend-container, .canvas-container, .table-container {
height: 90vh;
max-height: 500px;
width: 100%;
.legend-container,
.canvas-container,
.table-container {
height: 90vh;
max-height: 500px;
width: 100%;
}
.hidden {
display: none;
display: none;
}
.pie-chart-container .legend-container, .table-container {
overflow-y: auto;
.pie-chart-container .legend-container,
.table-container {
overflow-y: auto;
}
.chart-legend .item {
display: inline-block;
text-indent: -2.5em;
margin-left: 2.5em;
display: inline-block;
text-indent: -2.5em;
margin-left: 2.5em;
}
.chart-legend li .item:before {
content: '';
display: inline-block;
width: 2em;
height: 0.7em;
margin-right: 0.5em;
}
.chart-legend li:nth-child(20n+1) .item:before { background-color: #3366CC; }
.chart-legend li:nth-child(20n+2) .item:before { background-color: #DC3912; }
.chart-legend li:nth-child(20n+3) .item:before { background-color: #FF9900; }
.chart-legend li:nth-child(20n+4) .item:before { background-color: #109618; }
.chart-legend li:nth-child(20n+5) .item:before { background-color: #990099; }
.chart-legend li:nth-child(20n+6) .item:before { background-color: #3B3EAC; }
.chart-legend li:nth-child(20n+7) .item:before { background-color: #0099C6; }
.chart-legend li:nth-child(20n+8) .item:before { background-color: #DD4477; }
.chart-legend li:nth-child(20n+9) .item:before { background-color: #66AA00; }
.chart-legend li:nth-child(20n+10) .item:before { background-color: #B82E2E; }
.chart-legend li:nth-child(20n+11) .item:before { background-color: #316395; }
.chart-legend li:nth-child(20n+12) .item:before { background-color: #994499; }
.chart-legend li:nth-child(20n+13) .item:before { background-color: #22AA99; }
.chart-legend li:nth-child(20n+14) .item:before { background-color: #AAAA11; }
.chart-legend li:nth-child(20n+15) .item:before { background-color: #6633CC; }
.chart-legend li:nth-child(20n+16) .item:before { background-color: #E67300; }
.chart-legend li:nth-child(20n+17) .item:before { background-color: #8B0707; }
.chart-legend li:nth-child(20n+18) .item:before { background-color: #329262; }
.chart-legend li:nth-child(20n+19) .item:before { background-color: #5574A6; }
.chart-legend li:nth-child(20n) .item:before { background-color: #3B3EAC; }
.chart-legend li.other .item:before { background-color: #DDDDDD; }
.legend-container ul, .legend-container li {
list-style-type: none;
content: "";
display: inline-block;
width: 2em;
height: 0.7em;
margin-right: 0.5em;
}
.chart-legend li:nth-child(20n + 1) .item:before {
background-color: #3366cc;
}
.chart-legend li:nth-child(20n + 2) .item:before {
background-color: #dc3912;
}
.chart-legend li:nth-child(20n + 3) .item:before {
background-color: #ff9900;
}
.chart-legend li:nth-child(20n + 4) .item:before {
background-color: #109618;
}
.chart-legend li:nth-child(20n + 5) .item:before {
background-color: #990099;
}
.chart-legend li:nth-child(20n + 6) .item:before {
background-color: #3b3eac;
}
.chart-legend li:nth-child(20n + 7) .item:before {
background-color: #0099c6;
}
.chart-legend li:nth-child(20n + 8) .item:before {
background-color: #dd4477;
}
.chart-legend li:nth-child(20n + 9) .item:before {
background-color: #66aa00;
}
.chart-legend li:nth-child(20n + 10) .item:before {
background-color: #b82e2e;
}
.chart-legend li:nth-child(20n + 11) .item:before {
background-color: #316395;
}
.chart-legend li:nth-child(20n + 12) .item:before {
background-color: #994499;
}
.chart-legend li:nth-child(20n + 13) .item:before {
background-color: #22aa99;
}
.chart-legend li:nth-child(20n + 14) .item:before {
background-color: #aaaa11;
}
.chart-legend li:nth-child(20n + 15) .item:before {
background-color: #6633cc;
}
.chart-legend li:nth-child(20n + 16) .item:before {
background-color: #e67300;
}
.chart-legend li:nth-child(20n + 17) .item:before {
background-color: #8b0707;
}
.chart-legend li:nth-child(20n + 18) .item:before {
background-color: #329262;
}
.chart-legend li:nth-child(20n + 19) .item:before {
background-color: #5574a6;
}
.chart-legend li:nth-child(20n) .item:before {
background-color: #3b3eac;
}
.chart-legend li.other .item:before {
background-color: #dddddd;
}
.legend-container ul,
.legend-container li {
list-style-type: none;
}
.table-container.scrolling th {
background-color: white;
box-shadow: 0 4px 5px -5px #666;
background-color: white;
box-shadow: 0 4px 5px -5px #666;
}
.table-container a, .chart-legend a {
border: 0;
.table-container a,
.chart-legend a {
border: 0;
}
.table-container a:not(:hover):not(:focus):not(:active),
.chart-legend a:not(:hover):not(:focus):not(:active) {
text-decoration: none;
text-decoration: none;
}
'use strict';
"use strict";
/* global Chart moment */
function getStatisticsData(name) {
return $.parseJSON($('#' + name).attr('content'));
return $.parseJSON($("#" + name).attr("content"));
}
function getStatisticsDataYMDC(name, field) {
......@@ -12,19 +12,23 @@ function getStatisticsDataYMDC(name, field) {
d.setHours(0);
return {
x: d,
y: item[field]
y: item[field],
};
});
}
function getTranslation(str) {
return $.parseJSON($('#translations').attr('content'))[str];
return $.parseJSON($("#translations").attr("content"))[str];
}
function extendData(data, minX, maxX) {
var i = 0;
var extendedData = [];
for (var d = new Date(minX); d <= maxX; d.setDate(d.getDate() + 1),d.setHours(0)) {
for (
var d = new Date(minX);
d <= maxX;
d.setDate(d.getDate() + 1), d.setHours(0)
) {
if (data[i].x.getTime() === d.getTime()) {
extendedData.push(data[i]);
i += 1;
......@@ -48,8 +52,8 @@ function drawLoginsChart(getEl) {
previousChart.destroy();
}
var data = getStatisticsDataYMDC('loginCountPerDay', 'count');
var data2 = getStatisticsDataYMDC('loginCountPerDay', 'users');
var data = getStatisticsDataYMDC("loginCountPerDay", "count");
var data2 = getStatisticsDataYMDC("loginCountPerDay", "users");
if (!data.length || !data2.length) {
return;
......@@ -61,102 +65,122 @@ function drawLoginsChart(getEl) {
data = extendData(data, minX, maxX);
data2 = extendData(data2, minX, maxX);
new Chart(ctx, { // eslint-disable-line no-new
type: 'bar',
new Chart(ctx, {
// eslint-disable-line no-new
type: "bar",
options: {
maintainAspectRatio: false,
plugins: {
tooltips: {
intersect: false,
mode: 'index',
mode: "index",
callbacks: {
label: function showLabel(tooltipItem) {
var label = tooltipItem.label || '';
var label = tooltipItem.label || "";
if (label) {
label += ': ';
label += ": ";
}
label += tooltipItem.parsed;
return label;
}
}
}
},
},
},
},
scales: {
x: {
beginAtZero: true,
type: 'time',
time: { // do not set round: 'day', because it breaks zooming out from 7 or fewer days
type: "time",
time: {
// do not set round: 'day', because it breaks zooming out from 7 or fewer days
isoWeekday: true,
minUnit: 'day',
tooltipFormat: 'l'
}
minUnit: "day",
tooltipFormat: "l",
},
},
y: {
beginAtZero: true,
title: {
display: false
}
}
display: false,
},
},
},
zoom: {
limits: {
x: {min: minX, max: maxX}
x: { min: minX, max: maxX },
},
pan: {
enabled: true,
mode: 'x'
mode: "x",
},
zoom: {
wheel: {
enabled: true
enabled: true,
},
pinch: {
enabled: true
enabled: true,
},
/*drag: {
enabled: false
},*/
mode: 'x'
mode: "x",
},
}
},
},
data: {
datasets: [
{
label: getTranslation("of_users"),
data: data2,
type: "line",
pointRadius: 0,
fill: false,
lineTension: 0,
borderWidth: 2,
backgroundColor: "#3b3eac",
borderColor: "#3b3eac",
},
{
label: getTranslation("of_logins"),
data: data,
type: "line",
pointRadius: 0,
fill: false,
lineTension: 0,
borderWidth: 2,
backgroundColor: "#f90",
borderColor: "#f90",
},
],
},
"data": {
"datasets": [
{
label: getTranslation('of_users'),
data: data2,
type: 'line',
pointRadius: 0,
fill: false,
lineTension: 0,
borderWidth: 2,
backgroundColor: '#3b3eac',
borderColor: '#3b3eac'
},
{
label: getTranslation('of_logins'),
data: data,
type: 'line',
pointRadius: 0,
fill: false,
lineTension: 0,
borderWidth: 2,
backgroundColor: '#f90',
borderColor: '#f90'
}
]
}
});
}
var pieColors = [
'#3366CC', '#DC3912', '#FF9900', '#109618', '#990099', '#3B3EAC', '#0099C6', '#DD4477', '#66AA00', '#B82E2E',
'#316395', '#994499', '#22AA99', '#AAAA11', '#6633CC', '#E67300', '#8B0707', '#329262', '#5574A6', '#3B3EAC'
"#3366CC",
"#DC3912",
"#FF9900",
"#109618",
"#990099",
"#3B3EAC",
"#0099C6",
"#DD4477",
"#66AA00",
"#B82E2E",
"#316395",
"#994499",
"#22AA99",
"#AAAA11",
"#6633CC",
"#E67300",
"#8B0707",
"#329262",
"#5574A6",
"#3B3EAC",
];
var minPieFraction = 0.005;
var minPieOtherFraction = 0.01;
var maxPieOtherFraction = 0.20;
var maxPieOtherFraction = 0.2;
var pieOtherOnlyIfNeeded = false;
function processDataForPieChart(data, viewCols) {
......@@ -169,10 +193,12 @@ function processDataForPieChart(data, viewCols) {
}, 0);
var i = data.length;
var othersFraction = 0;
while (i > 1
&& (i > pieColors.length
|| (data[i - 1][col[1]] / total < minPieFraction
&& data[i - 1][col[1]] / total + othersFraction < maxPieOtherFraction))) {
while (
i > 1 &&
(i > pieColors.length ||
(data[i - 1][col[1]] / total < minPieFraction &&
data[i - 1][col[1]] / total + othersFraction < maxPieOtherFraction))
) {
i -= 1;
othersFraction += data[i][col[1]] / total;
}
......@@ -184,7 +210,7 @@ function processDataForPieChart(data, viewCols) {
if (i < data.length && othersFraction > 0) {
var theOthers = [null, null, null];
theOthers[col[1]] = Math.round(othersFraction * total);
theOthers[col[0]] = getTranslation('other');
theOthers[col[0]] = getTranslation("other");
processedData.push(theOthers);
}
return { data: processedData, other: othersFraction > 0, total: total };
......@@ -194,14 +220,17 @@ function drawPieChart(dataName, viewCols, url, getEl) {
var el = getEl();
if (!el) return;
var ctx = el.getContext('2d');
var ctx = el.getContext("2d");
var previousChart = Chart.getChart(ctx);
if (previousChart) {
previousChart.destroy();
}
var processedData = processDataForPieChart(getStatisticsData(dataName), viewCols);
var processedData = processDataForPieChart(
getStatisticsData(dataName),
viewCols
);
var data = processedData.data;
if (!data.length) {
......@@ -213,48 +242,60 @@ function drawPieChart(dataName, viewCols, url, getEl) {
var col = viewCols || [0, 1];
var colors = pieColors.slice();
if (other) {
colors[data.length - 1] = '#DDDDDD';
colors[data.length - 1] = "#DDDDDD";
}
var chart = new Chart(ctx, {
type: 'pie',
data: {
labels: data.map(function getFirst(row) { return row[col[0]]; }),
datasets: [{
data: data.map(function getSecond(row) { return row[col[1]]; }),
backgroundColor: colors,
borderWidth: 1
}]
},
options: {
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right'
},
tooltip: {
callbacks: {
label: function generateLabel(tooltipItem) {
var label = tooltipItem.label || '';
if (label) {
label += ': ';
}
var value = tooltipItem.parsed;
label += value + ' (';
label += Math.round((value / total) * 1000) / 10;
label += ' %)';
return label;
type: "pie",
data: {
labels: data.map(function getFirst(row) {
return row[col[0]];
}),
datasets: [
{
data: data.map(function getSecond(row) {
return row[col[1]];
}),
backgroundColor: colors,
borderWidth: 1,
},
],
},
options: {
maintainAspectRatio: false,
plugins: {
legend: {
position: "right",
},
tooltip: {
callbacks: {
label: function generateLabel(tooltipItem) {
var label = tooltipItem.label || "";
if (label) {
label += ": ";
}
}
}
}
}
var value = tooltipItem.parsed;
label += value + " (";
label += Math.round((value / total) * 1000) / 10;
label += " %)";
return label;
},
},
},
},
},
});
if (url) {
el.addEventListener('click', function pieClick(evt) {
var activePoints = chart.getElementsAtEventForMode(evt, 'nearest', { intersect: true }, false);
el.addEventListener("click", function pieClick(evt) {
var activePoints = chart.getElementsAtEventForMode(
evt,
"nearest",
{ intersect: true },
false
);
if (activePoints.length) {
window.location.href = url + encodeURIComponent(data[activePoints[0].index][1]);
window.location.href =
url + encodeURIComponent(data[activePoints[0].index][1]);
}
});
}
......@@ -262,77 +303,101 @@ function drawPieChart(dataName, viewCols, url, getEl) {
function getDrawChart(side) {
return drawPieChart.bind(
null,
'loginCountPer' + side,
[0, 2],
getStatisticsData('module_url_base') + 'detail.php?side=' + side + '&id='
null,
"loginCountPer" + side,
[0, 2],
getStatisticsData("module_url_base") + "detail.php?side=" + side + "&id="
);
}
function drawCountTable(cols, dataCol, countCol, dataName, allowHTML, url, getEl) {
function drawCountTable(
cols,
dataCol,
countCol,
dataName,
allowHTML,
url,
getEl
) {
var el = getEl();
if (!el) return;
var viewCols = [dataCol, countCol];
var tableDiv = el.appendChild(document.createElement('div'));
tableDiv.className = 'table-responsive';
var tableDiv = el.appendChild(document.createElement("div"));
tableDiv.className = "table-responsive";
var table = tableDiv.appendChild(document.createElement('table'));
table.className = 'table table-striped table-hover table-condensed';
var table = tableDiv.appendChild(document.createElement("table"));
table.className = "table table-striped table-hover table-condensed";
var data = getStatisticsData(dataName);
var thead = table.appendChild(document.createElement('thead'));
var tr = thead.appendChild(document.createElement('tr'));
var thead = table.appendChild(document.createElement("thead"));
var tr = thead.appendChild(document.createElement("tr"));
var th;
var i;
for (i = 0; i < viewCols.length; i++) {
th = tr.appendChild(document.createElement('th'));
th = tr.appendChild(document.createElement("th"));
th.innerText = getTranslation(cols[i]);
if (viewCols[i] === countCol) {
th.className = 'text-right';
th.className = "text-right";
}
}
var tbody = table.appendChild(document.createElement('tbody'));
var tbody = table.appendChild(document.createElement("tbody"));
var td;
var a;
for (var j = 0; j < data.length; j++) {
tr = tbody.appendChild(document.createElement('tr'));
tr = tbody.appendChild(document.createElement("tr"));
for (i = 0; i < viewCols.length; i++) {
td = tr.appendChild(document.createElement('td'));
td = tr.appendChild(document.createElement("td"));
if (viewCols[i] === countCol) {
td.className = 'text-right';
td.className = "text-right";
}
if (url && viewCols[i] === dataCol) {
a = document.createElement('a');
a[allowHTML ? 'innerHTML' : 'innerText'] = data[j][viewCols[i]];
a = document.createElement("a");
a[allowHTML ? "innerHTML" : "innerText"] = data[j][viewCols[i]];
a.href = url + encodeURIComponent(data[j][1]);
td.appendChild(a);
} else {
td[allowHTML ? 'innerHTML' : 'innerText'] = data[j][viewCols[i]];
td[allowHTML ? "innerHTML" : "innerText"] = data[j][viewCols[i]];
}
}
}
el.addEventListener('scroll', function floatingTableHead() {
el.addEventListener("scroll", function floatingTableHead() {
var scrolling = el.scrollTop > 0;
el.classList.toggle('scrolling', scrolling);
el.querySelectorAll('th').forEach(function floatTh(the) {
the.style.transform = scrolling ? ('translateY(' + el.scrollTop + 'px)') : ''; // eslint-disable-line no-param-reassign
el.classList.toggle("scrolling", scrolling);
el.querySelectorAll("th").forEach(function floatTh(the) {
the.style.transform = scrolling
? "translateY(" + el.scrollTop + "px)"
: ""; // eslint-disable-line no-param-reassign
});
});
}
function getDrawTable(side) {
return drawCountTable.bind(null,
['tables_' + side, 'count'], 0, 2, 'loginCountPer' + side, false,
getStatisticsData('module_url_base') + 'detail.php?side=' + side + '&id=');
return drawCountTable.bind(
null,
["tables_" + side, "count"],
0,
2,
"loginCountPer" + side,
false,
getStatisticsData("module_url_base") + "detail.php?side=" + side + "&id="
);
}
function getDrawCountTable(side) {
return drawCountTable.bind(null, ['tables_' + side, 'count'], 0, 2, 'accessCounts', true, null);
return drawCountTable.bind(
null,
["tables_" + side, "count"],
0,
2,
"accessCounts",
true,
null
);
}
function getterLoadCallback(getEl, callback) {
......@@ -340,7 +405,9 @@ function getterLoadCallback(getEl, callback) {
}
function classLoadCallback(className, callback) {
getterLoadCallback(function () { return $('.' + className + ':visible')[0]; }, callback); // eslint-disable-line func-names
getterLoadCallback(function () {
return $("." + className + ":visible")[0];
}, callback); // eslint-disable-line func-names
}
function idLoadCallback(id, callback) {
......@@ -348,28 +415,31 @@ function idLoadCallback(id, callback) {
}
function chartInit() {
idLoadCallback('loginsDashboard', drawLoginsChart);
['IDP', 'SP'].forEach(function callbacksForSide(side) {
classLoadCallback('chart-' + side + 'Chart', getDrawChart(side));
idLoadCallback(side + 'Table', getDrawTable(side));
idLoadCallback('detail' + side + 'Chart', drawPieChart.bind(null, 'accessCounts', [0, 2], null));
idLoadCallback('detail' + side + 'Table', getDrawCountTable(side));
idLoadCallback("loginsDashboard", drawLoginsChart);
["IDP", "SP"].forEach(function callbacksForSide(side) {
classLoadCallback("chart-" + side + "Chart", getDrawChart(side));
idLoadCallback(side + "Table", getDrawTable(side));
idLoadCallback(
"detail" + side + "Chart",
drawPieChart.bind(null, "accessCounts", [0, 2], null)
);
idLoadCallback("detail" + side + "Table", getDrawCountTable(side));
});
$('#dateSelector input[name=lastDays]').on('click', function submitForm() {
$("#dateSelector input[name=lastDays]").on("click", function submitForm() {
this.form.submit();
});
}
$(document).ready(function docReady() {
var loginsDashboard = document.getElementById('loginsDashboard');
var loginsDashboard = document.getElementById("loginsDashboard");
if (loginsDashboard !== null && loginsDashboard.dataset.locale) {
moment.locale(loginsDashboard.dataset.locale);
}
$('#tabdiv').tabs({
selected: $('#tabdiv').data('activetab'),
load: chartInit
$("#tabdiv").tabs({
selected: $("#tabdiv").data("activetab"),
load: chartInit,
});
chartInit();
});
......@@ -32,7 +32,12 @@ $passwordHash = $config->getApiWritePasswordHash();
// If we get here, username was provided. Check password.
if ($authUsername !== $username || !password_verify($authPass, $passwordHash)) {
Logger::info(
'proxystatistics:writeLoginApi - API write called with bad credentials (' . $authUsername . ':' . $authPass . ') returning 401 response code'
sprintf(
"%s - API write called with bad credentials (%s:%s) returning 401 response code",
"proxystatistics:writeLoginApi",
$authUsername,
$authPass
)
);
header('HTTP/1.0 401 Unauthorized');
exit;
......@@ -45,11 +50,15 @@ try {
exit;
}
if (!empty(array_diff(
[
DatabaseCommand::API_USER_ID, DatabaseCommand::API_SERVICE_IDENTIFIER, DatabaseCommand::API_SERVICE_NAME, DatabaseCommand::API_IDP_IDENTIFIER, DatabaseCommand::API_IDP_NAME, ],
array_keys($data)
))) {
if (
!empty(array_diff([
DatabaseCommand::API_USER_ID,
DatabaseCommand::API_SERVICE_IDENTIFIER,
DatabaseCommand::API_SERVICE_NAME,
DatabaseCommand::API_IDP_IDENTIFIER,
DatabaseCommand::API_IDP_NAME
], array_keys($data)))
) {
header('HTTP/1.0 400 Bad Request');
exit;
}
......