Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit ae204f9

Browse files
committed
Removed unused functions
1 parent cb2a5a5 commit ae204f9

File tree

3 files changed

+2
-76
lines changed

3 files changed

+2
-76
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ All notable changes to this project will be documented in this file.
1313
[Fixed]
1414
- Draws tables data by selected time range
1515

16+
[Removed]
17+
- Removed unused functions
1618

1719
## [v1.3.0]
1820
[Added]

lib/Auth/Process/DatabaseCommand.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -77,38 +77,6 @@ public static function getLoginCountPerDay($days)
7777
}
7878

7979

80-
public static function getLoginCountPerDeyPerService()
81-
{
82-
$databaseConnector = new DatabaseConnector();
83-
$conn = $databaseConnector->getConnection();
84-
assert($conn != NULL);
85-
$identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName();
86-
$identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName();
87-
$stmt = $conn->prepare("SELECT year, month, IFNULL(name,sourceIdp) AS idPName, SUM(count) AS count FROM ".$identityProvidersTableName. " LEFT OUTER JOIN " . $identityProvidersMapTableName . " ON sourceIdp = entityId GROUP BY year, month, sourceIdp HAVING sourceIdp != '' ORDER BY year DESC, month DESC, count DESC");
88-
$stmt->execute();
89-
$result = $stmt->get_result();
90-
while($row = $result->fetch_assoc()) {
91-
echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".str_replace("'","\'",$row["idPName"])."', {v:".$row["count"]."}],";
92-
}
93-
$conn->close();
94-
}
95-
96-
public static function getAccessToServicesPerMonth()
97-
{
98-
$databaseConnector = new DatabaseConnector();
99-
$conn = $databaseConnector->getConnection();
100-
assert($conn != NULL);
101-
$serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName();
102-
$serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName();
103-
$stmt = $conn->prepare("SELECT year, month, IFNULL(name,service) AS spName, SUM(count) AS count FROM ".$serviceProvidersTableName." LEFT OUTER JOIN " . $serviceProvidersMapTableName . " ON service = identifier GROUP BY year DESC, month DESC, service HAVING service != '' ORDER BY year DESC, month DESC, count DESC");
104-
$stmt->execute();
105-
$result = $stmt->get_result();
106-
while($row = $result->fetch_assoc()) {
107-
echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".str_replace("'","\'",$row["spName"])."', {v:".$row["count"]."}],";
108-
}
109-
$conn->close();
110-
}
111-
11280
public static function getCountOfAllLogins()
11381
{
11482
$databaseConnector = new DatabaseConnector();

templates/summary-tpl.php

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<script type="text/javascript">
1515
google.charts.load('current', {'packages':['corechart', 'controls', 'table']});
1616
google.charts.setOnLoadCallback(drawLoginsChart);
17-
google.charts.setOnLoadCallback(drawLoginsTable);
1817

1918
function drawLoginsChart() {
2019
var data = google.visualization.arrayToDataTable([
@@ -42,22 +41,7 @@ function drawLoginsChart() {
4241
dashboard.draw(data);
4342
}
4443

45-
function drawLoginsTable() {
46-
var data = new google.visualization.DataTable();
47-
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_date}'); ?>');
48-
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
49-
data.addRows([<?php DatabaseCommand::getLoginCountPerDay($lastDays)?>]);
50-
51-
var table = new google.visualization.Table(document.getElementById('loginsTable'));
52-
53-
var formatter = new google.visualization.DateFormat({pattern: "d MMMM yyyy"});
54-
formatter.format(data, 0); // Apply formatter to second column
55-
56-
table.draw(data, {showRowNumber: false,});
57-
}
58-
5944
google.charts.setOnLoadCallback(drawIdpsChart);
60-
google.charts.setOnLoadCallback(drawIdpsTable);
6145

6246
function drawIdpsChart() {
6347
var data = google.visualization.arrayToDataTable([
@@ -76,23 +60,8 @@ function drawIdpsChart() {
7660
chart.draw(data, options);
7761
}
7862

79-
function drawIdpsTable() {
80-
var data = new google.visualization.DataTable();
81-
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>');
82-
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_identity_provider}'); ?>');
83-
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
84-
data.addRows([<?php DatabaseCommand::getLoginCountPerDeyPerService()?>]);
85-
86-
var table = new google.visualization.Table(document.getElementById('idpsTable'));
87-
88-
var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"});
89-
formatter.format(data, 0); // Apply formatter to second column
90-
91-
table.draw(data);
92-
}
9363

9464
google.charts.setOnLoadCallback(drawSpsChart);
95-
google.charts.setOnLoadCallback(drawSpsTable);
9665

9766
function drawSpsChart() {
9867
var data = google.visualization.arrayToDataTable([
@@ -111,20 +80,7 @@ function drawSpsChart() {
11180
chart.draw(data, options);
11281
}
11382

114-
function drawSpsTable() {
115-
var data = new google.visualization.DataTable();
116-
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>');
117-
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_service_provider}'); ?>');
118-
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
119-
data.addRows([<?php DatabaseCommand::getAccessToServicesPerMonth()?>]);
12083

121-
var table = new google.visualization.Table(document.getElementById('spsTable'));
122-
123-
var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"});
124-
formatter.format(data, 0); // Apply formatter to second column
125-
126-
table.draw(data);
127-
}
12884
</script>
12985
</head>
13086

0 commit comments

Comments
 (0)