From 046636c40aaac18e9791fbfca23a76cdbe30a1cb Mon Sep 17 00:00:00 2001 From: Jan Teunis Date: Sun, 5 Nov 2017 22:25:37 +0000 Subject: [PATCH 01/23] Fixed calendar problem (not showing) Added bootstrap-select.js and cleaned up tabs --- inc/header.inc.php | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/inc/header.inc.php b/inc/header.inc.php index 5100cb7c..9bc4fca3 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -54,16 +54,12 @@ header('X-UA-Compatible: IE=edge'); - + - + - - + + @@ -83,10 +79,8 @@ header('X-UA-Compatible: IE=edge'); - - + + @@ -95,6 +89,7 @@ header('X-UA-Compatible: IE=edge'); + From f3c0c191db81a643e05569cace5a6876d8b6ab20 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 5 Nov 2017 17:33:02 -0500 Subject: [PATCH 02/23] Add bootstrap-select to header --- inc/header.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/header.inc.php b/inc/header.inc.php index 5100cb7c..35cd2a36 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -72,7 +72,7 @@ header('X-UA-Compatible: IE=edge'); - + @@ -95,6 +95,7 @@ header('X-UA-Compatible: IE=edge'); + From 5d8fa97aa2301f1b3518d9d1c99c4d81ad443d51 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 5 Nov 2017 17:33:19 -0500 Subject: [PATCH 03/23] update build # --- build.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.php b/build.php index 0b6e4f49..5c0d0523 100644 --- a/build.php +++ b/build.php @@ -1,4 +1,4 @@ Date: Sun, 5 Nov 2017 20:32:25 -0500 Subject: [PATCH 04/23] Add missing CSS, update installer --- inc/header.inc.php | 1 + install/install_functions.inc.php | 2 +- install/migrations/core.php | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/header.inc.php b/inc/header.inc.php index 4ba407b5..970fc128 100644 --- a/inc/header.inc.php +++ b/inc/header.inc.php @@ -68,6 +68,7 @@ header('X-UA-Compatible: IE=edge'); + diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index 9606199e..59c35b7b 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -16,7 +16,7 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} // We will be installing this HESK version: define('HESK_NEW_VERSION','2.7.3'); -define('MODS_FOR_HESK_NEW_VERSION','3.2.0'); +define('MODS_FOR_HESK_NEW_VERSION','3.2.1'); define('REQUIRE_PHP_VERSION','5.3.0'); define('REQUIRE_MYSQL_VERSION','5.0.7'); diff --git a/install/migrations/core.php b/install/migrations/core.php index 4ede382e..66c0c8f8 100644 --- a/install/migrations/core.php +++ b/install/migrations/core.php @@ -213,5 +213,7 @@ function getAllMigrations() { 157 => new \v320\AddAuditTrail\CreateAuditTrailToReplacementValuesTable(), 158 => new \v320\AddMigrationSetting(), 159 => new UpdateMigration('3.2.0', '3.1.1', 159), + //3.2.1 + 160 => new UpdateMigration('3.2.1', '3.2.0', 160), ); } \ No newline at end of file From 88964a73ebcb6e759fba98ab05061b7310cdac91 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 6 Nov 2017 12:38:48 -0500 Subject: [PATCH 05/23] Only skip phpunit for now --- ci/php_lint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/php_lint.sh b/ci/php_lint.sh index 4a1a3f0e..4a1e0770 100644 --- a/ci/php_lint.sh +++ b/ci/php_lint.sh @@ -12,7 +12,7 @@ while test $# -gt 0; do continue fi - for file in `find $current -type f -not -path "*vendor/*" -not -path "*/api/Tests/*" -name "*.php"` ; do + for file in `find $current -type f -not -path "*vendor/phpunit/*" -not -path "*/api/Tests/*" -name "*.php"` ; do RESULTS=`php -l $file` echo $RESULTS From 443d4ac1f3784dca18051383a093754fbc51f781 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 7 Nov 2017 09:26:16 -0500 Subject: [PATCH 06/23] Update some composer dependencies --- api/composer.json | 4 +- api/composer.lock | 231 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 213 insertions(+), 22 deletions(-) diff --git a/api/composer.json b/api/composer.json index af1cbfdf..65f65522 100644 --- a/api/composer.json +++ b/api/composer.json @@ -18,7 +18,9 @@ "php-http/guzzle6-adapter": "^1.1", "php-http/message": "^1.5", "php-http/curl-client": "^1.7", - "guzzlehttp/psr7": "^1.3", + "mike-koch/psr7": "1.4.2.1", + "mike-koch/promises": "1.3.1.1", + "mike-koch/guzzle": "6.3.0.2", "mike-koch/php-di": "4.4.11", "doctrine/annotations": "1.2" } diff --git a/api/composer.lock b/api/composer.lock index 2fdfc9ea..a32e724c 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "5259191309e50288eeb2370dd4f35c5f", + "content-hash": "b0779eaecb8e2dd1bb24f552b58c3ed2", "packages": [ { "name": "clue/stream-filter", @@ -518,6 +518,75 @@ "description": "The Mailgun SDK provides methods for all API functions.", "time": "2017-06-20T19:56:09+00:00" }, + { + "name": "mike-koch/guzzle", + "version": "6.3.0.2", + "source": { + "type": "git", + "url": "https://github.com/mike-koch/guzzle.git", + "reference": "1f44938cc111eac200633acfa6f52869fbb7f3c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mike-koch/guzzle/zipball/1f44938cc111eac200633acfa6f52869fbb7f3c7", + "reference": "1f44938cc111eac200633acfa6f52869fbb7f3c7", + "shasum": "" + }, + "require": { + "mike-koch/promises": "1.3.1.1", + "mike-koch/psr7": "1.4.2.1", + "php": ">=5.3" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Mike Koch", + "homepage": "https://github.com/mike-koch" + } + ], + "description": "Guzzle is a PHP HTTP client library. Forked from guzzle/guzzle for 5.3 compatibility", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-11-07T13:15:47+00:00" + }, { "name": "mike-koch/php-di", "version": "4.4.11", @@ -566,6 +635,126 @@ ], "time": "2017-09-08T02:23:09+00:00" }, + { + "name": "mike-koch/promises", + "version": "1.3.1.1", + "source": { + "type": "git", + "url": "https://github.com/mike-koch/promises.git", + "reference": "70fae8812e5c74b4d23f0bf79f56fdca58c70c27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mike-koch/promises/zipball/70fae8812e5c74b4d23f0bf79f56fdca58c70c27", + "reference": "70fae8812e5c74b4d23f0bf79f56fdca58c70c27", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Mike Koch", + "homepage": "https://github.com/mike-koch" + } + ], + "description": "Guzzle promises library, forked from guzzle/promises for PHP 5.3 compatibility", + "keywords": [ + "promise" + ], + "time": "2017-11-07T13:07:15+00:00" + }, + { + "name": "mike-koch/psr7", + "version": "1.4.2.1", + "source": { + "type": "git", + "url": "https://github.com/mike-koch/psr7.git", + "reference": "a35f28d9377505ba666298d351413e87a035d8b1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mike-koch/psr7/zipball/a35f28d9377505ba666298d351413e87a035d8b1", + "reference": "a35f28d9377505ba666298d351413e87a035d8b1", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-11-07T02:59:52+00:00" + }, { "name": "myclabs/php-enum", "version": "1.5.2", @@ -1235,16 +1424,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v5.2.25", + "version": "v5.2.26", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "2baf20b01690fba8cf720c1ebcf9b988eda50915" + "reference": "70362997bda4376378be7d92d81e2200550923f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/2baf20b01690fba8cf720c1ebcf9b988eda50915", - "reference": "2baf20b01690fba8cf720c1ebcf9b988eda50915", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/70362997bda4376378be7d92d81e2200550923f7", + "reference": "70362997bda4376378be7d92d81e2200550923f7", "shasum": "" }, "require": { @@ -1308,7 +1497,7 @@ } ], "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2017-08-28T11:12:07+00:00" + "time": "2017-11-04T09:26:05+00:00" }, { "name": "psr/container", @@ -2033,16 +2222,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.2.2", + "version": "5.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" + "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", - "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", + "reference": "8e1d2397d8adf59a3f12b2878a3aaa66d1ab189d", "shasum": "" }, "require": { @@ -2051,7 +2240,7 @@ "php": "^7.0", "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^1.4.11 || ^2.0", + "phpunit/php-token-stream": "^2.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.0", "sebastian/version": "^2.0.1", @@ -2093,7 +2282,7 @@ "testing", "xunit" ], - "time": "2017-08-03T12:40:43+00:00" + "time": "2017-11-03T13:47:33+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2471,30 +2660,30 @@ }, { "name": "sebastian/comparator", - "version": "2.0.2", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" + "reference": "1174d9018191e93cb9d719edec01257fc05f8158" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", - "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", + "reference": "1174d9018191e93cb9d719edec01257fc05f8158", "shasum": "" }, "require": { "php": "^7.0", "sebastian/diff": "^2.0", - "sebastian/exporter": "^3.0" + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -2525,13 +2714,13 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-08-03T07:14:59+00:00" + "time": "2017-11-03T07:16:52+00:00" }, { "name": "sebastian/diff", From 30dcb113ae1276c734ab3c4fa56b4ed445527201 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 7 Nov 2017 21:48:38 -0500 Subject: [PATCH 07/23] Modify link to handle servers with odd configurations --- api/Link.php | 414 ++++++++++++++++++++++++++------------------------- 1 file changed, 212 insertions(+), 202 deletions(-) diff --git a/api/Link.php b/api/Link.php index dff9c7cf..5a9ad7cd 100644 --- a/api/Link.php +++ b/api/Link.php @@ -4,118 +4,128 @@ require_once 'RequestMethod.php'; /** * @class Main class of the Link router that helps you create and deploy routes - */ -class Link + */ +class Link { - /** - * @var array A collection of the routes originally passed into all function. Used by static function route - */ - private static $routes = array(); - - /** - * @var array A collection of functions that are executed before a route completion ( valid for all routes ), aka universal before functions - */ - private static $beforeFuncs = array(); - - /** - * @var array A collection of function that are executed after a route completion ( valid for all routes ), aka universal after functions - */ - private static $afterFuncs = array(); - - /** - * Static function of the class Link that deploys the route according to the passed handler and path - * - * @param array $routes An array of combination of the path and its handler, that are final deployed for a particular url - */ - public static function all( $routes ) - { - - /* Call all functions that are to be executed before routing */ - foreach( self::$beforeFuncs as $beforeFunc ) { - if( $beforeFunc[1] ) { - call_user_func_array( $beforeFunc[0] , $beforeFunc[1] ); - } else { - call_user_func( $beforeFunc[0] ); - } - } - - self::$routes = $routes; - $method = self::getRequestMethod(); - $acceptedMethods = RequestMethod::all(); - $path = '/'; - $handler = null; - $matched = array(); - $middleware = null; - if ( !empty ( $_SERVER['PATH_INFO'] ) ) { - $path = $_SERVER['PATH_INFO']; - } else if ( !empty ( $_SERVER['REQUEST_URI'] ) ) { - $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); - } - - if ( isset($routes[$path] ) ) { - if( is_array( $routes[$path] ) ) { - $handler = $routes[$path][0]; - $middleware = $routes[$path][2]; - $acceptedMethods = $routes[$path][3]; - } else { - $handler = $routes[$path]; - } - } else if ( $routes ) { - - $regex = array( - '/{i}/', - '/{s}/', - '/{a}/' - ); - - $replacements = array( - '([\d]+)' , - '([a-zA-Z]+)', - '([\w-]+)' - ); - - foreach ( $routes as $routePath => $routeDesc ){ - $routePath = preg_replace( $regex, $replacements, $routePath ); - if( preg_match( '#^/?' . $routePath . '/?$#', $path, $matches ) ){ - if( is_array( $routeDesc ) ) { - $handler = $routeDesc[0]; - if( isset( $routeDesc[2] )) { - $middleware = $routeDesc[2]; - $acceptedMethods = $routeDesc[3]; - } - } - else - $handler = $routeDesc; - $matched = $matches; - break; - } - } - } - unset( $matched[0] ); - - if( isset($middleware) ){ - $newMatched = self::callFunction( $middleware, $matched, $method, $acceptedMethods ); - /* If new wildcard param are there pass them to main handler */ - if( $newMatched ) { - self::callFunction( $handler, $newMatched, $method, $acceptedMethods ); - } else { - self::callFunction( $handler, $matched, $method, $acceptedMethods ); - } - } else { - self::callFunction( $handler, $matched, $method, $acceptedMethods ); - } - - /* Call all the function that are to be executed after routing */ - foreach( self::$afterFuncs as $afterFunc ) - if( $afterFunc[1] ) { - call_user_func_array( $afterFunc[0] , $afterFunc[1] ); - } else { - call_user_func( $afterFunc[0] ); - } - } - - private static function getRequestMethod() { + /** + * @var array A collection of the routes originally passed into all function. Used by static function route + */ + private static $routes = array(); + + /** + * @var array A collection of functions that are executed before a route completion ( valid for all routes ), aka universal before functions + */ + private static $beforeFuncs = array(); + + /** + * @var array A collection of function that are executed after a route completion ( valid for all routes ), aka universal after functions + */ + private static $afterFuncs = array(); + + /** + * Static function of the class Link that deploys the route according to the passed handler and path + * + * @param array $routes An array of combination of the path and its handler, that are final deployed for a particular url + */ + public static function all( $routes ) + { + + /* Call all functions that are to be executed before routing */ + foreach( self::$beforeFuncs as $beforeFunc ) { + if( $beforeFunc[1] ) { + call_user_func_array( $beforeFunc[0] , $beforeFunc[1] ); + } else { + call_user_func( $beforeFunc[0] ); + } + } + + self::$routes = $routes; + $method = self::getRequestMethod(); + $acceptedMethods = RequestMethod::all(); + $path = '/'; + $handler = null; + $matched = array(); + $middleware = null; + if ( !empty ( $_SERVER['PATH_INFO'] ) ) { + $path = $_SERVER['PATH_INFO']; + } else if ( !empty ( $_SERVER['REQUEST_URI'] ) ) { + $parts = explode('/', $_SERVER['REQUEST_URI']); + $startingIndex = -1; + for ($i = count($parts) - 1; $i > -1 && $startingIndex === -1; $i--) { + if ($parts[$i] === 'index.php' || $parts[$i] === 'api') { + $startingIndex = $i + 1; + } + } + $path = ''; + for ($i = $startingIndex; $i < count($parts); $i++) { + $path .= "/{$parts[$i]}"; + } + } + + if ( isset($routes[$path] ) ) { + if( is_array( $routes[$path] ) ) { + $handler = $routes[$path][0]; + $middleware = $routes[$path][2]; + $acceptedMethods = $routes[$path][3]; + } else { + $handler = $routes[$path]; + } + } else if ( $routes ) { + + $regex = array( + '/{i}/', + '/{s}/', + '/{a}/' + ); + + $replacements = array( + '([\d]+)' , + '([a-zA-Z]+)', + '([\w-]+)' + ); + + foreach ( $routes as $routePath => $routeDesc ){ + $routePath = preg_replace( $regex, $replacements, $routePath ); + if( preg_match( '#^/?' . $routePath . '/?$#', $path, $matches ) ){ + if( is_array( $routeDesc ) ) { + $handler = $routeDesc[0]; + if( isset( $routeDesc[2] )) { + $middleware = $routeDesc[2]; + $acceptedMethods = $routeDesc[3]; + } + } + else + $handler = $routeDesc; + $matched = $matches; + break; + } + } + } + unset( $matched[0] ); + + if( isset($middleware) ){ + $newMatched = self::callFunction( $middleware, $matched, $method, $acceptedMethods ); + /* If new wildcard param are there pass them to main handler */ + if( $newMatched ) { + self::callFunction( $handler, $newMatched, $method, $acceptedMethods ); + } else { + self::callFunction( $handler, $matched, $method, $acceptedMethods ); + } + } else { + self::callFunction( $handler, $matched, $method, $acceptedMethods ); + } + + /* Call all the function that are to be executed after routing */ + foreach( self::$afterFuncs as $afterFunc ) + if( $afterFunc[1] ) { + call_user_func_array( $afterFunc[0] , $afterFunc[1] ); + } else { + call_user_func( $afterFunc[0] ); + } + } + + private static function getRequestMethod() { $headers = getallheaders(); $uppercaseHeaders = array(); @@ -130,42 +140,42 @@ class Link return $_SERVER['REQUEST_METHOD']; } - /** - * Static function that helps you generate links effortlessly and pass parameters to them, thus enabling to generate dynamic links - * - * @param string $name name of the route for which the link has to be generated - * @param array $params An array of parameters that are replaced in the route if it contains wildcards - * For e.g. if route is /name/{i}/{a} and parameters passed are 1, aps then link generated will be /name/1/aps - */ - public static function route( $name, $params = array() ) - { - $href = null; - foreach ( self::$routes as $routePath => $routeDesc ) { - if( is_array( $routeDesc ) ){ - if( $name == $routeDesc[1] ){ - $href = $routePath; - for( $i = 0; $i < count($params); $i++){ - $href = preg_replace('#{(.*?)}#', $params[$i], $href, 1); - } - } - } - } - return $href; - } - - /** - * Static function to handle cases when route is not found, call handler of 404 if defined else - * sends a 404 header - */ - public static function handle404() - { - /* Call '404' route if it exists */ - if( isset ( self::$routes['404'] ) ) { - call_user_func( self::$routes['404'] ); - } else { - header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); - } - } + /** + * Static function that helps you generate links effortlessly and pass parameters to them, thus enabling to generate dynamic links + * + * @param string $name name of the route for which the link has to be generated + * @param array $params An array of parameters that are replaced in the route if it contains wildcards + * For e.g. if route is /name/{i}/{a} and parameters passed are 1, aps then link generated will be /name/1/aps + */ + public static function route( $name, $params = array() ) + { + $href = null; + foreach ( self::$routes as $routePath => $routeDesc ) { + if( is_array( $routeDesc ) ){ + if( $name == $routeDesc[1] ){ + $href = $routePath; + for( $i = 0; $i < count($params); $i++){ + $href = preg_replace('#{(.*?)}#', $params[$i], $href, 1); + } + } + } + } + return $href; + } + + /** + * Static function to handle cases when route is not found, call handler of 404 if defined else + * sends a 404 header + */ + public static function handle404() + { + /* Call '404' route if it exists */ + if( isset ( self::$routes['404'] ) ) { + call_user_func( self::$routes['404'] ); + } else { + header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found"); + } + } /** * Static function to handle both middlewares' call and main handler's call. @@ -178,64 +188,64 @@ class Link * the wildcards that were originally passed, this newParams will * be next passed to main handler */ - public static function callFunction( $handler , $matched, $method, $acceptedMethods ) - { - if (!in_array($method, $acceptedMethods)) { - print_r('Request method ' . $method . ' not allowed'); - header($_SERVER['SERVER_PROTOCOL'] . ' 405 Method Not Allowed', true, 405); + public static function callFunction( $handler , $matched, $method, $acceptedMethods ) + { + if (!in_array($method, $acceptedMethods)) { + print_r('Request method ' . $method . ' not allowed'); + header($_SERVER['SERVER_PROTOCOL'] . ' 405 Method Not Allowed', true, 405); die(); } - if ( $handler ) { - if ( is_callable( $handler ) ) { - $newParams = call_user_func_array( $handler, $matched ) ; - } else { - - /* Check if class exists in the case user is using RESTful pattern */ - - if( class_exists( $handler ) ) { - $instanceOfHandler = new $handler(); // Won't work in case of middleware since we aren't using RESTful in that - } else { - print_r('Class or function ' . $handler . ' not found'); - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); - die(); - } - } - } else { - self::handle404(); - } - - if( isset( $instanceOfHandler ) ) { - if( method_exists( $instanceOfHandler, $method ) ) { + if ( $handler ) { + if ( is_callable( $handler ) ) { + $newParams = call_user_func_array( $handler, $matched ) ; + } else { + + /* Check if class exists in the case user is using RESTful pattern */ + + if( class_exists( $handler ) ) { + $instanceOfHandler = new $handler(); // Won't work in case of middleware since we aren't using RESTful in that + } else { + print_r('Class or function ' . $handler . ' not found'); + header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); + die(); + } + } + } else { + self::handle404(); + } + + if( isset( $instanceOfHandler ) ) { + if( method_exists( $instanceOfHandler, $method ) ) { $newParams = call_user_func_array( array( $instanceOfHandler, $method ), $matched ); - } - } - if( isset( $newParams ) && $newParams ) { - return $newParams; - } - } - - /** - * Static function to add functions that are to be excuted before each routing, must be called before Link::all - * - * @param string $funcName Name of the funtion to be called upon before - * @param array $params Array of parameters that are to be passed to before function, can be null but if not - * it must be an array - */ - public static function before( $funcName, $params = null ) - { - array_push( self::$beforeFuncs, array($funcName, $params)); - } - - /** - * Static function to add functions that are to be excuted after each routing, must be called before Link::all - * - * @param string $funcName Name of the funtion to be called upon after - * @param array $params Array of parameters that are to be passed to after function, can be null but if not - * it must be an array - */ - public static function after( $funcName, $params = null ) - { - array_push( self::$afterFuncs, array($funcName, $params)); - } + } + } + if( isset( $newParams ) && $newParams ) { + return $newParams; + } + } + + /** + * Static function to add functions that are to be excuted before each routing, must be called before Link::all + * + * @param string $funcName Name of the funtion to be called upon before + * @param array $params Array of parameters that are to be passed to before function, can be null but if not + * it must be an array + */ + public static function before( $funcName, $params = null ) + { + array_push( self::$beforeFuncs, array($funcName, $params)); + } + + /** + * Static function to add functions that are to be excuted after each routing, must be called before Link::all + * + * @param string $funcName Name of the funtion to be called upon after + * @param array $params Array of parameters that are to be passed to after function, can be null but if not + * it must be an array + */ + public static function after( $funcName, $params = null ) + { + array_push( self::$afterFuncs, array($funcName, $params)); + } } \ No newline at end of file From 70793cdfae3550d48084020f232ad07988038189 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 7 Nov 2017 21:58:44 -0500 Subject: [PATCH 08/23] Update installer --- build.php | 2 +- install/install_functions.inc.php | 2 +- install/migrations/core.php | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.php b/build.php index 5c0d0523..1d8d87d6 100644 --- a/build.php +++ b/build.php @@ -1,4 +1,4 @@ new \v320\AddAuditTrail\CreateAuditTrailToReplacementValuesTable(), 158 => new \v320\AddMigrationSetting(), 159 => new UpdateMigration('3.2.0', '3.1.1', 159), - //3.2.1 + //3.2.1 - 3.2.2 160 => new UpdateMigration('3.2.1', '3.2.0', 160), + 161 => new UpdateMigration('3.2.2', '3.2.1', 161), ); } \ No newline at end of file From 18128ff26395a6c91ccb4fd7504a6434d6524339 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 8 Nov 2017 20:48:05 -0500 Subject: [PATCH 09/23] Update mailgun-php --- api/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/composer.json b/api/composer.json index 65f65522..10d6da5c 100644 --- a/api/composer.json +++ b/api/composer.json @@ -14,7 +14,7 @@ }, "require": { "phpmailer/phpmailer": "^5.2", - "mailgun/mailgun-php": "^2.1", + "mike-koch/mailgun-php": "^2.1", "php-http/guzzle6-adapter": "^1.1", "php-http/message": "^1.5", "php-http/curl-client": "^1.7", From 945e548ef799699c5d5b4ed7520e67511a579c74 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 8 Nov 2017 21:12:05 -0500 Subject: [PATCH 10/23] Revert to an older mailgun PHP library --- api/composer.json | 11 +- api/composer.lock | 1695 +++++++++++++++++---------------------------- 2 files changed, 621 insertions(+), 1085 deletions(-) diff --git a/api/composer.json b/api/composer.json index 10d6da5c..b91d34b5 100644 --- a/api/composer.json +++ b/api/composer.json @@ -10,17 +10,12 @@ } ], "require-dev": { - "phpunit/phpunit": "6.3.0" + "phpunit/phpunit": "6.3.0", + "clue/graph-composer": "^1.0" }, "require": { "phpmailer/phpmailer": "^5.2", - "mike-koch/mailgun-php": "^2.1", - "php-http/guzzle6-adapter": "^1.1", - "php-http/message": "^1.5", - "php-http/curl-client": "^1.7", - "mike-koch/psr7": "1.4.2.1", - "mike-koch/promises": "1.3.1.1", - "mike-koch/guzzle": "6.3.0.2", + "mailgun/mailgun-php": "1.7.2", "mike-koch/php-di": "4.4.11", "doctrine/annotations": "1.2" } diff --git a/api/composer.lock b/api/composer.lock index a32e724c..1668fba8 100644 --- a/api/composer.lock +++ b/api/composer.lock @@ -4,60 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "b0779eaecb8e2dd1bb24f552b58c3ed2", + "content-hash": "cba4f6a9b461d9050bd4095da7c79aea", "packages": [ - { - "name": "clue/stream-filter", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/clue/php-stream-filter.git", - "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", - "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "require-dev": { - "phpunit/phpunit": "^5.0 || ^4.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Clue\\StreamFilter\\": "src/" - }, - "files": [ - "src/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Christian Lück", - "email": "christian@lueck.tv" - } - ], - "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", - "keywords": [ - "bucket brigade", - "callback", - "filter", - "php_user_filter", - "stream", - "stream_filter_append", - "stream_filter_register" - ], - "time": "2017-08-18T09:54:01+00:00" - }, { "name": "container-interop/container-interop", "version": "1.2.0", @@ -291,44 +239,70 @@ "time": "2014-09-09T13:34:57+00:00" }, { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", + "name": "guzzle/guzzle", + "version": "v3.9.3", "source": { "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" + "url": "https://github.com/guzzle/guzzle3.git", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/0645b70d953bc1c067bbc8d5bc53194706b628d9", + "reference": "0645b70d953bc1c067bbc8d5bc53194706b628d9", "shasum": "" }, "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" + "ext-curl": "*", + "php": ">=5.3.3", + "symfony/event-dispatcher": "~2.1" + }, + "replace": { + "guzzle/batch": "self.version", + "guzzle/cache": "self.version", + "guzzle/common": "self.version", + "guzzle/http": "self.version", + "guzzle/inflection": "self.version", + "guzzle/iterator": "self.version", + "guzzle/log": "self.version", + "guzzle/parser": "self.version", + "guzzle/plugin": "self.version", + "guzzle/plugin-async": "self.version", + "guzzle/plugin-backoff": "self.version", + "guzzle/plugin-cache": "self.version", + "guzzle/plugin-cookie": "self.version", + "guzzle/plugin-curlauth": "self.version", + "guzzle/plugin-error-response": "self.version", + "guzzle/plugin-history": "self.version", + "guzzle/plugin-log": "self.version", + "guzzle/plugin-md5": "self.version", + "guzzle/plugin-mock": "self.version", + "guzzle/plugin-oauth": "self.version", + "guzzle/service": "self.version", + "guzzle/stream": "self.version" }, "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" + "doctrine/cache": "~1.3", + "monolog/monolog": "~1.0", + "phpunit/phpunit": "3.7.*", + "psr/log": "~1.0", + "symfony/class-loader": "~2.1", + "zendframework/zend-cache": "2.*,<2.3", + "zendframework/zend-log": "2.*,<2.3" }, "suggest": { - "psr/log": "Required for using the Log middleware" + "guzzlehttp/guzzle": "Guzzle 5 has moved to a new package name. The package you have installed, Guzzle 3, is deprecated." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.2-dev" + "dev-master": "3.9-dev" } }, "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" + "psr-0": { + "Guzzle": "src/", + "Guzzle\\Tests": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -340,9 +314,13 @@ "name": "Michael Dowling", "email": "mtdowling@gmail.com", "homepage": "https://github.com/mtdowling" + }, + { + "name": "Guzzle Community", + "homepage": "https://github.com/guzzle/guzzle/contributors" } ], - "description": "Guzzle is a PHP HTTP client library", + "description": "PHP HTTP client. This library is deprecated in favor of https://packagist.org/packages/guzzlehttp/guzzle", "homepage": "http://guzzlephp.org/", "keywords": [ "client", @@ -353,155 +331,33 @@ "rest", "web service" ], - "time": "2017-06-22T18:50:49+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" + "abandoned": "guzzlehttp/guzzle", + "time": "2015-03-18T18:23:50+00:00" }, { "name": "mailgun/mailgun-php", - "version": "2.3.4", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/mailgun/mailgun-php.git", - "reference": "f58c5914aefa16fa6ed2b5cf9ee84d40cbda1b3a" + "reference": "45ec0c8f3a2a6554b4987e97889f44991e4f75b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mailgun/mailgun-php/zipball/f58c5914aefa16fa6ed2b5cf9ee84d40cbda1b3a", - "reference": "f58c5914aefa16fa6ed2b5cf9ee84d40cbda1b3a", + "url": "https://api.github.com/repos/mailgun/mailgun-php/zipball/45ec0c8f3a2a6554b4987e97889f44991e4f75b4", + "reference": "45ec0c8f3a2a6554b4987e97889f44991e4f75b4", "shasum": "" }, "require": { - "php": "^5.5|^7.0", - "php-http/client-common": "^1.1", - "php-http/discovery": "^1.0", - "php-http/httplug": "^1.0", - "php-http/message": "^1.0", - "php-http/multipart-stream-builder": "^1.0", - "webmozart/assert": "^1.2" + "guzzle/guzzle": "<4.0,>=3.8" }, "require-dev": { - "guzzlehttp/psr7": "^1.4", - "php-http/guzzle6-adapter": "^1.0", - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "3.7.*" }, "type": "library", "autoload": { "psr-0": { + "Mailgun\\Tests": "tests/", "Mailgun": "src/" } }, @@ -516,76 +372,7 @@ } ], "description": "The Mailgun SDK provides methods for all API functions.", - "time": "2017-06-20T19:56:09+00:00" - }, - { - "name": "mike-koch/guzzle", - "version": "6.3.0.2", - "source": { - "type": "git", - "url": "https://github.com/mike-koch/guzzle.git", - "reference": "1f44938cc111eac200633acfa6f52869fbb7f3c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mike-koch/guzzle/zipball/1f44938cc111eac200633acfa6f52869fbb7f3c7", - "reference": "1f44938cc111eac200633acfa6f52869fbb7f3c7", - "shasum": "" - }, - "require": { - "mike-koch/promises": "1.3.1.1", - "mike-koch/psr7": "1.4.2.1", - "php": ">=5.3" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Mike Koch", - "homepage": "https://github.com/mike-koch" - } - ], - "description": "Guzzle is a PHP HTTP client library. Forked from guzzle/guzzle for 5.3 compatibility", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-11-07T13:15:47+00:00" + "time": "2014-11-19T22:31:03+00:00" }, { "name": "mike-koch/php-di", @@ -635,126 +422,6 @@ ], "time": "2017-09-08T02:23:09+00:00" }, - { - "name": "mike-koch/promises", - "version": "1.3.1.1", - "source": { - "type": "git", - "url": "https://github.com/mike-koch/promises.git", - "reference": "70fae8812e5c74b4d23f0bf79f56fdca58c70c27" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mike-koch/promises/zipball/70fae8812e5c74b4d23f0bf79f56fdca58c70c27", - "reference": "70fae8812e5c74b4d23f0bf79f56fdca58c70c27", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Mike Koch", - "homepage": "https://github.com/mike-koch" - } - ], - "description": "Guzzle promises library, forked from guzzle/promises for PHP 5.3 compatibility", - "keywords": [ - "promise" - ], - "time": "2017-11-07T13:07:15+00:00" - }, - { - "name": "mike-koch/psr7", - "version": "1.4.2.1", - "source": { - "type": "git", - "url": "https://github.com/mike-koch/psr7.git", - "reference": "a35f28d9377505ba666298d351413e87a035d8b1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mike-koch/psr7/zipball/a35f28d9377505ba666298d351413e87a035d8b1", - "reference": "a35f28d9377505ba666298d351413e87a035d8b1", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-11-07T02:59:52+00:00" - }, { "name": "myclabs/php-enum", "version": "1.5.2", @@ -898,103 +565,108 @@ "time": "2014-08-21T08:20:45+00:00" }, { - "name": "php-http/client-common", - "version": "v1.6.0", + "name": "phpmailer/phpmailer", + "version": "v5.2.26", "source": { "type": "git", - "url": "https://github.com/php-http/client-common.git", - "reference": "1901ad36347227c14751a218d8f4ea1467d1f1ed" + "url": "https://github.com/PHPMailer/PHPMailer.git", + "reference": "70362997bda4376378be7d92d81e2200550923f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/1901ad36347227c14751a218d8f4ea1467d1f1ed", - "reference": "1901ad36347227c14751a218d8f4ea1467d1f1ed", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/70362997bda4376378be7d92d81e2200550923f7", + "reference": "70362997bda4376378be7d92d81e2200550923f7", "shasum": "" }, "require": { - "php": ">=5.4", - "php-http/httplug": "^1.1", - "php-http/message": "^1.6", - "php-http/message-factory": "^1.0", - "symfony/options-resolver": "^2.6 || ^3.0" + "ext-ctype": "*", + "php": ">=5.0.0" }, "require-dev": { - "guzzlehttp/psr7": "^1.4", - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "doctrine/annotations": "1.2.*", + "jms/serializer": "0.16.*", + "phpdocumentor/phpdocumentor": "2.*", + "phpunit/phpunit": "4.8.*", + "symfony/debug": "2.8.*", + "symfony/filesystem": "2.8.*", + "symfony/translation": "2.8.*", + "symfony/yaml": "2.8.*", + "zendframework/zend-cache": "2.5.1", + "zendframework/zend-config": "2.5.1", + "zendframework/zend-eventmanager": "2.5.1", + "zendframework/zend-filter": "2.5.1", + "zendframework/zend-i18n": "2.5.1", + "zendframework/zend-json": "2.5.1", + "zendframework/zend-math": "2.5.1", + "zendframework/zend-serializer": "2.5.*", + "zendframework/zend-servicemanager": "2.5.*", + "zendframework/zend-stdlib": "2.5.1" }, "suggest": { - "php-http/cache-plugin": "PSR-6 Cache plugin", - "php-http/logger-plugin": "PSR-3 Logger plugin", - "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + "league/oauth2-google": "Needed for Google XOAUTH2 authentication" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, "autoload": { - "psr-4": { - "Http\\Client\\Common\\": "src/" - } + "classmap": [ + "class.phpmailer.php", + "class.phpmaileroauth.php", + "class.phpmaileroauthgoogle.php", + "class.smtp.php", + "class.pop3.php", + "extras/EasyPeasyICS.php", + "extras/ntlm_sasl_client.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "LGPL-2.1" ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Jim Jagielski", + "email": "jimjag@gmail.com" + }, + { + "name": "Marcus Bointon", + "email": "phpmailer@synchromedia.co.uk" + }, + { + "name": "Andy Prevost", + "email": "codeworxtech@users.sourceforge.net" + }, + { + "name": "Brent R. Matzelle" } ], - "description": "Common HTTP Client implementations and tools for HTTPlug", - "homepage": "http://httplug.io", - "keywords": [ - "client", - "common", - "http", - "httplug" - ], - "time": "2017-10-16T16:16:36+00:00" + "description": "PHPMailer is a full-featured email creation and transfer class for PHP", + "time": "2017-11-04T09:26:05+00:00" }, { - "name": "php-http/curl-client", - "version": "v1.7.0", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-http/curl-client.git", - "reference": "0972ad0d7d37032a52077a5cbe27cf370f2007d8" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/curl-client/zipball/0972ad0d7d37032a52077a5cbe27cf370f2007d8", - "reference": "0972ad0d7d37032a52077a5cbe27cf370f2007d8", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { - "ext-curl": "*", - "php": "^5.5 || ^7.0", - "php-http/discovery": "^1.0", - "php-http/httplug": "^1.0", - "php-http/message": "^1.2", - "php-http/message-factory": "^1.0.2" - }, - "provide": { - "php-http/async-client-implementation": "1.0", - "php-http/client-implementation": "1.0" - }, - "require-dev": { - "guzzlehttp/psr7": "^1.0", - "php-http/client-integration-tests": "^0.5.1", - "phpunit/phpunit": "^4.8.27", - "zendframework/zend-diactoros": "^1.0" + "php": ">=5.3.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-4": { - "Http\\Client\\Curl\\": "src/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1003,56 +675,62 @@ ], "authors": [ { - "name": "Михаил Красильников", - "email": "m.krasilnikov@yandex.ru" + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" } ], - "description": "cURL client for PHP-HTTP", - "homepage": "http://php-http.org", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "curl", - "http" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], - "time": "2017-02-09T15:18:33+00:00" + "time": "2017-02-14T16:28:37+00:00" }, { - "name": "php-http/discovery", - "version": "1.3.0", + "name": "symfony/event-dispatcher", + "version": "v2.8.28", "source": { "type": "git", - "url": "https://github.com/php-http/discovery.git", - "reference": "7b50ab4d6c9fdaa1ed53ae310c955900af6e3372" + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/7b50ab4d6c9fdaa1ed53ae310c955900af6e3372", - "reference": "7b50ab4d6c9fdaa1ed53ae310c955900af6e3372", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7fe089232554357efb8d4af65ce209fc6e5a2186", + "reference": "7fe089232554357efb8d4af65ce209fc6e5a2186", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0" + "php": ">=5.3.9" }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^2.0.2", - "php-http/httplug": "^1.0", - "php-http/message-factory": "^1.0", - "phpspec/phpspec": "^2.4", - "puli/composer-plugin": "1.0.0-beta10" + "psr/log": "~1.0", + "symfony/config": "^2.0.5|~3.0.0", + "symfony/dependency-injection": "~2.6|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/stopwatch": "~2.3|~3.0.0" }, "suggest": { - "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", - "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + "symfony/dependency-injection": "", + "symfony/http-kernel": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "2.8-dev" } }, "autoload": { "psr-4": { - "Http\\Discovery\\": "src/" - } + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1060,295 +738,251 @@ ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Finds installed HTTPlug implementations and PSR-7 message factories", - "homepage": "http://php-http.org", - "keywords": [ - "adapter", - "client", - "discovery", - "factory", - "http", - "message", - "psr7" - ], - "time": "2017-08-03T10:12:53+00:00" + "description": "Symfony EventDispatcher Component", + "homepage": "https://symfony.com", + "time": "2017-10-01T21:00:16+00:00" }, { - "name": "php-http/guzzle6-adapter", - "version": "v1.1.1", + "name": "zendframework/zend-code", + "version": "2.6.3", "source": { "type": "git", - "url": "https://github.com/php-http/guzzle6-adapter.git", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + "url": "https://github.com/zendframework/zend-code.git", + "reference": "95033f061b083e16cdee60530ec260d7d628b887" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", - "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887", + "reference": "95033f061b083e16cdee60530ec260d7d628b887", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "php-http/httplug": "^1.0" - }, - "provide": { - "php-http/async-client-implementation": "1.0", - "php-http/client-implementation": "1.0" + "php": "^5.5 || 7.0.0 - 7.0.4 || ^7.0.6", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" }, "require-dev": { - "ext-curl": "*", - "php-http/adapter-integration-tests": "^0.4" + "doctrine/annotations": "~1.0", + "fabpot/php-cs-fixer": "1.7.*", + "phpunit/phpunit": "^4.8.21", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "2.6-dev", + "dev-develop": "2.7-dev" } }, "autoload": { "psr-4": { - "Http\\Adapter\\Guzzle6\\": "src/" + "Zend\\Code\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "David de Boer", - "email": "david@ddeboer.nl" - } + "BSD-3-Clause" ], - "description": "Guzzle 6 HTTP Adapter", - "homepage": "http://httplug.io", + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", "keywords": [ - "Guzzle", - "http" + "code", + "zf2" ], - "time": "2016-05-10T06:13:32+00:00" + "time": "2016-04-20T17:26:42+00:00" }, { - "name": "php-http/httplug", - "version": "v1.1.0", + "name": "zendframework/zend-eventmanager", + "version": "3.2.0", "source": { "type": "git", - "url": "https://github.com/php-http/httplug.git", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", - "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", "shasum": "" }, "require": { - "php": ">=5.4", - "php-http/promise": "^1.0", - "psr/http-message": "^1.0" + "php": "^5.6 || ^7.0" }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^6.0.7 || ^5.7.14", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" } }, "autoload": { "psr-4": { - "Http\\Client\\": "src/" + "Zend\\EventManager\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Eric GELOEN", - "email": "geloen.eric@gmail.com" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } + "BSD-3-Clause" ], - "description": "HTTPlug, the HTTP client abstraction for PHP", - "homepage": "http://httplug.io", + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", "keywords": [ - "client", - "http" + "event", + "eventmanager", + "events", + "zf2" ], - "time": "2016-08-31T08:30:17+00:00" - }, + "time": "2017-07-11T19:17:22+00:00" + } + ], + "packages-dev": [ { - "name": "php-http/message", - "version": "1.6.0", + "name": "clue/graph", + "version": "v0.9.0", "source": { "type": "git", - "url": "https://github.com/php-http/message.git", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253" + "url": "https://github.com/clue/graph.git", + "reference": "0336a4d5229fa61a20ccceaeab25e52ac9542700" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/2edd63bae5f52f79363c5f18904b05ce3a4b7253", - "reference": "2edd63bae5f52f79363c5f18904b05ce3a4b7253", + "url": "https://api.github.com/repos/clue/graph/zipball/0336a4d5229fa61a20ccceaeab25e52ac9542700", + "reference": "0336a4d5229fa61a20ccceaeab25e52ac9542700", "shasum": "" }, "require": { - "clue/stream-filter": "^1.3", - "php": ">=5.4", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" - }, - "provide": { - "php-http/message-factory-implementation": "1.0" + "php": ">=5.3.0" }, "require-dev": { - "akeneo/phpspec-skip-example-extension": "^1.0", - "coduo/phpspec-data-provider-extension": "^1.0", - "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4", - "slim/slim": "^3.0", - "zendframework/zend-diactoros": "^1.0" + "phpunit/phpunit": "~4.0" }, "suggest": { - "ext-zlib": "Used with compressor/decompressor streams", - "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", - "slim/slim": "Used with Slim Framework PSR-7 implementation", - "zendframework/zend-diactoros": "Used with Diactoros Factories" + "graphp/algorithms": "Common graph algorithms, such as Dijkstra and Moore-Bellman-Ford (shortest path), minimum spanning tree (MST), Kruskal, Prim and many more..", + "graphp/graphviz": "GraphViz graph drawing / DOT output" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6-dev" - } - }, "autoload": { "psr-4": { - "Http\\Message\\": "src/" - }, - "files": [ - "src/filters.php" - ] + "Fhaculty\\Graph\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "HTTP Message related tools", - "homepage": "http://php-http.org", + "description": "A mathematical graph/network library written in PHP", + "homepage": "https://github.com/clue/graph", "keywords": [ - "http", - "message", - "psr-7" + "edge", + "graph", + "mathematical", + "network", + "vertex" ], - "time": "2017-07-05T06:40:53+00:00" + "time": "2015-03-07T18:11:31+00:00" }, { - "name": "php-http/message-factory", - "version": "v1.0.2", + "name": "clue/graph-composer", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + "url": "https://github.com/clue/graph-composer.git", + "reference": "d27cce7d17065e35904b366b980b0de3c0d32feb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "url": "https://api.github.com/repos/clue/graph-composer/zipball/d27cce7d17065e35904b366b980b0de3c0d32feb", + "reference": "d27cce7d17065e35904b366b980b0de3c0d32feb", "shasum": "" }, "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" + "clue/graph": "~0.9.0", + "graphp/graphviz": "~0.2.0", + "jms/composer-deps-analyzer": "0.1.*", + "symfony/console": "~2.1" }, + "bin": [ + "bin/graph-composer" + ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.0-dev" + "phar": { + "bundler": "composer" } }, "autoload": { - "psr-4": { - "Http\\Message\\": "src/" + "psr-0": { + "Clue\\GraphComposer": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", + "description": "Dependency graph visualization for composer.json", + "homepage": "https://github.com/clue/graph-composer", "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" + "dependency graph", + "visualize composer", + "visualize dependencies" ], - "time": "2015-12-19T14:08:53+00:00" + "time": "2015-11-17T00:38:07+00:00" }, { - "name": "php-http/multipart-stream-builder", - "version": "1.0.0", + "name": "doctrine/instantiator", + "version": "1.1.0", "source": { "type": "git", - "url": "https://github.com/php-http/multipart-stream-builder.git", - "reference": "1fa3c623fc813a43b39494b2a1612174e36e0fb0" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/1fa3c623fc813a43b39494b2a1612174e36e0fb0", - "reference": "1fa3c623fc813a43b39494b2a1612174e36e0fb0", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "php-http/discovery": "^1.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0" + "php": "^7.1" }, "require-dev": { - "php-http/message": "^1.5", - "phpunit/phpunit": "^4.8 || ^5.4", - "zendframework/zend-diactoros": "^1.3.5" + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { "psr-4": { - "Http\\Message\\MultipartStream\\": "src/" + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1357,48 +991,44 @@ ], "authors": [ { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" } ], - "description": "A builder class that help you create a multipart stream", - "homepage": "http://php-http.org", + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", "keywords": [ - "factory", - "http", - "message", - "multipart stream", - "stream" + "constructor", + "instantiate" ], - "time": "2017-05-21T17:45:25+00:00" + "time": "2017-07-22T11:58:36+00:00" }, { - "name": "php-http/promise", - "version": "v1.0.0", + "name": "graphp/algorithms", + "version": "v0.8.1", "source": { "type": "git", - "url": "https://github.com/php-http/promise.git", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + "url": "https://github.com/graphp/algorithms.git", + "reference": "81db4049c35730767ec8f97fb5c4844234b86cef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", - "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "url": "https://api.github.com/repos/graphp/algorithms/zipball/81db4049c35730767ec8f97fb5c4844234b86cef", + "reference": "81db4049c35730767ec8f97fb5c4844234b86cef", "shasum": "" }, + "require": { + "clue/graph": "~0.9.0|~0.8.0", + "php": ">=5.3" + }, "require-dev": { - "henrikbjorn/phpspec-code-coverage": "^1.0", - "phpspec/phpspec": "^2.4" + "phpunit/phpunit": "~4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, "autoload": { "psr-4": { - "Http\\Promise\\": "src/" + "Graphp\\Algorithms\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1407,462 +1037,99 @@ ], "authors": [ { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - }, - { - "name": "Joel Wurtz", - "email": "joel.wurtz@gmail.com" + "name": "Christian Lück", + "email": "christian@lueck.tv" } ], - "description": "Promise used for asynchronous HTTP requests", - "homepage": "http://httplug.io", + "description": "Common mathematical graph algorithms", + "homepage": "https://github.com/graphp/algorithms", "keywords": [ - "promise" - ], - "time": "2016-01-26T13:27:02+00:00" + "Graph algorithms", + "dijkstra", + "kruskal", + "minimum spanning tree", + "moore-bellman-ford", + "prim", + "shortest path" + ], + "time": "2015-03-08T10:12:01+00:00" }, { - "name": "phpmailer/phpmailer", - "version": "v5.2.26", + "name": "graphp/graphviz", + "version": "v0.2.1", "source": { "type": "git", - "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "70362997bda4376378be7d92d81e2200550923f7" + "url": "https://github.com/graphp/graphviz.git", + "reference": "2676522dfcd907fd3cb52891ea64a052c4ac4c2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/70362997bda4376378be7d92d81e2200550923f7", - "reference": "70362997bda4376378be7d92d81e2200550923f7", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": ">=5.0.0" - }, - "require-dev": { - "doctrine/annotations": "1.2.*", - "jms/serializer": "0.16.*", - "phpdocumentor/phpdocumentor": "2.*", - "phpunit/phpunit": "4.8.*", - "symfony/debug": "2.8.*", - "symfony/filesystem": "2.8.*", - "symfony/translation": "2.8.*", - "symfony/yaml": "2.8.*", - "zendframework/zend-cache": "2.5.1", - "zendframework/zend-config": "2.5.1", - "zendframework/zend-eventmanager": "2.5.1", - "zendframework/zend-filter": "2.5.1", - "zendframework/zend-i18n": "2.5.1", - "zendframework/zend-json": "2.5.1", - "zendframework/zend-math": "2.5.1", - "zendframework/zend-serializer": "2.5.*", - "zendframework/zend-servicemanager": "2.5.*", - "zendframework/zend-stdlib": "2.5.1" - }, - "suggest": { - "league/oauth2-google": "Needed for Google XOAUTH2 authentication" - }, - "type": "library", - "autoload": { - "classmap": [ - "class.phpmailer.php", - "class.phpmaileroauth.php", - "class.phpmaileroauthgoogle.php", - "class.smtp.php", - "class.pop3.php", - "extras/EasyPeasyICS.php", - "extras/ntlm_sasl_client.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-2.1" - ], - "authors": [ - { - "name": "Jim Jagielski", - "email": "jimjag@gmail.com" - }, - { - "name": "Marcus Bointon", - "email": "phpmailer@synchromedia.co.uk" - }, - { - "name": "Andy Prevost", - "email": "codeworxtech@users.sourceforge.net" - }, - { - "name": "Brent R. Matzelle" - } - ], - "description": "PHPMailer is a full-featured email creation and transfer class for PHP", - "time": "2017-11-04T09:26:05+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/graphp/graphviz/zipball/2676522dfcd907fd3cb52891ea64a052c4ac4c2a", + "reference": "2676522dfcd907fd3cb52891ea64a052c4ac4c2a", "shasum": "" }, "require": { + "clue/graph": "~0.9.0|~0.8.0", + "graphp/algorithms": "~0.8.0", "php": ">=5.3.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v3.3.10", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/ee4e22978fe885b54ee5da8c7964f0a5301abfb6", - "reference": "ee4e22978fe885b54ee5da8c7964f0a5301abfb6", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\OptionsResolver\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony OptionsResolver Component", - "homepage": "https://symfony.com", - "keywords": [ - "config", - "configuration", - "options" - ], - "time": "2017-07-29T21:54:42+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "~4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { - "Webmozart\\Assert\\": "src/" + "Graphp\\GraphViz\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2016-11-23T20:04:58+00:00" - }, - { - "name": "zendframework/zend-code", - "version": "2.6.3", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-code.git", - "reference": "95033f061b083e16cdee60530ec260d7d628b887" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-code/zipball/95033f061b083e16cdee60530ec260d7d628b887", - "reference": "95033f061b083e16cdee60530ec260d7d628b887", - "shasum": "" - }, - "require": { - "php": "^5.5 || 7.0.0 - 7.0.4 || ^7.0.6", - "zendframework/zend-eventmanager": "^2.6 || ^3.0" - }, - "require-dev": { - "doctrine/annotations": "~1.0", - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/phpunit": "^4.8.21", - "zendframework/zend-stdlib": "^2.7 || ^3.0" - }, - "suggest": { - "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", - "zendframework/zend-stdlib": "Zend\\Stdlib component" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev", - "dev-develop": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\Code\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "provides facilities to generate arbitrary code using an object oriented interface", - "homepage": "https://github.com/zendframework/zend-code", - "keywords": [ - "code", - "zf2" - ], - "time": "2016-04-20T17:26:42+00:00" - }, - { - "name": "zendframework/zend-eventmanager", - "version": "3.2.0", - "source": { - "type": "git", - "url": "https://github.com/zendframework/zend-eventmanager.git", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", - "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "athletic/athletic": "^0.1", - "container-interop/container-interop": "^1.1.0", - "phpunit/phpunit": "^6.0.7 || ^5.7.14", - "zendframework/zend-coding-standard": "~1.0.0", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0" - }, - "suggest": { - "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", - "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev", - "dev-develop": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Zend\\EventManager\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "Trigger and listen to events within a PHP application", - "homepage": "https://github.com/zendframework/zend-eventmanager", + ], + "description": "GraphViz graph drawing for mathematical graph/network", + "homepage": "https://github.com/graphp/graphviz", "keywords": [ - "event", - "eventmanager", - "events", - "zf2" + "dot output", + "graph drawing", + "graph image", + "graphviz" ], - "time": "2017-07-11T19:17:22+00:00" - } - ], - "packages-dev": [ + "time": "2015-03-08T10:30:28+00:00" + }, { - "name": "doctrine/instantiator", - "version": "1.1.0", + "name": "jms/composer-deps-analyzer", + "version": "0.1.0", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + "url": "https://github.com/schmittjoh/composer-deps-analyzer.git", + "reference": "912227ebdca09ca8bd67509645ac6318a136aa46" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", - "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "url": "https://api.github.com/repos/schmittjoh/composer-deps-analyzer/zipball/912227ebdca09ca8bd67509645ac6318a136aa46", + "reference": "912227ebdca09ca8bd67509645ac6318a136aa46", "shasum": "" }, "require": { - "php": "^7.1" + "php": ">= 5.3.2" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "^6.2.3", - "squizlabs/php_codesniffer": "^3.0.2" + "composer/composer": "dev-master", + "symfony/filesystem": "2.1.*", + "symfony/process": "2.1.*" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + "psr-0": { + "JMS\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" + "Apache2" ], - "time": "2017-07-22T11:58:36+00:00" + "description": "Builds a Dependency Graph from a composer.json file", + "time": "2013-05-15T18:04:27+00:00" }, { "name": "myclabs/deep-copy", @@ -2613,6 +1880,53 @@ ], "time": "2017-08-03T14:08:16+00:00" }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -3172,6 +2486,183 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, + { + "name": "symfony/console", + "version": "v2.8.28", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "f81549d2c5fdee8d711c9ab3c7e7362353ea5853" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/f81549d2c5fdee8d711c9ab3c7e7362353ea5853", + "reference": "f81549d2c5fdee8d711c9ab3c7e7362353ea5853", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "time": "2017-10-01T21:00:16+00:00" + }, + { + "name": "symfony/debug", + "version": "v3.0.9", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/697c527acd9ea1b2d3efac34d9806bf255278b0a", + "reference": "697c527acd9ea1b2d3efac34d9806bf255278b0a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "time": "2016-07-30T07:22:48+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2017-10-11T12:05:26+00:00" + }, { "name": "theseer/tokenizer", "version": "1.1.0", @@ -3211,6 +2702,56 @@ ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", + "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-11-23T20:04:58+00:00" } ], "aliases": [], From fd4732d978518ec7328e15a27df92b1f71828f90 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 8 Nov 2017 21:36:46 -0500 Subject: [PATCH 11/23] Add helper method for boolval --- api/BusinessLogic/Helpers.php | 4 +++ api/BusinessLogic/Security/UserContext.php | 34 ++++++++++++---------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/api/BusinessLogic/Helpers.php b/api/BusinessLogic/Helpers.php index 5a36c723..f2a49c6d 100644 --- a/api/BusinessLogic/Helpers.php +++ b/api/BusinessLogic/Helpers.php @@ -26,4 +26,8 @@ class Helpers extends \BaseClass { ? $array[$key] : null; } + + static function boolval($val) { + return $val == true; + } } \ No newline at end of file diff --git a/api/BusinessLogic/Security/UserContext.php b/api/BusinessLogic/Security/UserContext.php index 70a907ac..3055b4ff 100644 --- a/api/BusinessLogic/Security/UserContext.php +++ b/api/BusinessLogic/Security/UserContext.php @@ -3,6 +3,8 @@ namespace BusinessLogic\Security; +use BusinessLogic\Helpers; + class UserContext extends \BaseClass { /* @var $id int */ public $id; @@ -79,7 +81,7 @@ class UserContext extends \BaseClass { $userContext = new UserContext(); $userContext->id = intval($dataRow['id']); $userContext->username = $dataRow['user']; - $userContext->admin = boolval($dataRow['isadmin']); + $userContext->admin = Helpers::boolval($dataRow['isadmin']); $userContext->name = $dataRow['name']; $userContext->email = $dataRow['email']; $userContext->signature = $dataRow['signature']; @@ -90,34 +92,34 @@ class UserContext extends \BaseClass { $userContext->categories = explode(',', $dataRow['categories']); } $userContext->permissions = explode(',', $dataRow['heskprivileges']); - $userContext->autoAssign = boolval($dataRow['autoassign']); + $userContext->autoAssign = Helpers::boolval($dataRow['autoassign']); $userContext->ratingNegative = intval($dataRow['ratingneg']); $userContext->ratingPositive = intval($dataRow['ratingpos']); $userContext->rating = floatval($dataRow['rating']); $userContext->totalNumberOfReplies = intval($dataRow['replies']); - $userContext->active = boolval($dataRow['active']); + $userContext->active = Helpers::boolval($dataRow['active']); $preferences = new UserContextPreferences(); $preferences->afterReply = intval($dataRow['afterreply']); - $preferences->autoStartTimeWorked = boolval($dataRow['autostart']); + $preferences->autoStartTimeWorked = Helpers::boolval($dataRow['autostart']); $preferences->autoreload = intval($dataRow['autoreload']); - $preferences->defaultNotifyCustomerNewTicket = boolval($dataRow['notify_customer_new']); - $preferences->defaultNotifyCustomerReply = boolval($dataRow['notify_customer_reply']); - $preferences->showSuggestedKnowledgebaseArticles = boolval($dataRow['show_suggested']); + $preferences->defaultNotifyCustomerNewTicket = Helpers::boolval($dataRow['notify_customer_new']); + $preferences->defaultNotifyCustomerReply = Helpers::boolval($dataRow['notify_customer_reply']); + $preferences->showSuggestedKnowledgebaseArticles = Helpers::boolval($dataRow['show_suggested']); $preferences->defaultCalendarView = intval($dataRow['default_calendar_view']); $preferences->defaultTicketView = $dataRow['default_list']; $userContext->preferences = $preferences; $notifications = new UserContextNotifications(); - $notifications->newUnassigned = boolval($dataRow['notify_new_unassigned']); - $notifications->newAssignedToMe = boolval($dataRow['notify_new_my']); - $notifications->replyUnassigned = boolval($dataRow['notify_reply_unassigned']); - $notifications->replyToMe = boolval($dataRow['notify_reply_my']); - $notifications->ticketAssignedToMe = boolval($dataRow['notify_assigned']); - $notifications->privateMessage = boolval($dataRow['notify_pm']); - $notifications->noteOnTicketAssignedToMe = boolval($dataRow['notify_note']); - $notifications->noteOnTicketNotAssignedToMe = boolval($dataRow['notify_note_unassigned']); - $notifications->overdueTicketUnassigned = boolval($dataRow['notify_overdue_unassigned']); + $notifications->newUnassigned = Helpers::boolval($dataRow['notify_new_unassigned']); + $notifications->newAssignedToMe = Helpers::boolval($dataRow['notify_new_my']); + $notifications->replyUnassigned = Helpers::boolval($dataRow['notify_reply_unassigned']); + $notifications->replyToMe = Helpers::boolval($dataRow['notify_reply_my']); + $notifications->ticketAssignedToMe = Helpers::boolval($dataRow['notify_assigned']); + $notifications->privateMessage = Helpers::boolval($dataRow['notify_pm']); + $notifications->noteOnTicketAssignedToMe = Helpers::boolval($dataRow['notify_note']); + $notifications->noteOnTicketNotAssignedToMe = Helpers::boolval($dataRow['notify_note_unassigned']); + $notifications->overdueTicketUnassigned = Helpers::boolval($dataRow['notify_overdue_unassigned']); $userContext->notificationSettings = $notifications; return $userContext; From eeb5ada6108f3551f761268065d399e4811eb0aa Mon Sep 17 00:00:00 2001 From: Jozef Date: Mon, 20 Nov 2017 11:00:25 +0000 Subject: [PATCH 12/23] Fix usage of CC and BCC fields in mail header. --- inc/email_functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/email_functions.inc.php b/inc/email_functions.inc.php index f4e7d3aa..13db7b8c 100644 --- a/inc/email_functions.inc.php +++ b/inc/email_functions.inc.php @@ -512,10 +512,10 @@ function hesk_mail($to, $subject, $message, $htmlMessage, $modsForHesk_settings, $headers .= "MIME-Version: 1.0\n"; $headers .= "From: $hesk_settings[from_header]\n"; if (count($cc) > 0) { - $headers .= "Cc: " . implode(',', $cc); + $headers .= "Cc: " . implode(',', $cc) . "\n"; } if (count($bcc) > 0) { - $headers .= "Bcc: " . implode(',', $bcc); + $headers .= "Bcc: " . implode(',', $bcc) . "\n"; } $headers .= "Reply-To: $hesk_settings[from_header]\n"; $headers .= "Return-Path: $hesk_settings[webmaster_mail]\n"; From eac23907e7f88a9e4300b963d83825b1760237c4 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 20 Nov 2017 07:46:07 -0500 Subject: [PATCH 13/23] Fix edit/delete reply buttons --- admin/admin_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index d17ee27b..0210de9d 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -1561,7 +1561,7 @@ function hesk_getAdminButtons($category_id) function hesk_getAdminButtonsInTicket($reply = 0, $white = 1) { - global $hesk_settings, $hesklang, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete, $isManager; + global $hesk_settings, $hesklang, $ticket, $trackingID, $can_edit, $can_archive, $can_delete, $isManager; $options = $reply ? '' : '
'; @@ -1934,7 +1934,7 @@ function mfh_print_reply($reply) { ?>
- +
From 70435cee6265caf9eb069ff6450b9c1383c133f8 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 20 Nov 2017 12:36:04 -0500 Subject: [PATCH 14/23] Fix storing dates when format is not MySQL-friendly --- inc/common.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/inc/common.inc.php b/inc/common.inc.php index be8f07eb..29f35fc0 100644 --- a/inc/common.inc.php +++ b/inc/common.inc.php @@ -2160,6 +2160,10 @@ function mfh_get_hidden_fields_for_language($keys) { function mfh_insert_audit_trail_record($entity_id, $entity_type, $language_key, $date, $replacement_values = array()) { global $hesk_settings; + $oldTimeFormat = $hesk_settings['timeformat']; + $hesk_settings['timeformat'] = 'Y-m-d H:i:s'; + $date = hesk_date(); + hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "audit_trail` (`entity_id`, `entity_type`, `language_key`, `date`) VALUES (" . intval($entity_id) . ", '" . hesk_dbEscape($entity_type) . "', '" . hesk_dbEscape($language_key) . "', '" . hesk_dbEscape($date) . "')"); @@ -2172,6 +2176,8 @@ function mfh_insert_audit_trail_record($entity_id, $entity_type, $language_key, " . intval($replacement_index) . ", '" . hesk_dbEscape($replacement_value) . "')"); } + $hesk_settings['timeformat'] = $oldTimeFormat; + return $audit_id; } From f8ab89946d97bf4da91faa497c6b6a38b5d8746e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 20 Nov 2017 12:37:48 -0500 Subject: [PATCH 15/23] Update version --- install/migrations/core.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/migrations/core.php b/install/migrations/core.php index 6526344d..5157c658 100644 --- a/install/migrations/core.php +++ b/install/migrations/core.php @@ -213,8 +213,9 @@ function getAllMigrations() { 157 => new \v320\AddAuditTrail\CreateAuditTrailToReplacementValuesTable(), 158 => new \v320\AddMigrationSetting(), 159 => new UpdateMigration('3.2.0', '3.1.1', 159), - //3.2.1 - 3.2.2 + //3.2.1 - 3.2.3 160 => new UpdateMigration('3.2.1', '3.2.0', 160), 161 => new UpdateMigration('3.2.2', '3.2.1', 161), + 162 => new UpdateMigration('3.2.3', '3.2.2', 162), ); } \ No newline at end of file From a7742614df5c5e4ccd056d25ab01134c19ff2826 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 20 Nov 2017 22:16:46 -0500 Subject: [PATCH 16/23] Update pages for HESK 2.7.4 --- admin/admin_reply_ticket.php | 13 ++++++- admin/admin_settings_save.php | 1 + admin/admin_ticket.php | 3 +- admin/assign_owner.php | 3 +- admin/export.php | 2 +- admin/find_tickets.php | 13 ++++--- admin/index.php | 4 +- admin/manage_email_templates.php | 2 + admin/manage_knowledgebase.php | 8 +++- admin/move_category.php | 6 +-- admin/new_ticket.php | 4 +- admin/profile.php | 2 +- admin/reports.php | 2 +- api/BusinessLogic/Emails/BasicEmailSender.php | 4 ++ .../Emails/EmailTemplateParser.php | 16 ++++++++ api/Core/database.inc.php | 2 +- api/Core/database_mysqli.inc.php | 2 +- cron/core/database.inc.php | 2 +- cron/core/database_mysqli.inc.php | 2 +- inc/admin_functions.inc.php | 6 +-- inc/common.inc.php | 38 ++++++++++++++++++- inc/email_functions.inc.php | 36 +++++++++++++++--- inc/pipe_functions.inc.php | 2 +- inc/posting_functions.inc.php | 5 ++- index.php | 4 +- install/install_functions.inc.php | 2 +- internal-api/core/database.inc.php | 2 +- internal-api/core/database_mysqli.inc.php | 2 +- knowledgebase.php | 4 +- .../en/emails/html/new_reply_by_customer.txt | 2 +- .../en/emails/html/new_reply_by_staff.txt | 5 ++- language/en/emails/html/ticket_closed.txt | 2 +- language/en/emails/ticket_closed.txt | 3 +- language/en/text.php | 3 +- reply_ticket.php | 3 +- submit_ticket.php | 2 +- ticket.php | 4 +- 37 files changed, 161 insertions(+), 55 deletions(-) diff --git a/admin/admin_reply_ticket.php b/admin/admin_reply_ticket.php index 29a0d5c8..834ceb6c 100644 --- a/admin/admin_reply_ticket.php +++ b/admin/admin_reply_ticket.php @@ -294,6 +294,15 @@ $sql .= $submit_as_customer ? "`lastreplier`='0', `replierid`='0' " : "`lastrepl if ($time_worked == '00:00:00') { $sql .= ", `lastchange` = NOW() "; } else { + $parts = explode(':', $ticket['time_worked']); + $seconds = ($parts[0] * 3600) + ($parts[1] * 60) + $parts[2]; + + $parts = explode(':', $time_worked); + $seconds += ($parts[0] * 3600) + ($parts[1] * 60) + $parts[2]; + + require(HESK_PATH . 'inc/reporting_functions.inc.php'); + $ticket['time_worked'] = hesk_SecondsToHHMMSS($seconds); + $sql .= ",`time_worked` = ADDTIME(`time_worked`,'" . hesk_dbEscape($time_worked) . "') "; } @@ -363,7 +372,9 @@ $info = array( 'dt' => hesk_date($ticket['dt'], true), 'lastchange' => hesk_date($ticket['lastchange'], true), 'id' => $ticket['id'], - 'language' => $ticket['language'] + 'language' => $ticket['language'], + 'time_worked' => $ticket['time_worked'], + 'last_reply_by' => ($submit_as_customer ? $ticket['name'] : $_SESSION['name']), ); // 2. Add custom fields to the array diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index 7113cd6f..ee1d8181 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -62,6 +62,7 @@ $set['noreply_mail'] = hesk_validateEmail(hesk_POST('s_noreply_mail'), $hesklang $set['noreply_name'] = hesk_input(hesk_POST('s_noreply_name')); $set['noreply_name'] = str_replace(array('\\"', '<', '>'), '', $set['noreply_name']); $set['noreply_name'] = trim(preg_replace('/\s{2,}/', ' ', $set['noreply_name'])); +$set['noreply_name'] = preg_replace("/\n|\r|\t|%0A|%0D|%08|%09/", '', $set['noreply_name']); /* --> Language settings */ $set['can_sel_lang'] = empty($_POST['s_can_sel_lang']) ? 0 : 1; diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 0210de9d..978f8112 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -423,13 +423,14 @@ if (isset($_POST['notemsg']) && hesk_token_check('POST')) { 'trackid' => $ticket['trackid'], 'status' => $ticket['status'], 'name' => $_SESSION['name'], - 'lastreplier' => $ticket['lastreplier'], 'subject' => $ticket['subject'], 'message' => stripslashes($msg), 'dt' => hesk_date($ticket['dt'], true), 'lastchange' => hesk_date($ticket['lastchange'], true), 'attachments' => $myattachments, 'id' => $ticket['id'], + 'time_worked' => $ticket['time_worked'], + 'last_reply_by' => $ticket['repliername'], ); // 2. Add custom fields to the array diff --git a/admin/assign_owner.php b/admin/assign_owner.php index e875b2a5..e103e8aa 100755 --- a/admin/assign_owner.php +++ b/admin/assign_owner.php @@ -129,13 +129,14 @@ $info = array( 'trackid' => $ticket['trackid'], 'status' => $ticket['status'], 'name' => $ticket['name'], - 'lastreplier' => $ticket['lastreplier'], 'subject' => $ticket['subject'], 'message' => $ticket['message'], 'attachments' => $ticket['attachments'], 'dt' => hesk_date($ticket['dt'], true), 'lastchange' => hesk_date($ticket['lastchange'], true), 'id' => $ticket['id'], + 'time_worked' => $ticket['time_worked'], + 'last_reply_by' => hesk_getReplierName($ticket), ); // 2. Add custom fields to the array diff --git a/admin/export.php b/admin/export.php index 1e4e543e..c0a366e6 100644 --- a/admin/export.php +++ b/admin/export.php @@ -697,7 +697,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); () diff --git a/admin/find_tickets.php b/admin/find_tickets.php index c9bcd812..350bb27b 100644 --- a/admin/find_tickets.php +++ b/admin/find_tickets.php @@ -145,21 +145,21 @@ LEFT(`message`, 400) AS `message`, $sql .= " ( `trackid` = '" . hesk_dbEscape($q) . "' OR `merged` LIKE '%#" . hesk_dbEscape($q) . "#%' ) "; break; case 'name': - $sql .= "`name` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbCollate() . "' "; + $sql .= "`name` LIKE '%".hesk_dbEscape( hesk_dbLike($q) )."%' COLLATE '" . hesk_dbCollate() . "' "; break; case 'email': $sql .= "`email` LIKE '%" . hesk_dbEscape($q) . "%' "; break; case 'subject': - $sql .= "`subject` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbCollate() . "' "; + $sql .= "`subject` LIKE '%".hesk_dbEscape( hesk_dbLike($q) )."%' COLLATE '" . hesk_dbCollate() . "' "; break; case 'message': - $sql .= " ( `message` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbCollate() . "' + $sql .= " ( `message` LIKE '%".hesk_dbEscape( hesk_dbLike($q) )."%' COLLATE '" . hesk_dbCollate() . "' OR `id` IN ( SELECT DISTINCT `replyto` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` - WHERE `message` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbCollate() . "' ) + WHERE `message` LIKE '%".hesk_dbEscape( hesk_dbLike($q) )."%' COLLATE '" . hesk_dbCollate() . "' ) ) "; break; @@ -170,7 +170,7 @@ LEFT(`message`, 400) AS `message`, $sql .= "`id` IN ( SELECT DISTINCT `ticket` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` - WHERE `message` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbCollate() . "' ) + WHERE `message` LIKE '%".hesk_dbEscape( hesk_dbLike($q) )."%' COLLATE '" . hesk_dbCollate() . "' ) "; break; default: @@ -220,6 +220,9 @@ LEFT(`message`, 400) AS `message`, $sql_count .= $sql; $sql = $sql_final . $sql; + // Strip extra slashes + $q = stripslashes($q); + /* Prepare variables used in search and forms */ require_once(HESK_PATH . 'inc/prepare_ticket_search.inc.php'); ?> diff --git a/admin/index.php b/admin/index.php index ba7c4b00..aec1e374 100644 --- a/admin/index.php +++ b/admin/index.php @@ -158,7 +158,7 @@ function do_login() exit(); } - $pass_enc = hesk_Pass2Hash($_SESSION['pass'] . strtolower($user) . $_SESSION['pass']); + $pass_enc = hesk_Pass2Hash($_SESSION['pass'].hesk_mb_strtolower($user).$_SESSION['pass']); /* Check if default password */ if ($_SESSION['pass'] == '499d74967b28a841c98bb4baaabaad699ff3c079') { @@ -330,7 +330,7 @@ function print_login() - '; - $_SESSION['new']['email'] = hesk_validateEmail(hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer = '
  • ' . $hesklang['enter_valid_email'] . '
  • '; + $_SESSION['new']['email'] = hesk_validateEmail( hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer .= '
  • ' . $hesklang['enter_valid_email'] . '
  • '; $_SESSION['new']['signature'] = hesk_input(hesk_POST('signature')); /* Signature */ diff --git a/admin/reports.php b/admin/reports.php index 64d3ba00..e9f341a2 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -249,7 +249,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ()
    '; } diff --git a/language/en/emails/html/new_reply_by_customer.txt b/language/en/emails/html/new_reply_by_customer.txt index f0eb563d..79cc0a86 100644 --- a/language/en/emails/html/new_reply_by_customer.txt +++ b/language/en/emails/html/new_reply_by_customer.txt @@ -1,6 +1,6 @@

    Hello,

    A customer has just replied to ticket "%%SUBJECT%%".

    -

    You can manage this ticket here: +

    You can read the reply message and manage this ticket here: %%TRACK_URL%%

    Regards,

    %%SITE_TITLE%%
    diff --git a/language/en/emails/html/new_reply_by_staff.txt b/language/en/emails/html/new_reply_by_staff.txt index 1287b2b8..fcf1093a 100644 --- a/language/en/emails/html/new_reply_by_staff.txt +++ b/language/en/emails/html/new_reply_by_staff.txt @@ -1,8 +1,9 @@

    Dear %%NAME%%,

    -

    Our staff has just replied to your ticket "%%SUBJECT%%".

    -

    You can view the ticket here:

    +

    We have just replied to your ticket "%%SUBJECT%%".

    +

    To read the message, submit a reply and view details, please visit:

    %%TRACK_URL%%

    +

    If the above link is not clickable, try copying and pasting it into the address bar of your web browser.

    Sincerely,

    %%SITE_TITLE%%
    diff --git a/language/en/emails/html/ticket_closed.txt b/language/en/emails/html/ticket_closed.txt index f547ba76..10220a1a 100644 --- a/language/en/emails/html/ticket_closed.txt +++ b/language/en/emails/html/ticket_closed.txt @@ -1,8 +1,8 @@

    Dear %%NAME%%,

    Your support ticket "%%SUBJECT%%" has been updated to a closed/resolved status.

    -

    Ticket tracking ID: %%TRACK_ID%%

    You can view the status of your ticket here: %%TRACK_URL%%

    +

    If the above link is not clickable, try copying and pasting it into the address bar of your web browser.

    Sincerely,

    %%SITE_TITLE%%
    %%SITE_URL%% \ No newline at end of file diff --git a/language/en/emails/ticket_closed.txt b/language/en/emails/ticket_closed.txt index 51cfb97c..33a94afd 100644 --- a/language/en/emails/ticket_closed.txt +++ b/language/en/emails/ticket_closed.txt @@ -2,11 +2,10 @@ Dear %%NAME%%, Your support ticket "%%SUBJECT%%" has been updated to a closed/resolved status. -Ticket tracking ID: %%TRACK_ID%% - You can view the status of your ticket here: %%TRACK_URL%% +If the above link is not clickable, try copying and pasting it into the address bar of your web browser. Sincerely, diff --git a/language/en/text.php b/language/en/text.php index d543ccd3..042a2130 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -1239,7 +1239,7 @@ $hesklang['cat_pri_ch']='Category priority has been set to:'; $hesklang['err_dbversion']='Too old MySQL version:'; // %s will be replaced with MySQL version $hesklang['signature_max']='Signature (max 1000 chars)'; $hesklang['signature_long']='User signature is too long! Please limit the signature to 1000 chars'; -$hesklang['ip_whois']='IP whois'; +$hesklang['ip_whois']='IP WHOIS'; $hesklang['ednote']='Edit note message'; $hesklang['ednote2']='Note message saved'; $hesklang['perm_deny']='Permission denied'; @@ -1284,7 +1284,6 @@ $hesklang['click_unban']='Click here to unban.'; $hesklang['banip_intro']='Visitors from banned IP addresses will not be able to view or submit tickets and login into the help desk.'; $hesklang['ipperm']='Permanent IP bans:'; $hesklang['iptemp']='Login failure bans:'; -$hesklang['savebanip']='Ban this IP'; $hesklang['no_banips']='No IPs are being banned.'; $hesklang['bananip']='IP address to ban'; $hesklang['banex']='Examples:'; diff --git a/reply_ticket.php b/reply_ticket.php index 499f3d1f..0760ac06 100644 --- a/reply_ticket.php +++ b/reply_ticket.php @@ -206,13 +206,14 @@ $info = array( 'trackid' => $ticket['trackid'], 'status' => $ticket['status'], 'name' => $ticket['name'], - 'lastreplier' => $ticket['name'], 'subject' => $ticket['subject'], 'message' => stripslashes($message), 'attachments' => $myattachments, 'dt' => hesk_date($ticket['dt'], true), 'lastchange' => hesk_date($ticket['lastchange'], true), 'id' => $ticket['id'], + 'time_worked' => $ticket['time_worked'], + 'last_reply_by' => $ticket['name'], ); // 2. Add custom fields to the array diff --git a/submit_ticket.php b/submit_ticket.php index 06090ef6..d11f5225 100644 --- a/submit_ticket.php +++ b/submit_ticket.php @@ -73,7 +73,7 @@ if ($hesk_settings['question_use']) { if (strlen($question) == 0) { $hesk_error_buffer['question'] = $hesklang['q_miss']; - } elseif (strtolower($question) != strtolower($hesk_settings['question_ans'])) { + } elseif (hesk_mb_strtolower($question) != hesk_mb_strtolower($hesk_settings['question_ans'])) { $hesk_error_buffer['question'] = $hesklang['q_wrng']; } else { $_SESSION['c_question'] = $question; diff --git a/ticket.php b/ticket.php index 2d7197b4..cb7ef11b 100644 --- a/ticket.php +++ b/ticket.php @@ -722,8 +722,8 @@ function hesk_printCustomerTicketReplies() echo ' '; } From 3203eed8aa85c1f8466f3c420c7656870ca337df Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 21 Nov 2017 12:29:54 -0500 Subject: [PATCH 17/23] Use NOW() for reply dates --- admin/admin_reply_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/admin_reply_ticket.php b/admin/admin_reply_ticket.php index 29a0d5c8..216f0394 100644 --- a/admin/admin_reply_ticket.php +++ b/admin/admin_reply_ticket.php @@ -189,9 +189,9 @@ if ($hesk_settings['attachments']['use'] && !empty($attachments)) { // Add reply $html = $modsForHesk_settings['rich_text_for_tickets']; if ($submit_as_customer) { - hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` (`replyto`,`name`,`message`,`dt`,`attachments`,`html`) VALUES ('" . intval($replyto) . "','" . hesk_dbEscape(addslashes($ticket['name'])) . "','" . hesk_dbEscape($message . "

    {$hesklang['creb']} {$_SESSION['name']}") . "','" . hesk_dbEscape(hesk_date()) . "','" . hesk_dbEscape($myattachments) . "', '" . $html . "')"); + hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` (`replyto`,`name`,`message`,`dt`,`attachments`,`html`) VALUES ('" . intval($replyto) . "','" . hesk_dbEscape(addslashes($ticket['name'])) . "','" . hesk_dbEscape($message . "

    {$hesklang['creb']} {$_SESSION['name']}") . "', NOW(),'" . hesk_dbEscape($myattachments) . "', '" . $html . "')"); } else { - hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` (`replyto`,`name`,`message`,`dt`,`attachments`,`staffid`,`html`) VALUES ('" . intval($replyto) . "','" . hesk_dbEscape(addslashes($_SESSION['name'])) . "','" . hesk_dbEscape($message) . "','" . hesk_dbEscape(hesk_date()) . "','" . hesk_dbEscape($myattachments) . "','" . intval($_SESSION['id']) . "', '" . $html . "')"); + hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` (`replyto`,`name`,`message`,`dt`,`attachments`,`staffid`,`html`) VALUES ('" . intval($replyto) . "','" . hesk_dbEscape(addslashes($_SESSION['name'])) . "','" . hesk_dbEscape($message) . "', NOW(),'" . hesk_dbEscape($myattachments) . "','" . intval($_SESSION['id']) . "', '" . $html . "')"); } /* Track ticket status changes for history */ From 8b263f66a32fef6a3dc7fd2d4bed341edbb52f16 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 21 Nov 2017 12:58:04 -0500 Subject: [PATCH 18/23] Fix some email sending, updat edit_post maxlengths --- admin/edit_post.php | 4 ++-- api/BusinessLogic/Emails/EmailTemplateParser.php | 7 +------ .../Tickets/ResendTicketEmailToCustomerController.php | 4 ++++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/admin/edit_post.php b/admin/edit_post.php index a0bc7c55..8e14c90a 100644 --- a/admin/edit_post.php +++ b/admin/edit_post.php @@ -368,7 +368,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
    -
    @@ -380,7 +380,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
    - lastReplier)) { - if (!empty($ticket->lastReplier)) { - $lastReplyBy = $hesklang['staff']; - } else { - $lastReplyUser = $this->userGateway->getUserById($ticket->lastReplier, $heskSettings); - $lastReplyBy = $lastReplyUser !== null ? $lastReplyUser->name : $hesklang['unas']; - } + $lastReplyBy = $ticket->lastReplier; } else { $lastReplyBy = $ticket->name; } diff --git a/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php b/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php index ddab20cc..42ac4c08 100644 --- a/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php +++ b/api/Controllers/Tickets/ResendTicketEmailToCustomerController.php @@ -41,6 +41,10 @@ class ResendTicketEmailToCustomerController extends InternalApiController { $reply = null; $emailTemplate = EmailTemplateRetriever::NEW_TICKET; + + // Use 0 for new tickets + $ticket->lastReplier = 0; + if (isset($_GET['replyId'])) { $replyId = $_GET['replyId']; $emailTemplate = EmailTemplateRetriever::NEW_REPLY_BY_STAFF; From 2390af6393ac55f2316640c4897fc96d977e96bd Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 25 Nov 2017 21:14:15 -0500 Subject: [PATCH 19/23] Update HESK verison to 2.7.5 --- install/install_functions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php index e94f1e85..8dcae5c0 100644 --- a/install/install_functions.inc.php +++ b/install/install_functions.inc.php @@ -15,8 +15,8 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');} // We will be installing this HESK version: -define('HESK_NEW_VERSION','2.7.4'); -define('MODS_FOR_HESK_NEW_VERSION','3.2.2'); +define('HESK_NEW_VERSION','2.7.5'); +define('MODS_FOR_HESK_NEW_VERSION','3.2.4'); define('REQUIRE_PHP_VERSION','5.3.0'); define('REQUIRE_MYSQL_VERSION','5.0.7'); From d092a49babb8ca76935b5fd1c5bc19cf6c082bc1 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 25 Nov 2017 21:40:27 -0500 Subject: [PATCH 20/23] Fix sorting of ticket events --- admin/admin_ticket.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 0210de9d..c98979a2 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -1828,7 +1828,7 @@ function hesk_printTicketReplies() } // Re-sort them so they're in order by date - usort($combined_records, function ($a, $b) { + usort($combined_records, function ($a, $b) use (&$hesk_settings) { $a_date = null; $b_date = null; if ($a['SORT_TYPE'] == 'REPLY') { @@ -1844,12 +1844,14 @@ function hesk_printTicketReplies() } if ($a_date === $b_date && $a['SORT_TYPE'] != $b['SORT_TYPE']) { - if ($a['SORT_TYPE'] != $b['SORT_TYPE']) { - return $a['SORT_TYPE'] == 'REPLY' ? -1 : 1; + if ($hesk_settings['new_top']) { + return $a['SORT_TYPE'] == 'REPLY' ? 1 : -1; } + + return $a['SORT_TYPE'] == 'REPLY' ? -1 : 1; } - return $a_date - $b_date; + return $hesk_settings['new_top'] ? $b_date - $a_date : $a_date - $b_date; }); From 03e7f626843f277ed0bb039b0685a2bf28836c5b Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 25 Nov 2017 21:42:23 -0500 Subject: [PATCH 21/23] Change verbiage --- language/en/text.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/en/text.php b/language/en/text.php index d543ccd3..59e4b7b7 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -2192,7 +2192,7 @@ $hesklang['changing_permissions_will_reset_permission_group'] = 'Changing a user // --> Ticket audit trail $hesklang['audit_moved_category']='%s moved ticket to category %s'; // %s = new category, user making change, thist1 $hesklang['audit_assigned']='%s assigned ticket to %s'; // %s = assigned user, user making change -$hesklang['audit_assigned_self'] = '%s assigned ticket to themself'; +$hesklang['audit_assigned_self'] = '%s self-assigned ticket'; $hesklang['audit_unassigned'] = '%s unassigned ticket'; $hesklang['audit_closed']='%s closed ticket'; // thist3 $hesklang['audit_automatically_closed'] ='Ticket automatically closed'; From dd99ebdb0e10e43ee0d73bae7723e1008d32f5b3 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 25 Nov 2017 21:46:19 -0500 Subject: [PATCH 22/23] Fix input-group-addon CSS issue --- admin/manage_categories.php | 2 +- css/mods-for-hesk-new.css | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/manage_categories.php b/admin/manage_categories.php index 5b6cf082..0b123369 100644 --- a/admin/manage_categories.php +++ b/admin/manage_categories.php @@ -374,7 +374,7 @@ echo '';
    -