Skip to content
Snippets Groups Projects
Unverified Commit 7c5ee218 authored by Pavel Vyskočil's avatar Pavel Vyskočil
Browse files

Fixed indentation

* Used only tabs for indentations
parent 7f4ce247
Branches
Tags
No related merge requests found
...@@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file. ...@@ -8,6 +8,9 @@ All notable changes to this project will be documented in this file.
[Changed] [Changed]
- Storing entityIds instead of SpName/IdPName. - Storing entityIds instead of SpName/IdPName.
[Fixed]
- Used only tabs for indentations
## [v1.2.1] ## [v1.2.1]
[Fixed] [Fixed]
- Fixed the problem with getting utf8 chars from database - Fixed the problem with getting utf8 chars from database
......
...@@ -8,82 +8,82 @@ ...@@ -8,82 +8,82 @@
$config = array( $config = array(
/* /*
* Fill the serverName * Fill the serverName
*/ */
'serverName' => 'localhost', 'serverName' => 'localhost',
/* /*
* If you want to use the default port, please comment option 'port' * If you want to use the default port, please comment option 'port'
*/ */
'port' => 3306, 'port' => 3306,
/* /*
* Fill the user name * Fill the user name
*/ */
'userName' => 'stats', 'userName' => 'stats',
/* /*
* Fill the password * Fill the password
*/ */
'password' => 'stats', 'password' => 'stats',
/* /*
* Fill the database name * Fill the database name
*/ */
'databaseName' => 'STATS', 'databaseName' => 'STATS',
/* /*
* Fill the table name for identityProviders * Fill the table name for identityProviders
*/ */
'identityProvidersTableName' => 'identityProviders', 'identityProvidersTableName' => 'identityProviders',
/* /*
* Fill the table name for identityProvidersMap * Fill the table name for identityProvidersMap
*/ */
'identityProvidersMapTableName' => 'identityProvidersMap', 'identityProvidersMapTableName' => 'identityProvidersMap',
/* /*
* Fill the table name for serviceProviders * Fill the table name for serviceProviders
*/ */
'serviceProvidersTableName' => 'serviceProviders', 'serviceProvidersTableName' => 'serviceProviders',
/* /*
* Fill the table name for serviceProviders * Fill the table name for serviceProviders
*/ */
'serviceProvidersMapTableName' => 'serviceProvidersMap', 'serviceProvidersMapTableName' => 'serviceProvidersMap',
/* /*
* Fill true, if you want to use encryption, false if not. * Fill true, if you want to use encryption, false if not.
*/ */
'encryption' => true/false, 'encryption' => true/false,
/* /*
* The path name to the certificate authority file. * The path name to the certificate authority file.
* *
* If you use encryption, you must fill this option. * If you use encryption, you must fill this option.
*/ */
'ssl_ca' => '/example/ca.pem', 'ssl_ca' => '/example/ca.pem',
/* /*
* The path name to the certificate file. * The path name to the certificate file.
* *
* If you use encryption, you must fill this option. * If you use encryption, you must fill this option.
*/ */
'ssl_cert_path' => '/example/cert.pem', 'ssl_cert_path' => '/example/cert.pem',
/* /*
* The path name to the key file. * The path name to the key file.
* *
* If you use encryption, you must fill this option. * If you use encryption, you must fill this option.
*/ */
'ssl_key_path' => '/example/key.pem', 'ssl_key_path' => '/example/key.pem',
/* /*
* The pathname to a directory that contains trusted SSL CA certificates in PEM format. * The pathname to a directory that contains trusted SSL CA certificates in PEM format.
* *
* If you use encryption, you must fill this option. * If you use encryption, you must fill this option.
*/ */
'ssl_ca_path' => '/etc/ssl', 'ssl_ca_path' => '/etc/ssl',
); );
...@@ -7,217 +7,217 @@ include ("DatabaseConnector.php"); ...@@ -7,217 +7,217 @@ include ("DatabaseConnector.php");
class DatabaseCommand class DatabaseCommand
{ {
public static function insertLogin(&$request, &$date) public static function insertLogin(&$request, &$date)
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName(); $identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName();
$identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName(); $identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName();
$serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName(); $serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName();
$serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName(); $serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName();
$idpEntityID = $request['saml:sp:IdP']; $idpEntityID = $request['saml:sp:IdP'];
$idpName = $request['Attributes']['sourceIdPName'][0]; $idpName = $request['Attributes']['sourceIdPName'][0];
$spEntityId = $request['Destination']['entityid']; $spEntityId = $request['Destination']['entityid'];
$spName = $request['Destination']['name']['en']; $spName = $request['Destination']['name']['en'];
$year = $date->format('Y'); $year = $date->format('Y');
$month = $date->format('m'); $month = $date->format('m');
$day = $date->format('d'); $day = $date->format('d');
if (is_null($idpEntityID) || empty($idpEntityID) || is_null($spEntityId) || empty($spEntityId)) { if (is_null($idpEntityID) || empty($idpEntityID) || is_null($spEntityId) || empty($spEntityId)) {
SimpleSAML\Logger::error("Some from attribute: 'idpEntityId', 'idpName', 'spEntityId' and 'spName' is null or empty and login log wasn't inserted into the database."); SimpleSAML\Logger::error("Some from attribute: 'idpEntityId', 'idpName', 'spEntityId' and 'spName' is null or empty and login log wasn't inserted into the database.");
} else { } else {
$stmt = $conn->prepare("INSERT INTO ".$identityProvidersTableName."(year, month, day, sourceIdp, count) VALUES (?, ?, ?, ?, '1') ON DUPLICATE KEY UPDATE count = count + 1"); $stmt = $conn->prepare("INSERT INTO ".$identityProvidersTableName."(year, month, day, sourceIdp, count) VALUES (?, ?, ?, ?, '1') ON DUPLICATE KEY UPDATE count = count + 1");
$stmt->bind_param("iiis", $year, $month, $day, $idpEntityID); $stmt->bind_param("iiis", $year, $month, $day, $idpEntityID);
if ($stmt->execute() === FALSE) { if ($stmt->execute() === FALSE) {
SimpleSAML\Logger::error("The login log wasn't inserted into table: " . $identityProvidersTableName . "."); SimpleSAML\Logger::error("The login log wasn't inserted into table: " . $identityProvidersTableName . ".");
} }
$stmt = $conn->prepare("INSERT INTO ".$serviceProvidersTableName."(year, month, day, service, count) VALUES (?, ?, ?, ?, '1') ON DUPLICATE KEY UPDATE count = count + 1"); $stmt = $conn->prepare("INSERT INTO ".$serviceProvidersTableName."(year, month, day, service, count) VALUES (?, ?, ?, ?, '1') ON DUPLICATE KEY UPDATE count = count + 1");
$stmt->bind_param("iiis", $year, $month, $day, $spEntityId); $stmt->bind_param("iiis", $year, $month, $day, $spEntityId);
if ($stmt->execute() === FALSE) { if ($stmt->execute() === FALSE) {
SimpleSAML\Logger::error("The login log wasn't inserted into into table: " . $serviceProvidersTableName . "."); SimpleSAML\Logger::error("The login log wasn't inserted into into table: " . $serviceProvidersTableName . ".");
} }
if (is_null($idpName) || empty($idpName)) { if (is_null($idpName) || empty($idpName)) {
$stmt->prepare("INSERT INTO " . $identityProvidersMapTableName . "(entityId, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE name = ?"); $stmt->prepare("INSERT INTO " . $identityProvidersMapTableName . "(entityId, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE name = ?");
$stmt->bind_param("sss", $idpEntityID, $idpName, $idpName); $stmt->bind_param("sss", $idpEntityID, $idpName, $idpName);
$stmt->execute(); $stmt->execute();
} }
if (is_null($spName) || empty($spName)) { if (is_null($spName) || empty($spName)) {
$stmt->prepare("INSERT INTO " . $serviceProvidersMapTableName . "(identifier, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE name = ?"); $stmt->prepare("INSERT INTO " . $serviceProvidersMapTableName . "(identifier, name) VALUES (?, ?) ON DUPLICATE KEY UPDATE name = ?");
$stmt->bind_param("sss", $spEntityId, $spName, $spName); $stmt->bind_param("sss", $spEntityId, $spName, $spName);
$stmt->execute(); $stmt->execute();
} }
} }
SimpleSAML\Logger::error("The login log was successfully stored in database"); SimpleSAML\Logger::error("The login log was successfully stored in database");
$conn->close(); $conn->close();
} }
public static function getLoginCountPerDay() public static function getLoginCountPerDay()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getIdentityProvidersTableName(); $table_name = $databaseConnector->getIdentityProvidersTableName();
$stmt = $conn->prepare("SELECT year, month, day, SUM(count) AS count FROM ".$table_name." GROUP BY year DESC,month DESC,day DESC"); $stmt = $conn->prepare("SELECT year, month, day, SUM(count) AS count FROM ".$table_name." GROUP BY year DESC,month DESC,day DESC");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "[new Date(".$row["year"].",". ($row["month"] - 1 ). ", ".$row["day"]."), {v:".$row["count"]."}],"; echo "[new Date(".$row["year"].",". ($row["month"] - 1 ). ", ".$row["day"]."), {v:".$row["count"]."}],";
} }
$conn->close(); $conn->close();
} }
public static function getLoginCountPerDeyPerService() public static function getLoginCountPerDeyPerService()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName(); $identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName();
$identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName(); $identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName();
$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"); $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");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".$row["idPName"]."', {v:".$row["count"]."}],"; echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".$row["idPName"]."', {v:".$row["count"]."}],";
} }
$conn->close(); $conn->close();
} }
public static function getAccessToServicesPerMonth() public static function getAccessToServicesPerMonth()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName(); $serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName();
$serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName(); $serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName();
$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"); $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");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".$row["spName"]."', {v:".$row["count"]."}],"; } echo "[new Date(".$row["year"].",".($row["month"] - 1 )."),'".$row["spName"]."', {v:".$row["count"]."}],"; }
$conn->close(); $conn->close();
} }
public static function getCountOfAllLogins() public static function getCountOfAllLogins()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getIdentityProvidersTableName(); $table_name = $databaseConnector->getIdentityProvidersTableName();
$stmt = $conn->prepare("SELECT SUM(count) AS count FROM " . $table_name); $stmt = $conn->prepare("SELECT SUM(count) AS count FROM " . $table_name);
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
$count = $row["count"]; $count = $row["count"];
} }
$conn->close(); $conn->close();
if ($count === null) if ($count === null)
{ {
$count = 0; $count = 0;
} }
echo $count; echo $count;
} }
public static function getCountOfAllLoginsForToday() public static function getCountOfAllLoginsForToday()
{ {
$count = 0; $count = 0;
$dateTime = new DateTime(); $dateTime = new DateTime();
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getIdentityProvidersTableName(); $table_name = $databaseConnector->getIdentityProvidersTableName();
$stmt = $conn->prepare("SELECT SUM(count) AS count FROM " . $table_name." WHERE year = ".$dateTime->format('Y')." AND month=".$dateTime->format('m')." AND day = ".$dateTime->format('d')); $stmt = $conn->prepare("SELECT SUM(count) AS count FROM " . $table_name." WHERE year = ".$dateTime->format('Y')." AND month=".$dateTime->format('m')." AND day = ".$dateTime->format('d'));
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while ($row = $result->fetch_assoc()) { while ($row = $result->fetch_assoc()) {
$count = $row["count"]; $count = $row["count"];
} }
$conn->close(); $conn->close();
if ($count === null) if ($count === null)
{ {
$count = 0; $count = 0;
} }
echo $count; echo $count;
} }
public static function getAccessCountPerService() public static function getAccessCountPerService()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName(); $serviceProvidersTableName = $databaseConnector->getServiceProvidersTableName();
$serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName(); $serviceProvidersMapTableName = $databaseConnector->getServiceProvidersMapTableName();
$stmt = $conn->prepare("SELECT IFNULL(name,service) AS spName, SUM(count) AS count FROM ".$serviceProvidersTableName." LEFT OUTER JOIN " . $serviceProvidersMapTableName . " ON service = identifier GROUP BY service HAVING service != ''"); $stmt = $conn->prepare("SELECT IFNULL(name,service) AS spName, SUM(count) AS count FROM ".$serviceProvidersTableName." LEFT OUTER JOIN " . $serviceProvidersMapTableName . " ON service = identifier GROUP BY service HAVING service != ''");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "['".$row["spName"]."', ".$row["count"]."],"; echo "['".$row["spName"]."', ".$row["count"]."],";
} }
$conn->close(); $conn->close();
} }
public static function getLoginCountPerIdp() public static function getLoginCountPerIdp()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName(); $identityProvidersTableName = $databaseConnector->getIdentityProvidersTableName();
$identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName(); $identityProvidersMapTableName = $databaseConnector->getIdentityProvidersMapTableName();
$stmt = $conn->prepare("SELECT IFNULL(name,sourceIdp) AS idPName, SUM(count) AS count FROM ".$identityProvidersTableName. " LEFT OUTER JOIN " . $identityProvidersMapTableName . " ON sourceIdp = entityId GROUP BY sourceIdp HAVING sourceIdp != ''"); $stmt = $conn->prepare("SELECT IFNULL(name,sourceIdp) AS idPName, SUM(count) AS count FROM ".$identityProvidersTableName. " LEFT OUTER JOIN " . $identityProvidersMapTableName . " ON sourceIdp = entityId GROUP BY sourceIdp HAVING sourceIdp != ''");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
echo "['".$row["idPName"]."', ".$row["count"]."],"; echo "['".$row["idPName"]."', ".$row["count"]."],";
} }
$conn->close(); $conn->close();
} }
public static function getCountOfUsedIdp() public static function getCountOfUsedIdp()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getIdentityProvidersTableName(); $table_name = $databaseConnector->getIdentityProvidersTableName();
$stmt = $conn->prepare("SELECT COUNT(*) AS count FROM (SELECT DISTINCT sourceIdp FROM ".$table_name." ) AS idps WHERE sourceIdp != ''"); $stmt = $conn->prepare("SELECT COUNT(*) AS count FROM (SELECT DISTINCT sourceIdp FROM ".$table_name." ) AS idps WHERE sourceIdp != ''");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
$count = $row["count"]; $count = $row["count"];
} }
$conn->close(); $conn->close();
if ($count === null) if ($count === null)
{ {
$count = 0; $count = 0;
} }
echo $count; echo $count;
} }
public static function getCountOfAccesedServices() public static function getCountOfAccesedServices()
{ {
$databaseConnector = new DatabaseConnector(); $databaseConnector = new DatabaseConnector();
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getServiceProvidersTableName(); $table_name = $databaseConnector->getServiceProvidersTableName();
$stmt = $conn->prepare("SELECT COUNT(*) AS count FROM (SELECT DISTINCT service FROM ".$table_name." ) AS services WHERE service != ''"); $stmt = $conn->prepare("SELECT COUNT(*) AS count FROM (SELECT DISTINCT service FROM ".$table_name." ) AS services WHERE service != ''");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
$count = $row["count"]; $count = $row["count"];
} }
$conn->close(); $conn->close();
if ($count === null) if ($count === null)
{ {
$count = 0; $count = 0;
} }
echo $count; echo $count;
} }
public static function getAverageLoginCountPerDay() public static function getAverageLoginCountPerDay()
{ {
...@@ -225,9 +225,9 @@ class DatabaseCommand ...@@ -225,9 +225,9 @@ class DatabaseCommand
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getServiceProvidersTableName(); $table_name = $databaseConnector->getServiceProvidersTableName();
$stmt = $conn->prepare("SELECT AVG(count) as avg_count FROM (SELECT year, month, day, SUM(count) AS count FROM " . $table_name . " GROUP BY year,month,day ) AS average_count;"); $stmt = $conn->prepare("SELECT AVG(count) as avg_count FROM (SELECT year, month, day, SUM(count) AS count FROM " . $table_name . " GROUP BY year,month,day ) AS average_count;");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
$avg_count = $row["avg_count"]; $avg_count = $row["avg_count"];
} }
...@@ -245,9 +245,9 @@ class DatabaseCommand ...@@ -245,9 +245,9 @@ class DatabaseCommand
$conn = $databaseConnector->getConnection(); $conn = $databaseConnector->getConnection();
assert($conn != NULL); assert($conn != NULL);
$table_name = $databaseConnector->getServiceProvidersTableName(); $table_name = $databaseConnector->getServiceProvidersTableName();
$stmt = $conn->prepare("SELECT MAX(count) as max_count FROM (SELECT year, month, day, SUM(count) AS count FROM " . $table_name . " GROUP BY year,month,day ) AS maximal_count;"); $stmt = $conn->prepare("SELECT MAX(count) as max_count FROM (SELECT year, month, day, SUM(count) AS count FROM " . $table_name . " GROUP BY year,month,day ) AS maximal_count;");
$stmt->execute(); $stmt->execute();
$result = $stmt->get_result(); $result = $stmt->get_result();
while($row = $result->fetch_assoc()) { while($row = $result->fetch_assoc()) {
$max_count = $row["max_count"]; $max_count = $row["max_count"];
} }
......
...@@ -5,97 +5,97 @@ ...@@ -5,97 +5,97 @@
class databaseConnector class databaseConnector
{ {
private $serverName; private $serverName;
private $port; private $port;
private $username; private $username;
private $password; private $password;
private $databaseName; private $databaseName;
private $identityProvidersTableName; private $identityProvidersTableName;
private $identityProvidersMapTableName; private $identityProvidersMapTableName;
private $serviceProvidersTableName; private $serviceProvidersTableName;
private $serviceProvidersMapTableName; private $serviceProvidersMapTableName;
private $encryption; private $encryption;
private $sslCA; private $sslCA;
private $sslCert; private $sslCert;
private $sslKey; private $sslKey;
private $sslCAPath; private $sslCAPath;
const CONFIG_FILE_NAME = 'module_statisticsproxy.php'; const CONFIG_FILE_NAME = 'module_statisticsproxy.php';
const SERVER = 'serverName'; const SERVER = 'serverName';
const PORT = 'port'; const PORT = 'port';
const USER = 'userName'; const USER = 'userName';
const PASSWORD = 'password'; const PASSWORD = 'password';
const DATABASE = 'databaseName'; const DATABASE = 'databaseName';
const IDP_TABLE_NAME = 'identityProvidersTableName'; const IDP_TABLE_NAME = 'identityProvidersTableName';
const IDP_MAP_TABLE_NAME = 'identityProvidersMapTableName'; const IDP_MAP_TABLE_NAME = 'identityProvidersMapTableName';
const SP_TABLE_NAME = 'serviceProvidersTableName' ; const SP_TABLE_NAME = 'serviceProvidersTableName' ;
const SP_MAP_TABLE_NAME = 'serviceProvidersMapTableName'; const SP_MAP_TABLE_NAME = 'serviceProvidersMapTableName';
const ENCRYPTION = 'encryption'; const ENCRYPTION = 'encryption';
const SSL_CA = 'ssl_ca'; const SSL_CA = 'ssl_ca';
const SSL_CERT = 'ssl_cert_path'; const SSL_CERT = 'ssl_cert_path';
const SSL_KEY = 'ssl_key_path'; const SSL_KEY = 'ssl_key_path';
const SSL_CA_PATH = 'ssl_ca_path'; const SSL_CA_PATH = 'ssl_ca_path';
public function __construct () public function __construct ()
{ {
$conf = SimpleSAML_Configuration::getConfig(self::CONFIG_FILE_NAME); $conf = SimpleSAML_Configuration::getConfig(self::CONFIG_FILE_NAME);
$this->serverName = $conf->getString(self::SERVER); $this->serverName = $conf->getString(self::SERVER);
$this->port = $conf->getInteger(self::PORT, null); $this->port = $conf->getInteger(self::PORT, null);
$this->username = $conf->getString(self::USER); $this->username = $conf->getString(self::USER);
$this->password = $conf->getString(self::PASSWORD); $this->password = $conf->getString(self::PASSWORD);
$this->databaseName = $conf->getString(self::DATABASE); $this->databaseName = $conf->getString(self::DATABASE);
$this->identityProvidersTableName = $conf->getString(self::IDP_TABLE_NAME); $this->identityProvidersTableName = $conf->getString(self::IDP_TABLE_NAME);
$this->identityProvidersMapTableName = $conf->getString(self::IDP_MAP_TABLE_NAME); $this->identityProvidersMapTableName = $conf->getString(self::IDP_MAP_TABLE_NAME);
$this->serviceProvidersTableName = $conf->getString(self::SP_TABLE_NAME); $this->serviceProvidersTableName = $conf->getString(self::SP_TABLE_NAME);
$this->serviceProvidersMapTableName = $conf->getString(self::SP_MAP_TABLE_NAME); $this->serviceProvidersMapTableName = $conf->getString(self::SP_MAP_TABLE_NAME);
$this->encryption = $conf->getBoolean(self::ENCRYPTION); $this->encryption = $conf->getBoolean(self::ENCRYPTION);
$this->sslCA = $conf->getString(self::SSL_CA); $this->sslCA = $conf->getString(self::SSL_CA);
$this->sslCert = $conf->getString(self::SSL_CERT); $this->sslCert = $conf->getString(self::SSL_CERT);
$this->sslKey = $conf->getString(self::SSL_KEY); $this->sslKey = $conf->getString(self::SSL_KEY);
$this->sslCAPath = $conf->getString(self::SSL_CA_PATH); $this->sslCAPath = $conf->getString(self::SSL_CA_PATH);
} }
public function getConnection() public function getConnection()
{ {
$conn = mysqli_init(); $conn = mysqli_init();
if ($this->encryption ===true){ if ($this->encryption ===true){
SimpleSAML\Logger::debug("Getting connection with encryption."); SimpleSAML\Logger::debug("Getting connection with encryption.");
mysqli_ssl_set($conn, $this->sslKey,$this->sslCert, $this->sslCA, $this->sslCAPath, null); mysqli_ssl_set($conn, $this->sslKey,$this->sslCert, $this->sslCA, $this->sslCAPath, null);
if ($this->port === null){ if ($this->port === null){
mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName); mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName);
} else{ } else{
mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName, $this->port ); mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName, $this->port );
} }
} }
else{ else{
if ($this->port === null){ if ($this->port === null){
mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName); mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName);
} else{ } else{
mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName, $this->port ); mysqli_real_connect($conn, $this->serverName, $this->username, $this->password, $this->databaseName, $this->port );
} }
} }
mysqli_set_charset($conn,"utf8"); mysqli_set_charset($conn,"utf8");
return $conn; return $conn;
} }
public function getIdentityProvidersTableName() public function getIdentityProvidersTableName()
{ {
return $this->identityProvidersTableName; return $this->identityProvidersTableName;
} }
public function getIdentityProvidersMapTableName() public function getIdentityProvidersMapTableName()
{ {
return $this->identityProvidersMapTableName; return $this->identityProvidersMapTableName;
} }
public function getServiceProvidersTableName() public function getServiceProvidersTableName()
{ {
return $this->serviceProvidersTableName; return $this->serviceProvidersTableName;
} }
public function getServiceProvidersMapTableName() public function getServiceProvidersMapTableName()
{ {
......
...@@ -23,8 +23,8 @@ class sspmod_proxystatistics_Auth_Process_statistics extends SimpleSAML_Auth_Pro ...@@ -23,8 +23,8 @@ class sspmod_proxystatistics_Auth_Process_statistics extends SimpleSAML_Auth_Pro
public function process(&$request) public function process(&$request)
{ {
$dateTime = new DateTime(); $dateTime = new DateTime();
DatabaseCommand::insertLogin($request, $dateTime); DatabaseCommand::insertLogin($request, $dateTime);
} }
} }
\ No newline at end of file
...@@ -9,99 +9,99 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php"; ...@@ -9,99 +9,99 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
?> ?>
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_logins}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_logins}'); ?></h2>
<div> <div>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['corechart', 'controls']}); google.charts.load('current', {'packages':['corechart', 'controls']});
google.charts.setOnLoadCallback(drawChart); google.charts.setOnLoadCallback(drawChart);
function drawChart() { function drawChart() {
var data = google.visualization.arrayToDataTable([ var data = google.visualization.arrayToDataTable([
['Date', 'Count'], ['Date', 'Count'],
<?php DatabaseCommand::getLoginCountPerDay()?> <?php DatabaseCommand::getLoginCountPerDay()?>
]); ]);
var dashboard = new google.visualization.Dashboard( var dashboard = new google.visualization.Dashboard(
document.getElementById('dashboard_div')); document.getElementById('dashboard_div'));
var chartRangeFilter=new google.visualization.ControlWrapper({ var chartRangeFilter=new google.visualization.ControlWrapper({
'controlType': 'ChartRangeFilter', 'controlType': 'ChartRangeFilter',
'containerId': 'control_div', 'containerId': 'control_div',
'options': { 'options': {
'filterColumnLabel': 'Date' 'filterColumnLabel': 'Date'
} }
}); });
var chart = new google.visualization.ChartWrapper({ var chart = new google.visualization.ChartWrapper({
'chartType' : 'LineChart', 'chartType' : 'LineChart',
'containerId' : 'line_div', 'containerId' : 'line_div',
'options':{ 'options':{
'title' :'<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_day}'); ?>', 'title' :'<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_day}'); ?>',
'legend' : 'none' 'legend' : 'none'
} }
}); });
dashboard.bind(chartRangeFilter, chart); dashboard.bind(chartRangeFilter, chart);
dashboard.draw(data); dashboard.draw(data);
} }
</script> </script>
<div id="dashboard_div" style="width: 900px; height: 600px"> <div id="dashboard_div" style="width: 900px; height: 600px">
<div id="line_div" style="width: 900px; height: 550px"></div> <div id="line_div" style="width: 900px; height: 550px"></div>
<div id="control_div" style="width: 900px; height: 50px"></div> <div id="control_div" style="width: 900px; height: 50px"></div>
</div> </div>
</div> </div>
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_id_providers}'); ?></h2>
<div> <div>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['corechart']}); google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart); google.charts.setOnLoadCallback(drawChart);
function drawChart() { function drawChart() {
var data = google.visualization.arrayToDataTable([ var data = google.visualization.arrayToDataTable([
['sourceIdp', 'Count'], ['sourceIdp', 'Count'],
<?php DatabaseCommand::getLoginCountPerIdp()?> <?php DatabaseCommand::getLoginCountPerIdp()?>
]); ]);
var options = { var options = {
title: '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_identity}'); ?>', title: '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_identity}'); ?>',
pieSliceText: 'value' pieSliceText: 'value'
}; };
var chart = new google.visualization.PieChart(document.getElementById('piechart')); var chart = new google.visualization.PieChart(document.getElementById('piechart'));
data.sort([{column: 1, desc: true}]); data.sort([{column: 1, desc: true}]);
chart.draw(data, options); chart.draw(data, options);
} }
</script> </script>
<div id="piechart" style="width: 900px; height: 500px;"></div> <div id="piechart" style="width: 900px; height: 500px;"></div>
</div> </div>
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/graphs_service_providers}'); ?></h2>
<div> <div>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['corechart']}); google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart); google.charts.setOnLoadCallback(drawChart);
function drawChart() { function drawChart() {
var data = google.visualization.arrayToDataTable([ var data = google.visualization.arrayToDataTable([
['service', 'Count'], ['service', 'Count'],
<?php DatabaseCommand::getAccessCountPerService()?> <?php DatabaseCommand::getAccessCountPerService()?>
]); ]);
var options = { var options = {
title: '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_service}'); ?>', title: '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_service}'); ?>',
pieSliceText: 'value' pieSliceText: 'value'
}; };
var chart = new google.visualization.PieChart(document.getElementById('piechart2')); var chart = new google.visualization.PieChart(document.getElementById('piechart2'));
data.sort([{column: 1, desc: true}]); data.sort([{column: 1, desc: true}]);
chart.draw(data, options); chart.draw(data, options);
} }
</script> </script>
<div id="piechart2" style="width: 900px; height: 500px;"></div> <div id="piechart2" style="width: 900px; height: 500px;"></div>
</div> </div>
...@@ -18,11 +18,11 @@ $(document).ready(function() { ...@@ -18,11 +18,11 @@ $(document).ready(function() {
$this->includeAtTemplateBase('includes/header.php'); $this->includeAtTemplateBase('includes/header.php');
?> ?>
<div id="tabdiv"> <div id="tabdiv">
<ul class="tabset_tabs" width="100px"> <ul class="tabset_tabs" width="100px">
<li><a href='summary.php'><?php echo $this->t('{proxystatistics:Proxystatistics:summary}'); ?></a></li> <li><a href='summary.php'><?php echo $this->t('{proxystatistics:Proxystatistics:summary}'); ?></a></li>
<li><a href='graphs.php'><?php echo $this->t('{proxystatistics:Proxystatistics:templates/statistics-tpl_graphs}'); ?></a></li> <li><a href='graphs.php'><?php echo $this->t('{proxystatistics:Proxystatistics:templates/statistics-tpl_graphs}'); ?></a></li>
<li><a href='tables.php'><?php echo $this->t('{proxystatistics:Proxystatistics:templates/statistics-tpl_tables}'); ?></a></li> <li><a href='tables.php'><?php echo $this->t('{proxystatistics:Proxystatistics:templates/statistics-tpl_tables}'); ?></a></li>
</ul> </ul>
</div> </div>
......
...@@ -9,28 +9,28 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php"; ...@@ -9,28 +9,28 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:summary}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:summary}'); ?></h2>
<div id="summary" > <div id="summary" >
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['table']}); google.charts.load('current', {'packages':['table']});
google.charts.setOnLoadCallback(drawTable); google.charts.setOnLoadCallback(drawTable);
function drawTable() { function drawTable() {
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_name}'); ?>'); data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_name}'); ?>');
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>'); data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
data.addRows([ data.addRows([
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_overall_logins}'); ?>', <?php DatabaseCommand::getCountOfAllLogins()?> ], ['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_overall_logins}'); ?>', <?php DatabaseCommand::getCountOfAllLogins()?> ],
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_accessed_providers}'); ?>', <?php DatabaseCommand::getCountOfAccesedServices()?>], ['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_accessed_providers}'); ?>', <?php DatabaseCommand::getCountOfAccesedServices()?>],
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_used_identity_providers}'); ?>', <?php DatabaseCommand::getCountOfUsedIdp()?>], ['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_used_identity_providers}'); ?>', <?php DatabaseCommand::getCountOfUsedIdp()?>],
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_logins_today}'); ?>', <?php DatabaseCommand::getCountOfAllLoginsForToday()?>], ['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_logins_today}'); ?>', <?php DatabaseCommand::getCountOfAllLoginsForToday()?>],
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_average_logins}'); ?>', <?php DatabaseCommand::getAverageLoginCountPerDay()?>], ['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_average_logins}'); ?>', <?php DatabaseCommand::getAverageLoginCountPerDay()?>],
['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_max_logins}'); ?>', <?php DatabaseCommand::getMaxLoginCountPerDay()?>] ['<?php echo $this->t('{proxystatistics:Proxystatistics:templates/summary_max_logins}'); ?>', <?php DatabaseCommand::getMaxLoginCountPerDay()?>]
]); ]);
var table = new google.visualization.Table(document.getElementById('summaryTable')); var table = new google.visualization.Table(document.getElementById('summaryTable'));
table.draw(data, {showRowNumber: false, width: '80%', height: '300px'}); table.draw(data, {showRowNumber: false, width: '80%', height: '300px'});
} }
</script> </script>
<div id="summaryTable" ></div> <div id="summaryTable" ></div>
</div> </div>
...@@ -8,77 +8,77 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php"; ...@@ -8,77 +8,77 @@ include dirname(__DIR__)."/lib/Auth/Process/DatabaseCommand.php";
<link rel="stylesheet" media="screen" type="text/css" href="<?php SimpleSAML_Module::getModuleUrl('proxystatistics/statisticsproxy.css')?>" /> <link rel="stylesheet" media="screen" type="text/css" href="<?php SimpleSAML_Module::getModuleUrl('proxystatistics/statisticsproxy.css')?>" />
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_day}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_day}'); ?></h2>
<div id="tableOfAllLogin"> <div id="tableOfAllLogin">
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['table']}); google.charts.load('current', {'packages':['table']});
google.charts.setOnLoadCallback(drawTable); google.charts.setOnLoadCallback(drawTable);
function drawTable() { function drawTable() {
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_date}'); ?>'); data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_date}'); ?>');
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>'); data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
data.addRows([<?php DatabaseCommand::getLoginCountPerDay()?>]); data.addRows([<?php DatabaseCommand::getLoginCountPerDay()?>]);
var table = new google.visualization.Table(document.getElementById('tableOfAllLogin')); var table = new google.visualization.Table(document.getElementById('tableOfAllLogin'));
var formatter = new google.visualization.DateFormat({pattern:"d MMMM yyyy"}); var formatter = new google.visualization.DateFormat({pattern:"d MMMM yyyy"});
formatter.format(data, 0); // Apply formatter to second column formatter.format(data, 0); // Apply formatter to second column
table.draw(data, {showRowNumber: false, width: '60%', height: '300px'}); table.draw(data, {showRowNumber: false, width: '60%', height: '300px'});
} }
</script> </script>
<div id="tableOfAllLogin" ></div> <div id="tableOfAllLogin" ></div>
</div> </div>
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_identity}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_identity}'); ?></h2>
<div> <div>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['table']}); google.charts.load('current', {'packages':['table']});
google.charts.setOnLoadCallback(drawTable); google.charts.setOnLoadCallback(drawTable);
function drawTable() { function drawTable() {
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>'); data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>');
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_identity_provider}'); ?>'); data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_identity_provider}'); ?>');
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>'); data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
data.addRows([<?php DatabaseCommand::getLoginCountPerDeyPerService()?>]); data.addRows([<?php DatabaseCommand::getLoginCountPerDeyPerService()?>]);
var table = new google.visualization.Table(document.getElementById('tablePerIdP')); var table = new google.visualization.Table(document.getElementById('tablePerIdP'));
var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"}); var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"});
formatter.format(data, 0); // Apply formatter to second column formatter.format(data, 0); // Apply formatter to second column
table.draw(data, {showRowNumber: false, width: '100%', height: '300px'}); table.draw(data, {showRowNumber: false, width: '100%', height: '300px'});
} }
</script> </script>
<div id="tablePerIdP"></div> <div id="tablePerIdP"></div>
</div> </div>
<h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_service}'); ?></h2> <h2><?php echo $this->t('{proxystatistics:Proxystatistics:templates/logins_service}'); ?></h2>
<div> <div>
<script type="text/javascript"> <script type="text/javascript">
google.charts.load('current', {'packages':['table']}); google.charts.load('current', {'packages':['table']});
google.charts.setOnLoadCallback(drawTable); google.charts.setOnLoadCallback(drawTable);
function drawTable() { function drawTable() {
var data = new google.visualization.DataTable(); var data = new google.visualization.DataTable();
data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>'); data.addColumn('date', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_month}'); ?>');
data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_service_provider}'); ?>'); data.addColumn('string', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/tables_service_provider}'); ?>');
data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>'); data.addColumn('number', '<?php echo $this->t('{proxystatistics:Proxystatistics:templates/count}'); ?>');
data.addRows([<?php DatabaseCommand::getAccessToServicesPerMonth()?>]); data.addRows([<?php DatabaseCommand::getAccessToServicesPerMonth()?>]);
var table = new google.visualization.Table(document.getElementById('accessToServices')); var table = new google.visualization.Table(document.getElementById('accessToServices'));
var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"}); var formatter = new google.visualization.DateFormat({pattern:"MMMM yyyy"});
formatter.format(data, 0); // Apply formatter to second column formatter.format(data, 0); // Apply formatter to second column
table.draw(data, {showRowNumber: false, width: '100%', height: '300px'}); table.draw(data, {showRowNumber: false, width: '100%', height: '300px'});
} }
</script> </script>
<div id="accessToServices"></div> <div id="accessToServices"></div>
</div> </div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment