Skip to content

Commit

Permalink
UniFi API browser 2.0.5
Browse files Browse the repository at this point in the history
- fixed error when using the PHP reset function
  • Loading branch information
malle-pietje committed Dec 7, 2019
1 parent 476f72a commit a2358c0
Show file tree
Hide file tree
Showing 461 changed files with 71 additions and 15,714 deletions.
31 changes: 16 additions & 15 deletions ajax/fetch_collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
$params = [];

/**
* POSTed object:
* POSTed object properties:
* selected_collection_method
* selected_collection_label
* selected_collection_key
Expand All @@ -97,15 +97,19 @@
$output_method = $_POST['selected_output_method'];
}

switch ($method) {
case 'stat_5minutes_gateway':
$params = [null, null, $gateway_stats_attribs];
break;
case 'stat_hourly_gateway':
$params = [null, null, $gateway_stats_attribs];
break;
case 'stat_daily_gateway':
$params = [null, null, $gateway_stats_attribs];
if (empty($params)) {
switch ($method) {
case 'stat_5minutes_gateway':
$params = [null, null, $gateway_stats_attribs];

break;
case 'stat_hourly_gateway':
$params = [null, null, $gateway_stats_attribs];

break;
case 'stat_daily_gateway':
$params = [null, null, $gateway_stats_attribs];
}
}

if (!empty($method) && !empty($site_id)) {
Expand Down Expand Up @@ -162,17 +166,14 @@
/**
* Plain render mode
*/
Kint_Renderer_Text::$decorations = false;
Kint::$display_called_from = false;
$results['data'] = @s($data_array);
} else {
$results['data'] = $data_array;
}

/**
* for other future output methods
*/
//$results['data'] = print_r($data_array, true);
}

/**
* execute timing of data collection from UniFi controller
*/
Expand Down
2 changes: 1 addition & 1 deletion common.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* with this package in the file LICENSE.md
*
*/
define('TOOL_VERSION', '2.0.4');
define('TOOL_VERSION', '2.0.5');

/**
* gather some basic information for the About modal
Expand Down
22 changes: 11 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@
session_start();

/**
* check whether user has requested to clear (force expiry) the PHP session
* check whether user has requested to clear (force expiry) the PHP session, if so we
* clear the session and reload the page without the query string
* - this feature can be useful when login errors occur, mostly after upgrades or credential changes
*/
if (isset($_GET['reset_session']) && $_GET['reset_session'] == true) {
$_SESSION = [];
session_unset();
session_destroy();
session_start();
$current_url = $_SERVER['REQUEST_URI'];
$current_url = strtok($current_url, '?');
header("refresh: 0; url = $current_url");
}

/**
Expand Down
1 change: 1 addition & 0 deletions js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ $('#about_modal').on('shown.bs.modal', function (e) {
$('#span_api_browser_update').removeClass('badge-success').addClass('badge-warning');
} else if (api_browser_version == json.tag_name.substring(1)) {
$('#span_api_browser_update').html('up to date');
$('#span_api_browser_update').removeClass('badge-danger').addClass('badge-success');
} else {
$('#span_api_browser_update').html('bleeding edge!');
$('#span_api_browser_update').removeClass('badge-success').addClass('badge-danger');
Expand Down
26 changes: 13 additions & 13 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.12.0",
"version_normalized": "1.12.0.0",
"version": "v1.13.0",
"version_normalized": "1.13.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4"
"reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
"reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3",
"shasum": ""
},
"require": {
Expand All @@ -129,11 +129,11 @@
"suggest": {
"ext-ctype": "For best performance"
},
"time": "2019-08-06T08:03:45+00:00",
"time": "2019-11-27T13:56:44+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-master": "1.13-dev"
}
},
"installation-source": "dist",
Expand Down Expand Up @@ -170,17 +170,17 @@
},
{
"name": "twig/twig",
"version": "v1.42.3",
"version_normalized": "1.42.3.0",
"version": "v1.42.4",
"version_normalized": "1.42.4.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e"
"reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/201baee843e0ffe8b0b956f336dd42b2a92fae4e",
"reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/e587180584c3d2d6cb864a0454e777bb6dcb6152",
"reference": "e587180584c3d2d6cb864a0454e777bb6dcb6152",
"shasum": ""
},
"require": {
Expand All @@ -192,7 +192,7 @@
"symfony/debug": "^3.4|^4.2",
"symfony/phpunit-bridge": "^4.4@dev|^5.0"
},
"time": "2019-08-24T12:51:03+00:00",
"time": "2019-11-11T16:49:32+00:00",
"type": "library",
"extra": {
"branch-alias": {
Expand Down
Empty file modified vendor/symfony/polyfill-ctype/Ctype.php
100755 → 100644
Empty file.
Empty file modified vendor/symfony/polyfill-ctype/LICENSE
100755 → 100644
Empty file.
Empty file modified vendor/symfony/polyfill-ctype/README.md
100755 → 100644
Empty file.
Empty file modified vendor/symfony/polyfill-ctype/bootstrap.php
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion vendor/symfony/polyfill-ctype/composer.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "1.12-dev"
"dev-master": "1.13-dev"
}
}
}
2 changes: 2 additions & 0 deletions vendor/twig/twig/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/tests export-ignore
/phpunit.xml.dist export-ignore
5 changes: 5 additions & 0 deletions vendor/twig/twig/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
* 1.42.4 (2019-11-11)

* optimized "block('foo') ?? 'bar"
* added supported for exponential numbers

* 1.42.3 (2019-08-24)

* fixed the "split" filter when the delimiter is "0"
Expand Down
1 change: 1 addition & 0 deletions vendor/twig/twig/doc/filters/batch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ Arguments

* ``size``: The size of the batch; fractional numbers will be rounded up
* ``fill``: Used to fill in missing items
* ``preserve_keys``: Whether to preserve keys or not
1 change: 0 additions & 1 deletion vendor/twig/twig/doc/filters/map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ Note that the arrow function has access to the current context.
Arguments
---------

* ``array``: The sequence or mapping
* ``arrow``: The arrow function
1 change: 0 additions & 1 deletion vendor/twig/twig/doc/filters/reduce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ Note that the arrow function has access to the current context.
Arguments
---------

* ``array``: The sequence or mapping
* ``arrow``: The arrow function
* ``initial``: The initial value
2 changes: 1 addition & 1 deletion vendor/twig/twig/ext/twig/php_twig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef PHP_TWIG_H
#define PHP_TWIG_H

#define PHP_TWIG_VERSION "1.42.3"
#define PHP_TWIG_VERSION "1.42.4"

#include "php.h"

Expand Down
33 changes: 0 additions & 33 deletions vendor/twig/twig/phpunit.xml.dist

This file was deleted.

8 changes: 4 additions & 4 deletions vendor/twig/twig/src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
*/
class Environment
{
const VERSION = '1.42.3';
const VERSION_ID = 14203;
const VERSION = '1.42.4';
const VERSION_ID = 14204;
const MAJOR_VERSION = 1;
const MINOR_VERSION = 42;
const RELEASE_VERSION = 3;
const RELEASE_VERSION = 4;
const EXTRA_VERSION = '';

protected $charset;
Expand Down Expand Up @@ -515,7 +515,7 @@ public function loadClass($cls, $name, $index = null)
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template name
* @param string $template The template source
* @param string $name An optional name of the template to be used in error messages
*
* @return TemplateWrapper A template instance representing the given template name
Expand Down
2 changes: 1 addition & 1 deletion vendor/twig/twig/src/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Lexer implements \Twig_LexerInterface
const STATE_INTERPOLATION = 4;

const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A';
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?/A';
const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A';
const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As';
const REGEX_DQ_STRING_DELIM = '/"/A';
const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As';
Expand Down
14 changes: 9 additions & 5 deletions vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ class NullCoalesceExpression extends ConditionalExpression
{
public function __construct(\Twig_NodeInterface $left, \Twig_NodeInterface $right, $lineno)
{
$test = new AndBinary(
new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine()),
new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()),
$left->getTemplateLine()
);
$test = new DefinedTest(clone $left, 'defined', new Node(), $left->getTemplateLine());
// for "block()", we don't need the null test as the return value is always a string
if (!$left instanceof BlockReferenceExpression) {
$test = new AndBinary(
$test,
new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()),
$left->getTemplateLine()
);
}

parent::__construct($test, $left, $right, $lineno);
}
Expand Down
26 changes: 0 additions & 26 deletions vendor/twig/twig/tests/AutoloaderTest.php

This file was deleted.

Loading

0 comments on commit a2358c0

Please sign in to comment.