From 670829fa5833a6f666ebf4c78669ca6fdac476c9 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 2 Apr 2024 16:53:13 +0200 Subject: [PATCH 01/61] #13035 added JWT repository --- pandora_console/composer.json | 3 +- .../include/class/JWTRepository.class.php | 139 ++++++++++++++ pandora_console/vendor/autoload.php | 18 -- .../vendor/composer/ClassLoader.php | 43 ++--- .../vendor/composer/InstalledVersions.php | 37 ++-- .../vendor/composer/autoload_classmap.php | 2 +- .../vendor/composer/autoload_files.php | 20 +- .../vendor/composer/autoload_namespaces.php | 2 +- .../vendor/composer/autoload_psr4.php | 4 +- .../vendor/composer/autoload_real.php | 56 ++++-- .../vendor/composer/autoload_static.php | 28 ++- .../vendor/composer/installed.json | 127 ++++++++++++ pandora_console/vendor/composer/installed.php | 150 ++++++++------- .../vendor/composer/platform_check.php | 30 +-- .../vendor/lcobucci/jwt/.readthedocs.yaml | 9 + pandora_console/vendor/lcobucci/jwt/LICENSE | 27 +++ .../vendor/lcobucci/jwt/composer.json | 63 ++++++ .../vendor/lcobucci/jwt/renovate.json | 6 + .../vendor/lcobucci/jwt/src/Builder.php | 85 +++++++++ .../lcobucci/jwt/src/ClaimsFormatter.php | 14 ++ .../vendor/lcobucci/jwt/src/Configuration.php | 131 +++++++++++++ .../vendor/lcobucci/jwt/src/Decoder.php | 29 +++ .../vendor/lcobucci/jwt/src/Encoder.php | 27 +++ .../jwt/src/Encoding/CannotDecodeContent.php | 21 ++ .../jwt/src/Encoding/CannotEncodeContent.php | 16 ++ .../jwt/src/Encoding/ChainedFormatter.php | 37 ++++ .../lcobucci/jwt/src/Encoding/JoseEncoder.php | 56 ++++++ .../MicrosecondBasedDateConversion.php | 36 ++++ .../jwt/src/Encoding/UnifyAudience.php | 29 +++ .../jwt/src/Encoding/UnixTimestampDates.php | 32 ++++ .../vendor/lcobucci/jwt/src/Exception.php | 10 + .../vendor/lcobucci/jwt/src/JwtFacade.php | 71 +++++++ .../vendor/lcobucci/jwt/src/Parser.php | 22 +++ .../vendor/lcobucci/jwt/src/Signer.php | 43 +++++ .../lcobucci/jwt/src/Signer/Blake2b.php | 36 ++++ .../jwt/src/Signer/CannotSignPayload.php | 15 ++ .../vendor/lcobucci/jwt/src/Signer/Ecdsa.php | 67 +++++++ .../jwt/src/Signer/Ecdsa/ConversionFailed.php | 25 +++ .../Signer/Ecdsa/MultibyteStringConverter.php | 148 ++++++++++++++ .../lcobucci/jwt/src/Signer/Ecdsa/Sha256.php | 31 +++ .../lcobucci/jwt/src/Signer/Ecdsa/Sha384.php | 31 +++ .../lcobucci/jwt/src/Signer/Ecdsa/Sha512.php | 33 ++++ .../src/Signer/Ecdsa/SignatureConverter.php | 40 ++++ .../vendor/lcobucci/jwt/src/Signer/Eddsa.php | 36 ++++ .../vendor/lcobucci/jwt/src/Signer/Hmac.php | 44 +++++ .../lcobucci/jwt/src/Signer/Hmac/Sha256.php | 24 +++ .../lcobucci/jwt/src/Signer/Hmac/Sha384.php | 24 +++ .../lcobucci/jwt/src/Signer/Hmac/Sha512.php | 24 +++ .../jwt/src/Signer/InvalidKeyProvided.php | 47 +++++ .../vendor/lcobucci/jwt/src/Signer/Key.php | 12 ++ .../jwt/src/Signer/Key/FileCouldNotBeRead.php | 20 ++ .../lcobucci/jwt/src/Signer/Key/InMemory.php | 82 ++++++++ .../lcobucci/jwt/src/Signer/OpenSSL.php | 126 ++++++++++++ .../vendor/lcobucci/jwt/src/Signer/Rsa.php | 35 ++++ .../lcobucci/jwt/src/Signer/Rsa/Sha256.php | 21 ++ .../lcobucci/jwt/src/Signer/Rsa/Sha384.php | 21 ++ .../lcobucci/jwt/src/Signer/Rsa/Sha512.php | 21 ++ .../lcobucci/jwt/src/SodiumBase64Polyfill.php | 98 ++++++++++ .../vendor/lcobucci/jwt/src/Token.php | 65 +++++++ .../vendor/lcobucci/jwt/src/Token/Builder.php | 125 ++++++++++++ .../vendor/lcobucci/jwt/src/Token/DataSet.php | 37 ++++ .../jwt/src/Token/InvalidTokenStructure.php | 41 ++++ .../vendor/lcobucci/jwt/src/Token/Parser.php | 180 ++++++++++++++++++ .../vendor/lcobucci/jwt/src/Token/Plain.php | 85 +++++++++ .../jwt/src/Token/RegisteredClaimGiven.php | 21 ++ .../jwt/src/Token/RegisteredClaims.php | 77 ++++++++ .../lcobucci/jwt/src/Token/Signature.php | 31 +++ .../jwt/src/Token/UnsupportedHeaderFound.php | 15 ++ .../lcobucci/jwt/src/UnencryptedToken.php | 27 +++ .../jwt/src/Validation/Constraint.php | 12 ++ .../CannotValidateARegisteredClaim.php | 18 ++ .../Constraint/HasClaimWithValue.php | 42 ++++ .../Validation/Constraint/IdentifiedBy.php | 26 +++ .../src/Validation/Constraint/IssuedBy.php | 30 +++ .../Constraint/LeewayCannotBeNegative.php | 15 ++ .../Validation/Constraint/LooseValidAt.php | 67 +++++++ .../Validation/Constraint/PermittedFor.php | 26 +++ .../src/Validation/Constraint/RelatedTo.php | 26 +++ .../src/Validation/Constraint/SignedWith.php | 32 ++++ .../Constraint/SignedWithOneInSet.php | 38 ++++ .../Constraint/SignedWithUntilDate.php | 47 +++++ .../Validation/Constraint/StrictValidAt.php | 84 ++++++++ .../src/Validation/ConstraintViolation.php | 24 +++ .../jwt/src/Validation/NoConstraintsGiven.php | 11 ++ .../RequiredConstraintsViolated.php | 48 +++++ .../jwt/src/Validation/SignedWith.php | 8 + .../lcobucci/jwt/src/Validation/ValidAt.php | 8 + .../lcobucci/jwt/src/Validation/Validator.php | 56 ++++++ .../vendor/lcobucci/jwt/src/Validator.php | 20 ++ pandora_console/vendor/psr/clock/CHANGELOG.md | 11 ++ pandora_console/vendor/psr/clock/LICENSE | 19 ++ pandora_console/vendor/psr/clock/README.md | 61 ++++++ .../vendor/psr/clock/composer.json | 21 ++ .../vendor/psr/clock/src/ClockInterface.php | 13 ++ 94 files changed, 3751 insertions(+), 200 deletions(-) create mode 100644 pandora_console/include/class/JWTRepository.class.php create mode 100644 pandora_console/vendor/lcobucci/jwt/.readthedocs.yaml create mode 100644 pandora_console/vendor/lcobucci/jwt/LICENSE create mode 100644 pandora_console/vendor/lcobucci/jwt/composer.json create mode 100644 pandora_console/vendor/lcobucci/jwt/renovate.json create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Builder.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/ClaimsFormatter.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Configuration.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Decoder.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoder.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/CannotDecodeContent.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/CannotEncodeContent.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/ChainedFormatter.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/MicrosecondBasedDateConversion.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Encoding/UnixTimestampDates.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Exception.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/JwtFacade.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Parser.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Blake2b.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/MultibyteStringConverter.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha384.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha512.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/SignatureConverter.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Eddsa.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac/Sha384.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac/Sha512.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/InvalidKeyProvided.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Key.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Key/FileCouldNotBeRead.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Key/InMemory.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/OpenSSL.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa/Sha384.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa/Sha512.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/SodiumBase64Polyfill.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/Builder.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/DataSet.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/Parser.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/Plain.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/RegisteredClaims.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/Signature.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/UnencryptedToken.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/CannotValidateARegisteredClaim.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/HasClaimWithValue.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/LooseValidAt.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithOneInSet.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithUntilDate.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/RequiredConstraintsViolated.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/SignedWith.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/ValidAt.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validation/Validator.php create mode 100644 pandora_console/vendor/lcobucci/jwt/src/Validator.php create mode 100644 pandora_console/vendor/psr/clock/CHANGELOG.md create mode 100644 pandora_console/vendor/psr/clock/LICENSE create mode 100644 pandora_console/vendor/psr/clock/README.md create mode 100644 pandora_console/vendor/psr/clock/composer.json create mode 100644 pandora_console/vendor/psr/clock/src/ClockInterface.php diff --git a/pandora_console/composer.json b/pandora_console/composer.json index 3b05d0f000..9a224bf733 100644 --- a/pandora_console/composer.json +++ b/pandora_console/composer.json @@ -28,7 +28,8 @@ "php-di/php-di": "^7.0", "zircote/swagger-php": "^4.8", "doctrine/annotations": "^2.0", - "ramsey/uuid": "^4.7" + "ramsey/uuid": "^4.7", + "lcobucci/jwt": "^5.2" }, "repositories": { "phpchartjs": { diff --git a/pandora_console/include/class/JWTRepository.class.php b/pandora_console/include/class/JWTRepository.class.php new file mode 100644 index 0000000000..4850fa9e47 --- /dev/null +++ b/pandora_console/include/class/JWTRepository.class.php @@ -0,0 +1,139 @@ +signature = $_signature; + } + + + /** + * Create token + * + * @return string + */ + public function create(): string + { + global $config; + $sha = new Sha256(); + $configJWT = Configuration::forSymmetricSigner( + $sha, + InMemory::plainText($this->signature) + ); + + $now = new DateTimeImmutable(); + $token = $configJWT->builder()->issuedAt($now)->canOnlyBeUsedAfter($now)->expiresAt($now->modify('+1 minute'))->withClaim('id_user', $config['id_user'])->getToken($configJWT->signer(), $configJWT->signingKey()); + + return $token->toString(); + } + + + /** + * Validate a JWT, USE FIRST setToken(). + * + * @return boolean + */ + public function validate():bool + { + $sha = new Sha256(); + $configJWT = Configuration::forSymmetricSigner( + $sha, + InMemory::plainText($this->signature) + ); + $signed = new SignedWith($sha, InMemory::plainText($this->signature)); + $constraints = [$signed]; + + return $configJWT->validator()->validate($this->token, ...$constraints); + } + + + /** + * Get payload of token. + * + * @return object + */ + public function payload():object + { + return $this->token->claims(); + } + + + public function setToken(string $tokenString) + { + $encoder = new JoseEncoder(); + $parser = new Parser($encoder); + $this->token = $parser->parse($tokenString); + } + + + /** + * Generate random signature. + * + * @return string + */ + public static function generateSignature(): string + { + return bin2hex(random_bytes(32)); + } + + +} diff --git a/pandora_console/vendor/autoload.php b/pandora_console/vendor/autoload.php index cac482501f..11b193c3ab 100644 --- a/pandora_console/vendor/autoload.php +++ b/pandora_console/vendor/autoload.php @@ -2,24 +2,6 @@ // autoload.php @generated by Composer -if (PHP_VERSION_ID < 50600) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, $err); - } elseif (!headers_sent()) { - echo $err; - } - } - trigger_error( - $err, - E_USER_ERROR - ); -} - require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit94a17e624d873685991e8ae888e00eb9::getLoader(); diff --git a/pandora_console/vendor/composer/ClassLoader.php b/pandora_console/vendor/composer/ClassLoader.php index a72151c77c..afef3fa2ad 100644 --- a/pandora_console/vendor/composer/ClassLoader.php +++ b/pandora_console/vendor/composer/ClassLoader.php @@ -42,9 +42,6 @@ namespace Composer\Autoload; */ class ClassLoader { - /** @var \Closure(string):void */ - private static $includeFile; - /** @var ?string */ private $vendorDir; @@ -109,7 +106,6 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); } /** @@ -429,8 +425,7 @@ class ClassLoader public function loadClass($class) { if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); + includeFile($file); return true; } @@ -560,26 +555,18 @@ class ClassLoader return false; } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; } diff --git a/pandora_console/vendor/composer/InstalledVersions.php b/pandora_console/vendor/composer/InstalledVersions.php index 39e55eab59..d50e0c9fcc 100644 --- a/pandora_console/vendor/composer/InstalledVersions.php +++ b/pandora_console/vendor/composer/InstalledVersions.php @@ -21,14 +21,12 @@ use Composer\Semver\VersionParser; * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null */ private static $installed; @@ -39,7 +37,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -98,7 +96,7 @@ class InstalledVersions { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); } } @@ -119,7 +117,7 @@ class InstalledVersions */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints((string) $constraint); + $constraint = $parser->parseConstraints($constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -243,7 +241,7 @@ class InstalledVersions /** * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -257,7 +255,7 @@ class InstalledVersions * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} */ public static function getRawData() { @@ -266,7 +264,7 @@ class InstalledVersions if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) { + if (substr(__DIR__, -8, 1) !== 'C') { self::$installed = include __DIR__ . '/installed.php'; } else { self::$installed = array(); @@ -280,7 +278,7 @@ class InstalledVersions * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -303,7 +301,7 @@ class InstalledVersions * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data */ public static function reload($data) { @@ -313,7 +311,7 @@ class InstalledVersions /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -328,9 +326,7 @@ class InstalledVersions if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -341,18 +337,13 @@ class InstalledVersions if (null === self::$installed) { // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; } else { self::$installed = array(); } } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } + $installed[] = self::$installed; return $installed; } diff --git a/pandora_console/vendor/composer/autoload_classmap.php b/pandora_console/vendor/composer/autoload_classmap.php index cae0fc2f27..53268f2a43 100644 --- a/pandora_console/vendor/composer/autoload_classmap.php +++ b/pandora_console/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( diff --git a/pandora_console/vendor/composer/autoload_files.php b/pandora_console/vendor/composer/autoload_files.php index 6d15dcb42d..ebde7fd0d4 100644 --- a/pandora_console/vendor/composer/autoload_files.php +++ b/pandora_console/vendor/composer/autoload_files.php @@ -2,33 +2,28 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( 'e8aa6e4b5a1db2f56ae794f1505391a8' => $vendorDir . '/amphp/amp/lib/functions.php', '76cd0796156622033397994f25b0d8fc' => $vendorDir . '/amphp/amp/lib/Internal/functions.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '6cd5651c4fef5ed6b63e8d8b8ffbf3cc' => $vendorDir . '/amphp/byte-stream/lib/functions.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '6cd5651c4fef5ed6b63e8d8b8ffbf3cc' => $vendorDir . '/amphp/byte-stream/lib/functions.php', + '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '3da389f428d8ee50333e4391c3f45046' => $vendorDir . '/amphp/serialization/src/functions.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '8dc56fe697ca93c4b40d876df1c94584' => $vendorDir . '/amphp/process/lib/functions.php', 'bcb7d4fc55f4b1a7e10f5806723e9892' => $vendorDir . '/amphp/sync/src/functions.php', 'e187e371b30897d6dc51cac6a8c94ff6' => $vendorDir . '/amphp/sync/src/ConcurrentIterator/functions.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', '430de19db8b7ee88fdbe5c545d82d33d' => $vendorDir . '/amphp/parallel/lib/Context/functions.php', '888e1afeed2e8d13ef5a662692091e6e' => $vendorDir . '/amphp/parallel/lib/Sync/functions.php', '384cf4f2eb4d2f896db72315a76066ad' => $vendorDir . '/amphp/parallel/lib/Worker/functions.php', - '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php', - '861372841bb4b8ba9fdd215894666f40' => $vendorDir . '/amphp/parallel-functions/src/functions.php', '07d7f1a47144818725fd8d91a907ac57' => $vendorDir . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => $vendorDir . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -36,6 +31,11 @@ return array( 'de95e0ac670b27c84ef8c5ac41fc1b34' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_server.php', 'b6c2870932b0250c10334a86dcb33c7f' => $vendorDir . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php', 'd02cf21124526632320d6f20b1bbf905' => $vendorDir . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php', + '6124b4c8570aa390c21fafd04a26c69f' => $vendorDir . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + '253c157292f75eb38082b5acb06f3f01' => $vendorDir . '/nikic/fast-route/src/functions.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => $vendorDir . '/symfony/polyfill-iconv/bootstrap.php', + '861372841bb4b8ba9fdd215894666f40' => $vendorDir . '/amphp/parallel-functions/src/functions.php', 'db356362850385d08a5381de2638b5fd' => $vendorDir . '/mpdf/mpdf/src/functions.php', 'b33e3d135e5d9e47d845c576147bda89' => $vendorDir . '/php-di/php-di/src/functions.php', 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', diff --git a/pandora_console/vendor/composer/autoload_namespaces.php b/pandora_console/vendor/composer/autoload_namespaces.php index 15a2ff3ad6..b7fc0125db 100644 --- a/pandora_console/vendor/composer/autoload_namespaces.php +++ b/pandora_console/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( diff --git a/pandora_console/vendor/composer/autoload_psr4.php b/pandora_console/vendor/composer/autoload_psr4.php index 2b2cd523ee..ce98d6d4f1 100644 --- a/pandora_console/vendor/composer/autoload_psr4.php +++ b/pandora_console/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( @@ -31,6 +31,7 @@ return array( 'Psr\\Http\\Server\\' => array($vendorDir . '/psr/http-server-handler/src', $vendorDir . '/psr/http-server-middleware/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'), 'Psr\\Cache\\' => array($vendorDir . '/psr/cache/src'), 'PandoraFMS\\Enterprise\\' => array($baseDir . '/enterprise/include/lib'), 'PandoraFMS\\' => array($baseDir . '/include/lib'), @@ -42,6 +43,7 @@ return array( 'Mpdf\\' => array($vendorDir . '/mpdf/mpdf/src'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'Models\\' => array($baseDir . '/include/rest-api/models'), + 'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'), 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'), 'Laminas\\Json\\' => array($vendorDir . '/laminas/laminas-json/src'), 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'), diff --git a/pandora_console/vendor/composer/autoload_real.php b/pandora_console/vendor/composer/autoload_real.php index 12944ee0da..5a1c32f8a7 100644 --- a/pandora_console/vendor/composer/autoload_real.php +++ b/pandora_console/vendor/composer/autoload_real.php @@ -25,26 +25,56 @@ class ComposerAutoloaderInit94a17e624d873685991e8ae888e00eb9 require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit94a17e624d873685991e8ae888e00eb9', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); spl_autoload_unregister(array('ComposerAutoloaderInit94a17e624d873685991e8ae888e00eb9', 'loadClassLoader')); - require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit94a17e624d873685991e8ae888e00eb9::getInitializer($loader)); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit94a17e624d873685991e8ae888e00eb9::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit94a17e624d873685991e8ae888e00eb9::$files; - $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } - }, null, null); - foreach ($filesToLoad as $fileIdentifier => $file) { - $requireFile($fileIdentifier, $file); + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit94a17e624d873685991e8ae888e00eb9::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire94a17e624d873685991e8ae888e00eb9($fileIdentifier, $file); } return $loader; } } + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire94a17e624d873685991e8ae888e00eb9($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/pandora_console/vendor/composer/autoload_static.php b/pandora_console/vendor/composer/autoload_static.php index 7338ae1edc..f3e9754aec 100644 --- a/pandora_console/vendor/composer/autoload_static.php +++ b/pandora_console/vendor/composer/autoload_static.php @@ -10,26 +10,21 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 'e8aa6e4b5a1db2f56ae794f1505391a8' => __DIR__ . '/..' . '/amphp/amp/lib/functions.php', '76cd0796156622033397994f25b0d8fc' => __DIR__ . '/..' . '/amphp/amp/lib/Internal/functions.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '6cd5651c4fef5ed6b63e8d8b8ffbf3cc' => __DIR__ . '/..' . '/amphp/byte-stream/lib/functions.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '6cd5651c4fef5ed6b63e8d8b8ffbf3cc' => __DIR__ . '/..' . '/amphp/byte-stream/lib/functions.php', + '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '3da389f428d8ee50333e4391c3f45046' => __DIR__ . '/..' . '/amphp/serialization/src/functions.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '8dc56fe697ca93c4b40d876df1c94584' => __DIR__ . '/..' . '/amphp/process/lib/functions.php', 'bcb7d4fc55f4b1a7e10f5806723e9892' => __DIR__ . '/..' . '/amphp/sync/src/functions.php', 'e187e371b30897d6dc51cac6a8c94ff6' => __DIR__ . '/..' . '/amphp/sync/src/ConcurrentIterator/functions.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', '430de19db8b7ee88fdbe5c545d82d33d' => __DIR__ . '/..' . '/amphp/parallel/lib/Context/functions.php', '888e1afeed2e8d13ef5a662692091e6e' => __DIR__ . '/..' . '/amphp/parallel/lib/Sync/functions.php', '384cf4f2eb4d2f896db72315a76066ad' => __DIR__ . '/..' . '/amphp/parallel/lib/Worker/functions.php', - '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', - '253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', - '667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php', - '861372841bb4b8ba9fdd215894666f40' => __DIR__ . '/..' . '/amphp/parallel-functions/src/functions.php', '07d7f1a47144818725fd8d91a907ac57' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/create_uploaded_file.php', 'da94ac5d3ca7d2dbab84ce561ce72bfd' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_headers_from_sapi.php', '3d97c8dcdfba8cb85d3b34f116bb248b' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/marshal_method_from_sapi.php', @@ -37,6 +32,11 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 'de95e0ac670b27c84ef8c5ac41fc1b34' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_server.php', 'b6c2870932b0250c10334a86dcb33c7f' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/normalize_uploaded_files.php', 'd02cf21124526632320d6f20b1bbf905' => __DIR__ . '/..' . '/laminas/laminas-diactoros/src/functions/parse_cookie_header.php', + '6124b4c8570aa390c21fafd04a26c69f' => __DIR__ . '/..' . '/myclabs/deep-copy/src/DeepCopy/deep_copy.php', + '253c157292f75eb38082b5acb06f3f01' => __DIR__ . '/..' . '/nikic/fast-route/src/functions.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + 'def43f6c87e4f8dfd0c9e1b1bab14fe8' => __DIR__ . '/..' . '/symfony/polyfill-iconv/bootstrap.php', + '861372841bb4b8ba9fdd215894666f40' => __DIR__ . '/..' . '/amphp/parallel-functions/src/functions.php', 'db356362850385d08a5381de2638b5fd' => __DIR__ . '/..' . '/mpdf/mpdf/src/functions.php', 'b33e3d135e5d9e47d845c576147bda89' => __DIR__ . '/..' . '/php-di/php-di/src/functions.php', 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', @@ -90,6 +90,7 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 'Psr\\Http\\Server\\' => 16, 'Psr\\Http\\Message\\' => 17, 'Psr\\Container\\' => 14, + 'Psr\\Clock\\' => 10, 'Psr\\Cache\\' => 10, 'PandoraFMS\\Enterprise\\' => 22, 'PandoraFMS\\' => 11, @@ -113,6 +114,7 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 ), 'L' => array ( + 'Lcobucci\\JWT\\' => 13, 'Laravel\\SerializableClosure\\' => 28, 'Laminas\\Json\\' => 13, 'Laminas\\Diactoros\\' => 18, @@ -271,6 +273,10 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 array ( 0 => __DIR__ . '/..' . '/psr/container/src', ), + 'Psr\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/clock/src', + ), 'Psr\\Cache\\' => array ( 0 => __DIR__ . '/..' . '/psr/cache/src', @@ -315,6 +321,10 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 array ( 0 => __DIR__ . '/../..' . '/include/rest-api/models', ), + 'Lcobucci\\JWT\\' => + array ( + 0 => __DIR__ . '/..' . '/lcobucci/jwt/src', + ), 'Laravel\\SerializableClosure\\' => array ( 0 => __DIR__ . '/..' . '/laravel/serializable-closure/src', diff --git a/pandora_console/vendor/composer/installed.json b/pandora_console/vendor/composer/installed.json index 3ba9ef68d3..91273cf5e4 100644 --- a/pandora_console/vendor/composer/installed.json +++ b/pandora_console/vendor/composer/installed.json @@ -1616,6 +1616,82 @@ }, "install-path": "../laravel/serializable-closure" }, + { + "name": "lcobucci/jwt", + "version": "5.2.0", + "version_normalized": "5.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/0ba88aed12c04bd2ed9924f500673f32b67a6211", + "reference": "0ba88aed12c04bd2ed9924f500673f32b67a6211", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-sodium": "*", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" + }, + "require-dev": { + "infection/infection": "^0.27.0", + "lcobucci/clock": "^3.0", + "lcobucci/coding-standard": "^11.0", + "phpbench/phpbench": "^1.2.9", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.10.7", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.10", + "phpstan/phpstan-strict-rules": "^1.5.0", + "phpunit/phpunit": "^10.2.6" + }, + "suggest": { + "lcobucci/clock": ">= 3.0" + }, + "time": "2023-11-20T21:17:42+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "support": { + "issues": "https://github.com/lcobucci/jwt/issues", + "source": "https://github.com/lcobucci/jwt/tree/5.2.0" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "install-path": "../lcobucci/jwt" + }, { "name": "monolog/monolog", "version": "3.5.0", @@ -2406,6 +2482,57 @@ }, "install-path": "../psr/cache" }, + { + "name": "psr/clock", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "time": "2022-11-25T14:36:26+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "install-path": "../psr/clock" + }, { "name": "psr/container", "version": "2.0.2", diff --git a/pandora_console/vendor/composer/installed.php b/pandora_console/vendor/composer/installed.php index 132d3269a2..3f9b50d14e 100644 --- a/pandora_console/vendor/composer/installed.php +++ b/pandora_console/vendor/composer/installed.php @@ -1,328 +1,337 @@ array( - 'name' => 'pandorafms/console', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '8bf414b51f3333555f84df8b23614ca4b68c7fd4', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), + 'reference' => 'fbec8c0a05f72bfcc2044c0a4857d5e31f534ad5', + 'name' => 'pandorafms/console', 'dev' => true, ), 'versions' => array( 'amphp/amp' => array( 'pretty_version' => 'v2.6.2', 'version' => '2.6.2.0', - 'reference' => '9d5100cebffa729aaffecd3ad25dc5aeea4f13bb', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/amp', 'aliases' => array(), + 'reference' => '9d5100cebffa729aaffecd3ad25dc5aeea4f13bb', 'dev_requirement' => false, ), 'amphp/byte-stream' => array( 'pretty_version' => 'v1.8.1', 'version' => '1.8.1.0', - 'reference' => 'acbd8002b3536485c997c4e019206b3f10ca15bd', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/byte-stream', 'aliases' => array(), + 'reference' => 'acbd8002b3536485c997c4e019206b3f10ca15bd', 'dev_requirement' => false, ), 'amphp/parallel' => array( 'pretty_version' => 'v1.4.3', 'version' => '1.4.3.0', - 'reference' => '3aac213ba7858566fd83d38ccb85b91b2d652cb0', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/parallel', 'aliases' => array(), + 'reference' => '3aac213ba7858566fd83d38ccb85b91b2d652cb0', 'dev_requirement' => false, ), 'amphp/parallel-functions' => array( 'pretty_version' => 'v1.1.0', 'version' => '1.1.0.0', - 'reference' => '04e92fcacfc921a56dfe12c23b3265e62593a7cb', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/parallel-functions', 'aliases' => array(), + 'reference' => '04e92fcacfc921a56dfe12c23b3265e62593a7cb', 'dev_requirement' => false, ), 'amphp/parser' => array( 'pretty_version' => 'v1.1.0', 'version' => '1.1.0.0', - 'reference' => 'ff1de4144726c5dad5fab97f66692ebe8de3e151', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/parser', 'aliases' => array(), + 'reference' => 'ff1de4144726c5dad5fab97f66692ebe8de3e151', 'dev_requirement' => false, ), 'amphp/process' => array( 'pretty_version' => 'v1.1.4', 'version' => '1.1.4.0', - 'reference' => '76e9495fd6818b43a20167cb11d8a67f7744ee0f', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/process', 'aliases' => array(), + 'reference' => '76e9495fd6818b43a20167cb11d8a67f7744ee0f', 'dev_requirement' => false, ), 'amphp/serialization' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', - 'reference' => '693e77b2fb0b266c3c7d622317f881de44ae94a1', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/serialization', 'aliases' => array(), + 'reference' => '693e77b2fb0b266c3c7d622317f881de44ae94a1', 'dev_requirement' => false, ), 'amphp/sync' => array( 'pretty_version' => 'v1.4.2', 'version' => '1.4.2.0', - 'reference' => '85ab06764f4f36d63b1356b466df6111cf4b89cf', 'type' => 'library', 'install_path' => __DIR__ . '/../amphp/sync', 'aliases' => array(), + 'reference' => '85ab06764f4f36d63b1356b466df6111cf4b89cf', 'dev_requirement' => false, ), 'artica/phpchartjs' => array( 'pretty_version' => 'v1.0.2', 'version' => '1.0.2.0', - 'reference' => '681980c084ad505f9dc811d3d1f02ffc9442ccee', 'type' => 'package', 'install_path' => __DIR__ . '/../artica/phpchartjs', 'aliases' => array(), + 'reference' => '681980c084ad505f9dc811d3d1f02ffc9442ccee', 'dev_requirement' => false, ), 'brick/math' => array( 'pretty_version' => '0.11.0', 'version' => '0.11.0.0', - 'reference' => '0ad82ce168c82ba30d1c01ec86116ab52f589478', 'type' => 'library', 'install_path' => __DIR__ . '/../brick/math', 'aliases' => array(), + 'reference' => '0ad82ce168c82ba30d1c01ec86116ab52f589478', 'dev_requirement' => false, ), 'chrome-php/chrome' => array( 'pretty_version' => 'v1.10.0', 'version' => '1.10.0.0', - 'reference' => '2b7cb13e618602d13bdede20b6b7ae478f3f6eaa', 'type' => 'library', 'install_path' => __DIR__ . '/../chrome-php/chrome', 'aliases' => array(), + 'reference' => '2b7cb13e618602d13bdede20b6b7ae478f3f6eaa', 'dev_requirement' => false, ), 'chrome-php/wrench' => array( 'pretty_version' => 'v1.5.0', 'version' => '1.5.0.0', - 'reference' => '725246324339e5fd5d798361b561e81004324f96', 'type' => 'library', 'install_path' => __DIR__ . '/../chrome-php/wrench', 'aliases' => array(), + 'reference' => '725246324339e5fd5d798361b561e81004324f96', 'dev_requirement' => false, ), 'doctrine/annotations' => array( 'pretty_version' => '2.0.1', 'version' => '2.0.1.0', - 'reference' => 'e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/annotations', 'aliases' => array(), + 'reference' => 'e157ef3f3124bbf6fe7ce0ffd109e8a8ef284e7f', 'dev_requirement' => false, ), 'doctrine/deprecations' => array( 'pretty_version' => '1.1.3', 'version' => '1.1.3.0', - 'reference' => 'dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/deprecations', 'aliases' => array(), + 'reference' => 'dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab', 'dev_requirement' => false, ), 'doctrine/lexer' => array( 'pretty_version' => '2.1.0', 'version' => '2.1.0.0', - 'reference' => '39ab8fcf5a51ce4b85ca97c7a7d033eb12831124', 'type' => 'library', 'install_path' => __DIR__ . '/../doctrine/lexer', 'aliases' => array(), + 'reference' => '39ab8fcf5a51ce4b85ca97c7a7d033eb12831124', 'dev_requirement' => false, ), 'egulias/email-validator' => array( 'pretty_version' => '3.2.6', 'version' => '3.2.6.0', - 'reference' => 'e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7', 'type' => 'library', 'install_path' => __DIR__ . '/../egulias/email-validator', 'aliases' => array(), + 'reference' => 'e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7', 'dev_requirement' => false, ), 'evenement/evenement' => array( 'pretty_version' => 'v3.0.2', 'version' => '3.0.2.0', - 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'type' => 'library', 'install_path' => __DIR__ . '/../evenement/evenement', 'aliases' => array(), + 'reference' => '0a16b0d71ab13284339abb99d9d2bd813640efbc', 'dev_requirement' => false, ), 'fig/http-message-util' => array( 'pretty_version' => '1.1.5', 'version' => '1.1.5.0', - 'reference' => '9d94dc0154230ac39e5bf89398b324a86f63f765', 'type' => 'library', 'install_path' => __DIR__ . '/../fig/http-message-util', 'aliases' => array(), + 'reference' => '9d94dc0154230ac39e5bf89398b324a86f63f765', 'dev_requirement' => false, ), 'guzzlehttp/psr7' => array( 'pretty_version' => '2.6.2', 'version' => '2.6.2.0', - 'reference' => '45b30f99ac27b5ca93cb4831afe16285f57b8221', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), + 'reference' => '45b30f99ac27b5ca93cb4831afe16285f57b8221', 'dev_requirement' => false, ), 'halfpastfouram/collection' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', - 'reference' => '0862d0b431fef9dc2245518dc06b86ff00dcd102', 'type' => 'package', 'install_path' => __DIR__ . '/../halfpastfouram/collection', 'aliases' => array(), + 'reference' => '0862d0b431fef9dc2245518dc06b86ff00dcd102', 'dev_requirement' => false, ), 'laminas/laminas-diactoros' => array( 'pretty_version' => '3.3.0', 'version' => '3.3.0.0', - 'reference' => '4db52734837c60259c9b2d7caf08eef8f7f9b9ac', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-diactoros', 'aliases' => array(), + 'reference' => '4db52734837c60259c9b2d7caf08eef8f7f9b9ac', 'dev_requirement' => false, ), 'laminas/laminas-json' => array( 'pretty_version' => '3.6.0', 'version' => '3.6.0.0', - 'reference' => '53ff787b20b77197f38680c737e8dfffa846b85b', 'type' => 'library', 'install_path' => __DIR__ . '/../laminas/laminas-json', 'aliases' => array(), + 'reference' => '53ff787b20b77197f38680c737e8dfffa846b85b', 'dev_requirement' => false, ), 'laravel/serializable-closure' => array( 'pretty_version' => 'v1.3.3', 'version' => '1.3.3.0', - 'reference' => '3dbf8a8e914634c48d389c1234552666b3d43754', 'type' => 'library', 'install_path' => __DIR__ . '/../laravel/serializable-closure', 'aliases' => array(), + 'reference' => '3dbf8a8e914634c48d389c1234552666b3d43754', + 'dev_requirement' => false, + ), + 'lcobucci/jwt' => array( + 'pretty_version' => '5.2.0', + 'version' => '5.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../lcobucci/jwt', + 'aliases' => array(), + 'reference' => '0ba88aed12c04bd2ed9924f500673f32b67a6211', 'dev_requirement' => false, ), 'monolog/monolog' => array( 'pretty_version' => '3.5.0', 'version' => '3.5.0.0', - 'reference' => 'c915e2634718dbc8a4a15c61b0e62e7a44e14448', 'type' => 'library', 'install_path' => __DIR__ . '/../monolog/monolog', 'aliases' => array(), + 'reference' => 'c915e2634718dbc8a4a15c61b0e62e7a44e14448', 'dev_requirement' => false, ), 'mpdf/mpdf' => array( 'pretty_version' => 'v8.2.2', 'version' => '8.2.2.0', - 'reference' => '596a87b876d7793be7be060a8ac13424de120dd5', 'type' => 'library', 'install_path' => __DIR__ . '/../mpdf/mpdf', 'aliases' => array(), + 'reference' => '596a87b876d7793be7be060a8ac13424de120dd5', 'dev_requirement' => false, ), 'mpdf/psr-http-message-shim' => array( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', - 'reference' => '3206e6b80b6d2479e148ee497e9f2bebadc919db', 'type' => 'library', 'install_path' => __DIR__ . '/../mpdf/psr-http-message-shim', 'aliases' => array(), + 'reference' => '3206e6b80b6d2479e148ee497e9f2bebadc919db', 'dev_requirement' => false, ), 'mpdf/psr-log-aware-trait' => array( 'pretty_version' => 'v3.0.0', 'version' => '3.0.0.0', - 'reference' => 'a633da6065e946cc491e1c962850344bb0bf3e78', 'type' => 'library', 'install_path' => __DIR__ . '/../mpdf/psr-log-aware-trait', 'aliases' => array(), + 'reference' => 'a633da6065e946cc491e1c962850344bb0bf3e78', 'dev_requirement' => false, ), 'myclabs/deep-copy' => array( 'pretty_version' => '1.11.1', 'version' => '1.11.1.0', - 'reference' => '7284c22080590fb39f2ffa3e9057f10a4ddd0e0c', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), + 'reference' => '7284c22080590fb39f2ffa3e9057f10a4ddd0e0c', 'dev_requirement' => false, ), 'nikic/fast-route' => array( 'pretty_version' => 'v1.3.0', 'version' => '1.3.0.0', - 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/fast-route', 'aliases' => array(), + 'reference' => '181d480e08d9476e61381e04a71b34dc0432e812', 'dev_requirement' => false, ), 'nyholm/psr7' => array( 'pretty_version' => '1.8.1', 'version' => '1.8.1.0', - 'reference' => 'aa5fc277a4f5508013d571341ade0c3886d4d00e', 'type' => 'library', 'install_path' => __DIR__ . '/../nyholm/psr7', 'aliases' => array(), + 'reference' => 'aa5fc277a4f5508013d571341ade0c3886d4d00e', 'dev_requirement' => false, ), 'nyholm/psr7-server' => array( 'pretty_version' => '1.1.0', 'version' => '1.1.0.0', - 'reference' => '4335801d851f554ca43fa6e7d2602141538854dc', 'type' => 'library', 'install_path' => __DIR__ . '/../nyholm/psr7-server', 'aliases' => array(), + 'reference' => '4335801d851f554ca43fa6e7d2602141538854dc', 'dev_requirement' => false, ), 'pandorafms/console' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '8bf414b51f3333555f84df8b23614ca4b68c7fd4', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), + 'reference' => 'fbec8c0a05f72bfcc2044c0a4857d5e31f534ad5', 'dev_requirement' => false, ), 'paragonie/random_compat' => array( 'pretty_version' => 'v9.99.100', 'version' => '9.99.100.0', - 'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a', 'type' => 'library', 'install_path' => __DIR__ . '/../paragonie/random_compat', 'aliases' => array(), + 'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a', 'dev_requirement' => false, ), 'php-di/invoker' => array( 'pretty_version' => '2.3.4', 'version' => '2.3.4.0', - 'reference' => '33234b32dafa8eb69202f950a1fc92055ed76a86', 'type' => 'library', 'install_path' => __DIR__ . '/../php-di/invoker', 'aliases' => array(), + 'reference' => '33234b32dafa8eb69202f950a1fc92055ed76a86', 'dev_requirement' => false, ), 'php-di/php-di' => array( 'pretty_version' => '7.0.6', 'version' => '7.0.6.0', - 'reference' => '8097948a89f6ec782839b3e958432f427cac37fd', 'type' => 'library', 'install_path' => __DIR__ . '/../php-di/php-di', 'aliases' => array(), + 'reference' => '8097948a89f6ec782839b3e958432f427cac37fd', 'dev_requirement' => false, ), 'php-http/message-factory-implementation' => array( @@ -334,19 +343,28 @@ 'psr/cache' => array( 'pretty_version' => '3.0.0', 'version' => '3.0.0.0', - 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/cache', 'aliases' => array(), + 'reference' => 'aa5030cfa5405eccfdcb1083ce040c2cb8d253bf', + 'dev_requirement' => false, + ), + 'psr/clock' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/clock', + 'aliases' => array(), + 'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d', 'dev_requirement' => false, ), 'psr/container' => array( 'pretty_version' => '2.0.2', 'version' => '2.0.2.0', - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', 'dev_requirement' => false, ), 'psr/container-implementation' => array( @@ -358,10 +376,10 @@ 'psr/http-factory' => array( 'pretty_version' => '1.0.2', 'version' => '1.0.2.0', - 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'dev_requirement' => false, ), 'psr/http-factory-implementation' => array( @@ -374,10 +392,10 @@ 'psr/http-message' => array( 'pretty_version' => '1.1', 'version' => '1.1.0.0', - 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), + 'reference' => 'cb6ce4845ce34a8ad9e68117c10ee90a29919eba', 'dev_requirement' => false, ), 'psr/http-message-implementation' => array( @@ -390,28 +408,28 @@ 'psr/http-server-handler' => array( 'pretty_version' => '1.0.2', 'version' => '1.0.2.0', - 'reference' => '84c4fb66179be4caaf8e97bd239203245302e7d4', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-server-handler', 'aliases' => array(), + 'reference' => '84c4fb66179be4caaf8e97bd239203245302e7d4', 'dev_requirement' => false, ), 'psr/http-server-middleware' => array( 'pretty_version' => '1.0.2', 'version' => '1.0.2.0', - 'reference' => 'c1481f747daaa6a0782775cd6a8c26a1bf4a3829', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-server-middleware', 'aliases' => array(), + 'reference' => 'c1481f747daaa6a0782775cd6a8c26a1bf4a3829', 'dev_requirement' => false, ), 'psr/log' => array( 'pretty_version' => '3.0.0', 'version' => '3.0.0.0', - 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), + 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'dev_requirement' => false, ), 'psr/log-implementation' => array( @@ -423,28 +441,28 @@ 'ralouphie/getallheaders' => array( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'dev_requirement' => false, ), 'ramsey/collection' => array( 'pretty_version' => '2.0.0', 'version' => '2.0.0.0', - 'reference' => 'a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5', 'type' => 'library', 'install_path' => __DIR__ . '/../ramsey/collection', 'aliases' => array(), + 'reference' => 'a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5', 'dev_requirement' => false, ), 'ramsey/uuid' => array( 'pretty_version' => '4.7.5', 'version' => '4.7.5.0', - 'reference' => '5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e', 'type' => 'library', 'install_path' => __DIR__ . '/../ramsey/uuid', 'aliases' => array(), + 'reference' => '5f0df49ae5ad6efb7afa69e6bfab4e5b1e080d8e', 'dev_requirement' => false, ), 'rhumsaa/uuid' => array( @@ -456,172 +474,172 @@ 'setasign/fpdi' => array( 'pretty_version' => 'v2.6.0', 'version' => '2.6.0.0', - 'reference' => 'a6db878129ec6c7e141316ee71872923e7f1b7ad', 'type' => 'library', 'install_path' => __DIR__ . '/../setasign/fpdi', 'aliases' => array(), + 'reference' => 'a6db878129ec6c7e141316ee71872923e7f1b7ad', 'dev_requirement' => false, ), 'slim/psr7' => array( 'pretty_version' => '1.6.1', 'version' => '1.6.1.0', - 'reference' => '72d2b2bac94ab4575d369f605dbfafbe168d3163', 'type' => 'library', 'install_path' => __DIR__ . '/../slim/psr7', 'aliases' => array(), + 'reference' => '72d2b2bac94ab4575d369f605dbfafbe168d3163', 'dev_requirement' => false, ), 'slim/slim' => array( 'pretty_version' => '4.12.0', 'version' => '4.12.0.0', - 'reference' => 'e9e99c2b24398b967841c6c4c3048622cc7e2b18', 'type' => 'library', 'install_path' => __DIR__ . '/../slim/slim', 'aliases' => array(), + 'reference' => 'e9e99c2b24398b967841c6c4c3048622cc7e2b18', 'dev_requirement' => false, ), 'swiftmailer/swiftmailer' => array( 'pretty_version' => 'v6.3.0', 'version' => '6.3.0.0', - 'reference' => '8a5d5072dca8f48460fce2f4131fcc495eec654c', 'type' => 'library', 'install_path' => __DIR__ . '/../swiftmailer/swiftmailer', 'aliases' => array(), + 'reference' => '8a5d5072dca8f48460fce2f4131fcc495eec654c', 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( 'pretty_version' => 'v3.4.0', 'version' => '3.4.0.0', - 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), + 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'dev_requirement' => false, ), 'symfony/filesystem' => array( 'pretty_version' => 'v7.0.3', 'version' => '7.0.3.0', - 'reference' => '2890e3a825bc0c0558526c04499c13f83e1b6b12', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), + 'reference' => '2890e3a825bc0c0558526c04499c13f83e1b6b12', 'dev_requirement' => false, ), 'symfony/finder' => array( 'pretty_version' => 'v7.0.0', 'version' => '7.0.0.0', - 'reference' => '6e5688d69f7cfc4ed4a511e96007e06c2d34ce56', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/finder', 'aliases' => array(), + 'reference' => '6e5688d69f7cfc4ed4a511e96007e06c2d34ce56', 'dev_requirement' => false, ), 'symfony/polyfill-ctype' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), + 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'dev_requirement' => false, ), 'symfony/polyfill-iconv' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => '6de50471469b8c9afc38164452ab2b6170ee71c1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-iconv', 'aliases' => array(), + 'reference' => '6de50471469b8c9afc38164452ab2b6170ee71c1', 'dev_requirement' => false, ), 'symfony/polyfill-intl-idn' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => 'ecaafce9f77234a6a449d29e49267ba10499116d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-idn', 'aliases' => array(), + 'reference' => 'ecaafce9f77234a6a449d29e49267ba10499116d', 'dev_requirement' => false, ), 'symfony/polyfill-intl-normalizer' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => '8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), + 'reference' => '8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92', 'dev_requirement' => false, ), 'symfony/polyfill-mbstring' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => '42292d99c55abe617799667f454222c54c60e229', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), + 'reference' => '42292d99c55abe617799667f454222c54c60e229', 'dev_requirement' => false, ), 'symfony/polyfill-php72' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => '70f4aebd92afca2f865444d30a4d2151c13c3179', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php72', 'aliases' => array(), + 'reference' => '70f4aebd92afca2f865444d30a4d2151c13c3179', 'dev_requirement' => false, ), 'symfony/polyfill-php80' => array( 'pretty_version' => 'v1.28.0', 'version' => '1.28.0.0', - 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), + 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5', 'dev_requirement' => false, ), 'symfony/process' => array( 'pretty_version' => 'v7.0.3', 'version' => '7.0.3.0', - 'reference' => '937a195147e0c27b2759ade834169ed006d0bc74', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/process', 'aliases' => array(), + 'reference' => '937a195147e0c27b2759ade834169ed006d0bc74', 'dev_requirement' => false, ), 'symfony/var-dumper' => array( 'pretty_version' => 'v3.4.47', 'version' => '3.4.47.0', - 'reference' => '0719f6cf4633a38b2c1585140998579ce23b4b7d', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/var-dumper', 'aliases' => array(), + 'reference' => '0719f6cf4633a38b2c1585140998579ce23b4b7d', 'dev_requirement' => false, ), 'symfony/yaml' => array( 'pretty_version' => 'v7.0.3', 'version' => '7.0.3.0', - 'reference' => '2d4fca631c00700597e9442a0b2451ce234513d3', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), + 'reference' => '2d4fca631c00700597e9442a0b2451ce234513d3', 'dev_requirement' => false, ), 'tinymce/tinymce' => array( 'pretty_version' => '6.8.2', 'version' => '6.8.2.0', - 'reference' => 'b0073db409746748af4fc06fbee337bb99f462d9', 'type' => 'component', 'install_path' => __DIR__ . '/../tinymce/tinymce', 'aliases' => array(), + 'reference' => 'b0073db409746748af4fc06fbee337bb99f462d9', 'dev_requirement' => false, ), 'zircote/swagger-php' => array( 'pretty_version' => '4.8.3', 'version' => '4.8.3.0', - 'reference' => '598958d8a83cfbd44ba36388b2f9ed69e8b86ed4', 'type' => 'library', 'install_path' => __DIR__ . '/../zircote/swagger-php', 'aliases' => array(), + 'reference' => '598958d8a83cfbd44ba36388b2f9ed69e8b86ed4', 'dev_requirement' => false, ), ), diff --git a/pandora_console/vendor/composer/platform_check.php b/pandora_console/vendor/composer/platform_check.php index 51c545e82f..d32d90c6a9 100644 --- a/pandora_console/vendor/composer/platform_check.php +++ b/pandora_console/vendor/composer/platform_check.php @@ -16,35 +16,7 @@ if ($issues) { if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); } elseif (!headers_sent()) { - require_once __DIR__.'/../../include/functions_ui.php'; - - $url = str_replace('/var/www/html/', '', __DIR__); - $url = str_replace('/vendor/composer', '', $url); - - echo ''; - ?> - - - - '; - echo '
'; - echo '

Composer detected issues in your platform:

'; - echo '
'; - echo sprintf( - 'PandoraFMS requires PHP 8.2 to work properly and the version %s has been detected. Please update the PHP version of the system.', - PHP_VERSION, - ); - echo '
'; + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; } } trigger_error( diff --git a/pandora_console/vendor/lcobucci/jwt/.readthedocs.yaml b/pandora_console/vendor/lcobucci/jwt/.readthedocs.yaml new file mode 100644 index 0000000000..aa49c94360 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/.readthedocs.yaml @@ -0,0 +1,9 @@ +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3" + +mkdocs: + configuration: mkdocs.yml diff --git a/pandora_console/vendor/lcobucci/jwt/LICENSE b/pandora_console/vendor/lcobucci/jwt/LICENSE new file mode 100644 index 0000000000..cc7e28f16b --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2014, Luís Cobucci +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pandora_console/vendor/lcobucci/jwt/composer.json b/pandora_console/vendor/lcobucci/jwt/composer.json new file mode 100644 index 0000000000..a61868948d --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/composer.json @@ -0,0 +1,63 @@ +{ + "name": "lcobucci/jwt", + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "license": [ + "BSD-3-Clause" + ], + "type": "library", + "keywords": [ + "JWT", + "JWS" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "require": { + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "ext-openssl": "*", + "ext-sodium": "*", + "psr/clock": "^1.0" + }, + "require-dev": { + "infection/infection": "^0.27.0", + "lcobucci/clock": "^3.0", + "lcobucci/coding-standard": "^11.0", + "phpbench/phpbench": "^1.2.9", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.10.7", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.10", + "phpstan/phpstan-strict-rules": "^1.5.0", + "phpunit/phpunit": "^10.2.6" + }, + "suggest": { + "lcobucci/clock": ">= 3.0" + }, + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Lcobucci\\JWT\\Tests\\": "tests" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "infection/extension-installer": true, + "ocramius/package-versions": true, + "phpstan/extension-installer": true + }, + "platform": { + "php": "8.1.99" + }, + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/renovate.json b/pandora_console/vendor/lcobucci/jwt/renovate.json new file mode 100644 index 0000000000..d0adcc3ae4 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "local>lcobucci/.github:renovate-config" + ] +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Builder.php b/pandora_console/vendor/lcobucci/jwt/src/Builder.php new file mode 100644 index 0000000000..4295e3f0b6 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Builder.php @@ -0,0 +1,85 @@ + $claims + * + * @return array + */ + public function formatClaims(array $claims): array; +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Configuration.php b/pandora_console/vendor/lcobucci/jwt/src/Configuration.php new file mode 100644 index 0000000000..488ea3e232 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Configuration.php @@ -0,0 +1,131 @@ +parser = new Token\Parser($decoder); + $this->validator = new Validation\Validator(); + + $this->builderFactory = static function (ClaimsFormatter $claimFormatter) use ($encoder): Builder { + return new Token\Builder($encoder, $claimFormatter); + }; + } + + public static function forAsymmetricSigner( + Signer $signer, + Key $signingKey, + Key $verificationKey, + Encoder $encoder = new JoseEncoder(), + Decoder $decoder = new JoseEncoder(), + ): self { + return new self( + $signer, + $signingKey, + $verificationKey, + $encoder, + $decoder, + ); + } + + public static function forSymmetricSigner( + Signer $signer, + Key $key, + Encoder $encoder = new JoseEncoder(), + Decoder $decoder = new JoseEncoder(), + ): self { + return new self( + $signer, + $key, + $key, + $encoder, + $decoder, + ); + } + + /** @param callable(ClaimsFormatter): Builder $builderFactory */ + public function setBuilderFactory(callable $builderFactory): void + { + $this->builderFactory = $builderFactory(...); + } + + public function builder(?ClaimsFormatter $claimFormatter = null): Builder + { + return ($this->builderFactory)($claimFormatter ?? ChainedFormatter::default()); + } + + public function parser(): Parser + { + return $this->parser; + } + + public function setParser(Parser $parser): void + { + $this->parser = $parser; + } + + public function signer(): Signer + { + return $this->signer; + } + + public function signingKey(): Key + { + return $this->signingKey; + } + + public function verificationKey(): Key + { + return $this->verificationKey; + } + + public function validator(): Validator + { + return $this->validator; + } + + public function setValidator(Validator $validator): void + { + $this->validator = $validator; + } + + /** @return Constraint[] */ + public function validationConstraints(): array + { + return $this->validationConstraints; + } + + public function setValidationConstraints(Constraint ...$validationConstraints): void + { + $this->validationConstraints = $validationConstraints; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Decoder.php b/pandora_console/vendor/lcobucci/jwt/src/Decoder.php new file mode 100644 index 0000000000..6b24b9268d --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Decoder.php @@ -0,0 +1,29 @@ + */ + private array $formatters; + + public function __construct(ClaimsFormatter ...$formatters) + { + $this->formatters = $formatters; + } + + public static function default(): self + { + return new self(new UnifyAudience(), new MicrosecondBasedDateConversion()); + } + + public static function withUnixTimestampDates(): self + { + return new self(new UnifyAudience(), new UnixTimestampDates()); + } + + /** @inheritdoc */ + public function formatClaims(array $claims): array + { + foreach ($this->formatters as $formatter) { + $claims = $formatter->formatClaims($claims); + } + + return $claims; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php b/pandora_console/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php new file mode 100644 index 0000000000..0d9044427e --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Encoding/JoseEncoder.php @@ -0,0 +1,56 @@ +convertDate($claims[$claim]); + } + + return $claims; + } + + private function convertDate(DateTimeImmutable $date): int|float + { + if ($date->format('u') === '000000') { + return (int) $date->format('U'); + } + + return (float) $date->format('U.u'); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php b/pandora_console/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php new file mode 100644 index 0000000000..cf57252e9e --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Encoding/UnifyAudience.php @@ -0,0 +1,29 @@ +convertDate($claims[$claim]); + } + + return $claims; + } + + private function convertDate(DateTimeImmutable $date): int + { + return $date->getTimestamp(); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Exception.php b/pandora_console/vendor/lcobucci/jwt/src/Exception.php new file mode 100644 index 0000000000..4b3916e691 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Exception.php @@ -0,0 +1,10 @@ +clock = $clock ?? new class implements Clock { + public function now(): DateTimeImmutable + { + return new DateTimeImmutable(); + } + }; + } + + /** @param Closure(Builder, DateTimeImmutable):Builder $customiseBuilder */ + public function issue( + Signer $signer, + Key $signingKey, + Closure $customiseBuilder, + ): UnencryptedToken { + $builder = new Token\Builder(new JoseEncoder(), ChainedFormatter::withUnixTimestampDates()); + + $now = $this->clock->now(); + $builder = $builder + ->issuedAt($now) + ->canOnlyBeUsedAfter($now) + ->expiresAt($now->modify('+5 minutes')); + + return $customiseBuilder($builder, $now)->getToken($signer, $signingKey); + } + + /** @param non-empty-string $jwt */ + public function parse( + string $jwt, + SignedWith $signedWith, + ValidAt $validAt, + Constraint ...$constraints, + ): UnencryptedToken { + $token = $this->parser->parse($jwt); + assert($token instanceof UnencryptedToken); + + (new Validator())->assert( + $token, + $signedWith, + $validAt, + ...$constraints, + ); + + return $token; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Parser.php b/pandora_console/vendor/lcobucci/jwt/src/Parser.php new file mode 100644 index 0000000000..fa77f04efc --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Parser.php @@ -0,0 +1,22 @@ +contents()); + + if ($actualKeyLength < self::MINIMUM_KEY_LENGTH_IN_BITS) { + throw InvalidKeyProvided::tooShort(self::MINIMUM_KEY_LENGTH_IN_BITS, $actualKeyLength); + } + + return sodium_crypto_generichash($payload, $key->contents()); + } + + public function verify(string $expected, string $payload, Key $key): bool + { + return hash_equals($expected, $this->sign($payload, $key)); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php new file mode 100644 index 0000000000..35cc4d6ddc --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/CannotSignPayload.php @@ -0,0 +1,15 @@ +converter->fromAsn1( + $this->createSignature($key->contents(), $key->passphrase(), $payload), + $this->pointLength(), + ); + } + + final public function verify(string $expected, string $payload, Key $key): bool + { + return $this->verifySignature( + $this->converter->toAsn1($expected, $this->pointLength()), + $payload, + $key->contents(), + ); + } + + /** {@inheritDoc} */ + final protected function guardAgainstIncompatibleKey(int $type, int $lengthInBits): void + { + if ($type !== OPENSSL_KEYTYPE_EC) { + throw InvalidKeyProvided::incompatibleKeyType( + self::KEY_TYPE_MAP[OPENSSL_KEYTYPE_EC], + self::KEY_TYPE_MAP[$type], + ); + } + + $expectedKeyLength = $this->expectedKeyLength(); + + if ($lengthInBits !== $expectedKeyLength) { + throw InvalidKeyProvided::incompatibleKeyLength($expectedKeyLength, $lengthInBits); + } + } + + /** + * @internal + * + * @return positive-int + */ + abstract public function expectedKeyLength(): int; + + /** + * Returns the length of each point in the signature, so that we can calculate and verify R and S points properly + * + * @internal + * + * @return positive-int + */ + abstract public function pointLength(): int; +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php new file mode 100644 index 0000000000..d9ca751d4e --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/ConversionFailed.php @@ -0,0 +1,25 @@ + self::ASN1_MAX_SINGLE_BYTE ? self::ASN1_LENGTH_2BYTES : ''; + + $asn1 = hex2bin( + self::ASN1_SEQUENCE + . $lengthPrefix . dechex($totalLength) + . self::ASN1_INTEGER . dechex($lengthR) . $pointR + . self::ASN1_INTEGER . dechex($lengthS) . $pointS, + ); + assert(is_string($asn1)); + assert($asn1 !== ''); + + return $asn1; + } + + private static function octetLength(string $data): int + { + return (int) (strlen($data) / self::BYTE_SIZE); + } + + private static function preparePositiveInteger(string $data): string + { + if (substr($data, 0, self::BYTE_SIZE) > self::ASN1_BIG_INTEGER_LIMIT) { + return self::ASN1_NEGATIVE_INTEGER . $data; + } + + while ( + substr($data, 0, self::BYTE_SIZE) === self::ASN1_NEGATIVE_INTEGER + && substr($data, 2, self::BYTE_SIZE) <= self::ASN1_BIG_INTEGER_LIMIT + ) { + $data = substr($data, 2, null); + } + + return $data; + } + + public function fromAsn1(string $signature, int $length): string + { + $message = bin2hex($signature); + $position = 0; + + if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_SEQUENCE) { + throw ConversionFailed::incorrectStartSequence(); + } + + // @phpstan-ignore-next-line + if (self::readAsn1Content($message, $position, self::BYTE_SIZE) === self::ASN1_LENGTH_2BYTES) { + $position += self::BYTE_SIZE; + } + + $pointR = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); + $pointS = self::retrievePositiveInteger(self::readAsn1Integer($message, $position)); + + $points = hex2bin(str_pad($pointR, $length, '0', STR_PAD_LEFT) . str_pad($pointS, $length, '0', STR_PAD_LEFT)); + assert(is_string($points)); + assert($points !== ''); + + return $points; + } + + private static function readAsn1Content(string $message, int &$position, int $length): string + { + $content = substr($message, $position, $length); + $position += $length; + + return $content; + } + + private static function readAsn1Integer(string $message, int &$position): string + { + if (self::readAsn1Content($message, $position, self::BYTE_SIZE) !== self::ASN1_INTEGER) { + throw ConversionFailed::integerExpected(); + } + + $length = (int) hexdec(self::readAsn1Content($message, $position, self::BYTE_SIZE)); + + return self::readAsn1Content($message, $position, $length * self::BYTE_SIZE); + } + + private static function retrievePositiveInteger(string $data): string + { + while ( + substr($data, 0, self::BYTE_SIZE) === self::ASN1_NEGATIVE_INTEGER + && substr($data, 2, self::BYTE_SIZE) > self::ASN1_BIG_INTEGER_LIMIT + ) { + $data = substr($data, 2, null); + } + + return $data; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php new file mode 100644 index 0000000000..ff00f4d47a --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/Ecdsa/Sha256.php @@ -0,0 +1,31 @@ +contents()); + } catch (SodiumException $sodiumException) { + throw new InvalidKeyProvided($sodiumException->getMessage(), 0, $sodiumException); + } + } + + public function verify(string $expected, string $payload, Key $key): bool + { + try { + return sodium_crypto_sign_verify_detached($expected, $payload, $key->contents()); + } catch (SodiumException $sodiumException) { + throw new InvalidKeyProvided($sodiumException->getMessage(), 0, $sodiumException); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac.php new file mode 100644 index 0000000000..815f84c30f --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac.php @@ -0,0 +1,44 @@ +contents()); + $expectedKeyLength = $this->minimumBitsLengthForKey(); + + if ($actualKeyLength < $expectedKeyLength) { + throw InvalidKeyProvided::tooShort($expectedKeyLength, $actualKeyLength); + } + + return hash_hmac($this->algorithm(), $payload, $key->contents(), true); + } + + final public function verify(string $expected, string $payload, Key $key): bool + { + return hash_equals($expected, $this->sign($payload, $key)); + } + + /** + * @internal + * + * @return non-empty-string + */ + abstract public function algorithm(): string; + + /** + * @internal + * + * @return positive-int + */ + abstract public function minimumBitsLengthForKey(): int; +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php new file mode 100644 index 0000000000..e19992ec33 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/Hmac/Sha256.php @@ -0,0 +1,24 @@ +getSize(); + $contents = $fileSize > 0 ? $file->fread($file->getSize()) : ''; + assert(is_string($contents)); + + self::guardAgainstEmptyKey($contents); + + return new self($contents, $passphrase); + } + + /** @phpstan-assert non-empty-string $contents */ + private static function guardAgainstEmptyKey(string $contents): void + { + if ($contents === '') { + throw InvalidKeyProvided::cannotBeEmpty(); + } + } + + public function contents(): string + { + return $this->contents; + } + + public function passphrase(): string + { + return $this->passphrase; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/OpenSSL.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/OpenSSL.php new file mode 100644 index 0000000000..bcc7065c19 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/OpenSSL.php @@ -0,0 +1,126 @@ + 'RSA', + OPENSSL_KEYTYPE_DSA => 'DSA', + OPENSSL_KEYTYPE_DH => 'DH', + OPENSSL_KEYTYPE_EC => 'EC', + ]; + + /** + * @return non-empty-string + * + * @throws CannotSignPayload + * @throws InvalidKeyProvided + */ + final protected function createSignature( + string $pem, + string $passphrase, + string $payload, + ): string { + $key = $this->getPrivateKey($pem, $passphrase); + + $signature = ''; + + if (! openssl_sign($payload, $signature, $key, $this->algorithm())) { + throw CannotSignPayload::errorHappened($this->fullOpenSSLErrorString()); + } + + return $signature; + } + + /** @throws CannotSignPayload */ + private function getPrivateKey(string $pem, string $passphrase): OpenSSLAsymmetricKey + { + return $this->validateKey(openssl_pkey_get_private($pem, $passphrase)); + } + + /** @throws InvalidKeyProvided */ + final protected function verifySignature( + string $expected, + string $payload, + string $pem, + ): bool { + $key = $this->getPublicKey($pem); + $result = openssl_verify($payload, $expected, $key, $this->algorithm()); + + return $result === 1; + } + + /** @throws InvalidKeyProvided */ + private function getPublicKey(string $pem): OpenSSLAsymmetricKey + { + return $this->validateKey(openssl_pkey_get_public($pem)); + } + + /** + * Raises an exception when the key type is not the expected type + * + * @throws InvalidKeyProvided + */ + private function validateKey(OpenSSLAsymmetricKey|bool $key): OpenSSLAsymmetricKey + { + if (is_bool($key)) { + throw InvalidKeyProvided::cannotBeParsed($this->fullOpenSSLErrorString()); + } + + $details = openssl_pkey_get_details($key); + assert(is_array($details)); + + assert(array_key_exists('bits', $details)); + assert(is_int($details['bits'])); + assert(array_key_exists('type', $details)); + assert(is_int($details['type'])); + + $this->guardAgainstIncompatibleKey($details['type'], $details['bits']); + + return $key; + } + + private function fullOpenSSLErrorString(): string + { + $error = ''; + + while ($msg = openssl_error_string()) { + $error .= PHP_EOL . '* ' . $msg; + } + + return $error; + } + + /** @throws InvalidKeyProvided */ + abstract protected function guardAgainstIncompatibleKey(int $type, int $lengthInBits): void; + + /** + * Returns which algorithm to be used to create/verify the signature (using OpenSSL constants) + * + * @internal + */ + abstract public function algorithm(): int; +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa.php new file mode 100644 index 0000000000..ba7d72d5e6 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa.php @@ -0,0 +1,35 @@ +createSignature($key->contents(), $key->passphrase(), $payload); + } + + final public function verify(string $expected, string $payload, Key $key): bool + { + return $this->verifySignature($expected, $payload, $key->contents()); + } + + final protected function guardAgainstIncompatibleKey(int $type, int $lengthInBits): void + { + if ($type !== OPENSSL_KEYTYPE_RSA) { + throw InvalidKeyProvided::incompatibleKeyType( + self::KEY_TYPE_MAP[OPENSSL_KEYTYPE_RSA], + self::KEY_TYPE_MAP[$type], + ); + } + + if ($lengthInBits < self::MINIMUM_KEY_LENGTH) { + throw InvalidKeyProvided::tooShort(self::MINIMUM_KEY_LENGTH, $lengthInBits); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php b/pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php new file mode 100644 index 0000000000..9e56c70f1a --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Signer/Rsa/Sha256.php @@ -0,0 +1,21 @@ + */ + private array $headers = ['typ' => 'JWT', 'alg' => null]; + + /** @var array */ + private array $claims = []; + + public function __construct(private readonly Encoder $encoder, private readonly ClaimsFormatter $claimFormatter) + { + } + + public function permittedFor(string ...$audiences): BuilderInterface + { + $configured = $this->claims[RegisteredClaims::AUDIENCE] ?? []; + $toAppend = array_diff($audiences, $configured); + + return $this->setClaim(RegisteredClaims::AUDIENCE, array_merge($configured, $toAppend)); + } + + public function expiresAt(DateTimeImmutable $expiration): BuilderInterface + { + return $this->setClaim(RegisteredClaims::EXPIRATION_TIME, $expiration); + } + + public function identifiedBy(string $id): BuilderInterface + { + return $this->setClaim(RegisteredClaims::ID, $id); + } + + public function issuedAt(DateTimeImmutable $issuedAt): BuilderInterface + { + return $this->setClaim(RegisteredClaims::ISSUED_AT, $issuedAt); + } + + public function issuedBy(string $issuer): BuilderInterface + { + return $this->setClaim(RegisteredClaims::ISSUER, $issuer); + } + + public function canOnlyBeUsedAfter(DateTimeImmutable $notBefore): BuilderInterface + { + return $this->setClaim(RegisteredClaims::NOT_BEFORE, $notBefore); + } + + public function relatedTo(string $subject): BuilderInterface + { + return $this->setClaim(RegisteredClaims::SUBJECT, $subject); + } + + public function withHeader(string $name, mixed $value): BuilderInterface + { + $new = clone $this; + $new->headers[$name] = $value; + + return $new; + } + + public function withClaim(string $name, mixed $value): BuilderInterface + { + if (in_array($name, RegisteredClaims::ALL, true)) { + throw RegisteredClaimGiven::forClaim($name); + } + + return $this->setClaim($name, $value); + } + + /** @param non-empty-string $name */ + private function setClaim(string $name, mixed $value): BuilderInterface + { + $new = clone $this; + $new->claims[$name] = $value; + + return $new; + } + + /** + * @param array $items + * + * @throws CannotEncodeContent When data cannot be converted to JSON. + */ + private function encode(array $items): string + { + return $this->encoder->base64UrlEncode( + $this->encoder->jsonEncode($items), + ); + } + + public function getToken(Signer $signer, Key $key): UnencryptedToken + { + $headers = $this->headers; + $headers['alg'] = $signer->algorithmId(); + + $encodedHeaders = $this->encode($headers); + $encodedClaims = $this->encode($this->claimFormatter->formatClaims($this->claims)); + + $signature = $signer->sign($encodedHeaders . '.' . $encodedClaims, $key); + $encodedSignature = $this->encoder->base64UrlEncode($signature); + + return new Plain( + new DataSet($headers, $encodedHeaders), + new DataSet($this->claims, $encodedClaims), + new Signature($signature, $encodedSignature), + ); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Token/DataSet.php b/pandora_console/vendor/lcobucci/jwt/src/Token/DataSet.php new file mode 100644 index 0000000000..6c0b98ab14 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Token/DataSet.php @@ -0,0 +1,37 @@ + $data */ + public function __construct(private readonly array $data, private readonly string $encoded) + { + } + + /** @param non-empty-string $name */ + public function get(string $name, mixed $default = null): mixed + { + return $this->data[$name] ?? $default; + } + + /** @param non-empty-string $name */ + public function has(string $name): bool + { + return array_key_exists($name, $this->data); + } + + /** @return array */ + public function all(): array + { + return $this->data; + } + + public function toString(): string + { + return $this->encoded; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php b/pandora_console/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php new file mode 100644 index 0000000000..abba344b75 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Token/InvalidTokenStructure.php @@ -0,0 +1,41 @@ +splitJwt($jwt); + + if ($encodedHeaders === '') { + throw InvalidTokenStructure::missingHeaderPart(); + } + + if ($encodedClaims === '') { + throw InvalidTokenStructure::missingClaimsPart(); + } + + if ($encodedSignature === '') { + throw InvalidTokenStructure::missingSignaturePart(); + } + + $header = $this->parseHeader($encodedHeaders); + + return new Plain( + new DataSet($header, $encodedHeaders), + new DataSet($this->parseClaims($encodedClaims), $encodedClaims), + $this->parseSignature($encodedSignature), + ); + } + + /** + * Splits the JWT string into an array + * + * @param non-empty-string $jwt + * + * @return string[] + * + * @throws InvalidTokenStructure When JWT doesn't have all parts. + */ + private function splitJwt(string $jwt): array + { + $data = explode('.', $jwt); + + if (count($data) !== 3) { + throw InvalidTokenStructure::missingOrNotEnoughSeparators(); + } + + return $data; + } + + /** + * Parses the header from a string + * + * @param non-empty-string $data + * + * @return array + * + * @throws UnsupportedHeaderFound When an invalid header is informed. + * @throws InvalidTokenStructure When parsed content isn't an array. + */ + private function parseHeader(string $data): array + { + $header = $this->decoder->jsonDecode($this->decoder->base64UrlDecode($data)); + + if (! is_array($header)) { + throw InvalidTokenStructure::arrayExpected('headers'); + } + + $this->guardAgainstEmptyStringKeys($header, 'headers'); + + if (array_key_exists('enc', $header)) { + throw UnsupportedHeaderFound::encryption(); + } + + if (! array_key_exists('typ', $header)) { + $header['typ'] = 'JWT'; + } + + return $header; + } + + /** + * Parses the claim set from a string + * + * @param non-empty-string $data + * + * @return array + * + * @throws InvalidTokenStructure When parsed content isn't an array or contains non-parseable dates. + */ + private function parseClaims(string $data): array + { + $claims = $this->decoder->jsonDecode($this->decoder->base64UrlDecode($data)); + + if (! is_array($claims)) { + throw InvalidTokenStructure::arrayExpected('claims'); + } + + $this->guardAgainstEmptyStringKeys($claims, 'claims'); + + if (array_key_exists(RegisteredClaims::AUDIENCE, $claims)) { + $claims[RegisteredClaims::AUDIENCE] = (array) $claims[RegisteredClaims::AUDIENCE]; + } + + foreach (RegisteredClaims::DATE_CLAIMS as $claim) { + if (! array_key_exists($claim, $claims)) { + continue; + } + + $claims[$claim] = $this->convertDate($claims[$claim]); + } + + return $claims; + } + + /** + * @param array $array + * @param non-empty-string $part + * + * @phpstan-assert array $array + */ + private function guardAgainstEmptyStringKeys(array $array, string $part): void + { + foreach ($array as $key => $value) { + if ($key === '') { + throw InvalidTokenStructure::arrayExpected($part); + } + } + } + + /** @throws InvalidTokenStructure */ + private function convertDate(int|float|string $timestamp): DateTimeImmutable + { + if (! is_numeric($timestamp)) { + throw InvalidTokenStructure::dateIsNotParseable($timestamp); + } + + $normalizedTimestamp = number_format((float) $timestamp, self::MICROSECOND_PRECISION, '.', ''); + + $date = DateTimeImmutable::createFromFormat('U.u', $normalizedTimestamp); + + if ($date === false) { + throw InvalidTokenStructure::dateIsNotParseable($normalizedTimestamp); + } + + return $date; + } + + /** + * Returns the signature from given data + * + * @param non-empty-string $data + */ + private function parseSignature(string $data): Signature + { + $hash = $this->decoder->base64UrlDecode($data); + + return new Signature($hash, $data); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Token/Plain.php b/pandora_console/vendor/lcobucci/jwt/src/Token/Plain.php new file mode 100644 index 0000000000..6af388d5f5 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Token/Plain.php @@ -0,0 +1,85 @@ +headers; + } + + public function claims(): DataSet + { + return $this->claims; + } + + public function signature(): Signature + { + return $this->signature; + } + + public function payload(): string + { + return $this->headers->toString() . '.' . $this->claims->toString(); + } + + public function isPermittedFor(string $audience): bool + { + return in_array($audience, $this->claims->get(RegisteredClaims::AUDIENCE, []), true); + } + + public function isIdentifiedBy(string $id): bool + { + return $this->claims->get(RegisteredClaims::ID) === $id; + } + + public function isRelatedTo(string $subject): bool + { + return $this->claims->get(RegisteredClaims::SUBJECT) === $subject; + } + + public function hasBeenIssuedBy(string ...$issuers): bool + { + return in_array($this->claims->get(RegisteredClaims::ISSUER), $issuers, true); + } + + public function hasBeenIssuedBefore(DateTimeInterface $now): bool + { + return $now >= $this->claims->get(RegisteredClaims::ISSUED_AT); + } + + public function isMinimumTimeBefore(DateTimeInterface $now): bool + { + return $now >= $this->claims->get(RegisteredClaims::NOT_BEFORE); + } + + public function isExpired(DateTimeInterface $now): bool + { + if (! $this->claims->has(RegisteredClaims::EXPIRATION_TIME)) { + return false; + } + + return $now >= $this->claims->get(RegisteredClaims::EXPIRATION_TIME); + } + + public function toString(): string + { + return $this->headers->toString() . '.' + . $this->claims->toString() . '.' + . $this->signature->toString(); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php b/pandora_console/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php new file mode 100644 index 0000000000..ce40a6abdc --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Token/RegisteredClaimGiven.php @@ -0,0 +1,21 @@ +hash; + } + + /** + * Returns the encoded version of the signature + * + * @return non-empty-string + */ + public function toString(): string + { + return $this->encoded; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php b/pandora_console/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php new file mode 100644 index 0000000000..1824078449 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Token/UnsupportedHeaderFound.php @@ -0,0 +1,15 @@ +claims(); + + if (! $claims->has($this->claim)) { + throw ConstraintViolation::error('The token does not have the claim "' . $this->claim . '"', $this); + } + + if ($claims->get($this->claim) !== $this->expectedValue) { + throw ConstraintViolation::error( + 'The claim "' . $this->claim . '" does not have the expected value', + $this, + ); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php new file mode 100644 index 0000000000..44541a75bd --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IdentifiedBy.php @@ -0,0 +1,26 @@ +isIdentifiedBy($this->id)) { + throw ConstraintViolation::error( + 'The token is not identified with the expected ID', + $this, + ); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php new file mode 100644 index 0000000000..8ba3890db5 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/IssuedBy.php @@ -0,0 +1,30 @@ +issuers = $issuers; + } + + public function assert(Token $token): void + { + if (! $token->hasBeenIssuedBy(...$this->issuers)) { + throw ConstraintViolation::error( + 'The token was not issued by the given issuers', + $this, + ); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php new file mode 100644 index 0000000000..53abc0d4ef --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/LeewayCannotBeNegative.php @@ -0,0 +1,15 @@ +leeway = $this->guardLeeway($leeway); + } + + private function guardLeeway(?DateInterval $leeway): DateInterval + { + if ($leeway === null) { + return new DateInterval('PT0S'); + } + + if ($leeway->invert === 1) { + throw LeewayCannotBeNegative::create(); + } + + return $leeway; + } + + public function assert(Token $token): void + { + $now = $this->clock->now(); + + $this->assertIssueTime($token, $now->add($this->leeway)); + $this->assertMinimumTime($token, $now->add($this->leeway)); + $this->assertExpiration($token, $now->sub($this->leeway)); + } + + /** @throws ConstraintViolation */ + private function assertExpiration(Token $token, DateTimeInterface $now): void + { + if ($token->isExpired($now)) { + throw ConstraintViolation::error('The token is expired', $this); + } + } + + /** @throws ConstraintViolation */ + private function assertMinimumTime(Token $token, DateTimeInterface $now): void + { + if (! $token->isMinimumTimeBefore($now)) { + throw ConstraintViolation::error('The token cannot be used yet', $this); + } + } + + /** @throws ConstraintViolation */ + private function assertIssueTime(Token $token, DateTimeInterface $now): void + { + if (! $token->hasBeenIssuedBefore($now)) { + throw ConstraintViolation::error('The token was issued in the future', $this); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php new file mode 100644 index 0000000000..48544c9a18 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/PermittedFor.php @@ -0,0 +1,26 @@ +isPermittedFor($this->audience)) { + throw ConstraintViolation::error( + 'The token is not allowed to be used by this audience', + $this, + ); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php new file mode 100644 index 0000000000..164936234d --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/RelatedTo.php @@ -0,0 +1,26 @@ +isRelatedTo($this->subject)) { + throw ConstraintViolation::error( + 'The token is not related to the expected subject', + $this, + ); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php new file mode 100644 index 0000000000..5c8e265617 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWith.php @@ -0,0 +1,32 @@ +headers()->get('alg') !== $this->signer->algorithmId()) { + throw ConstraintViolation::error('Token signer mismatch', $this); + } + + if (! $this->signer->verify($token->signature()->hash(), $token->payload(), $this->key)) { + throw ConstraintViolation::error('Token signature mismatch', $this); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithOneInSet.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithOneInSet.php new file mode 100644 index 0000000000..fb542fb3d4 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithOneInSet.php @@ -0,0 +1,38 @@ + */ + private readonly array $constraints; + + public function __construct(SignedWithUntilDate ...$constraints) + { + $this->constraints = $constraints; + } + + public function assert(Token $token): void + { + $errorMessage = 'It was not possible to verify the signature of the token, reasons:'; + + foreach ($this->constraints as $constraint) { + try { + $constraint->assert($token); + + return; + } catch (ConstraintViolation $violation) { + $errorMessage .= PHP_EOL . '- ' . $violation->getMessage(); + } + } + + throw ConstraintViolation::error($errorMessage, $this); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithUntilDate.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithUntilDate.php new file mode 100644 index 0000000000..85429e8900 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/SignedWithUntilDate.php @@ -0,0 +1,47 @@ +verifySignature = new SignedWith($signer, $key); + + $this->clock = $clock ?? new class () implements ClockInterface { + public function now(): DateTimeImmutable + { + return new DateTimeImmutable(); + } + }; + } + + public function assert(Token $token): void + { + if ($this->validUntil < $this->clock->now()) { + throw ConstraintViolation::error( + 'This constraint was only usable until ' + . $this->validUntil->format(DateTimeInterface::RFC3339), + $this, + ); + } + + $this->verifySignature->assert($token); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php new file mode 100644 index 0000000000..93db0a3a3e --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/Constraint/StrictValidAt.php @@ -0,0 +1,84 @@ +leeway = $this->guardLeeway($leeway); + } + + private function guardLeeway(?DateInterval $leeway): DateInterval + { + if ($leeway === null) { + return new DateInterval('PT0S'); + } + + if ($leeway->invert === 1) { + throw LeewayCannotBeNegative::create(); + } + + return $leeway; + } + + public function assert(Token $token): void + { + if (! $token instanceof UnencryptedToken) { + throw ConstraintViolation::error('You should pass a plain token', $this); + } + + $now = $this->clock->now(); + + $this->assertIssueTime($token, $now->add($this->leeway)); + $this->assertMinimumTime($token, $now->add($this->leeway)); + $this->assertExpiration($token, $now->sub($this->leeway)); + } + + /** @throws ConstraintViolation */ + private function assertExpiration(UnencryptedToken $token, DateTimeInterface $now): void + { + if (! $token->claims()->has(Token\RegisteredClaims::EXPIRATION_TIME)) { + throw ConstraintViolation::error('"Expiration Time" claim missing', $this); + } + + if ($token->isExpired($now)) { + throw ConstraintViolation::error('The token is expired', $this); + } + } + + /** @throws ConstraintViolation */ + private function assertMinimumTime(UnencryptedToken $token, DateTimeInterface $now): void + { + if (! $token->claims()->has(Token\RegisteredClaims::NOT_BEFORE)) { + throw ConstraintViolation::error('"Not Before" claim missing', $this); + } + + if (! $token->isMinimumTimeBefore($now)) { + throw ConstraintViolation::error('The token cannot be used yet', $this); + } + } + + /** @throws ConstraintViolation */ + private function assertIssueTime(UnencryptedToken $token, DateTimeInterface $now): void + { + if (! $token->claims()->has(Token\RegisteredClaims::ISSUED_AT)) { + throw ConstraintViolation::error('"Issued At" claim missing', $this); + } + + if (! $token->hasBeenIssuedBefore($now)) { + throw ConstraintViolation::error('The token was issued in the future', $this); + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php new file mode 100644 index 0000000000..17c7546827 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/ConstraintViolation.php @@ -0,0 +1,24 @@ +|null $constraint */ + public function __construct( + string $message = '', + public readonly ?string $constraint = null, + ) { + parent::__construct($message); + } + + /** @param non-empty-string $message */ + public static function error(string $message, Constraint $constraint): self + { + return new self(message: $message, constraint: $constraint::class); + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php new file mode 100644 index 0000000000..0ef80d259f --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/NoConstraintsGiven.php @@ -0,0 +1,11 @@ +getMessage(); + }, + $violations, + ); + + $message = "The token violates some mandatory constraints, details:\n"; + $message .= implode("\n", $violations); + + return $message; + } + + /** @return ConstraintViolation[] */ + public function violations(): array + { + return $this->violations; + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validation/SignedWith.php b/pandora_console/vendor/lcobucci/jwt/src/Validation/SignedWith.php new file mode 100644 index 0000000000..e721095f30 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validation/SignedWith.php @@ -0,0 +1,8 @@ +checkConstraint($constraint, $token, $violations); + } + + if ($violations) { + throw RequiredConstraintsViolated::fromViolations(...$violations); + } + } + + /** @param ConstraintViolation[] $violations */ + private function checkConstraint( + Constraint $constraint, + Token $token, + array &$violations, + ): void { + try { + $constraint->assert($token); + } catch (ConstraintViolation $e) { + $violations[] = $e; + } + } + + public function validate(Token $token, Constraint ...$constraints): bool + { + if ($constraints === []) { + throw new NoConstraintsGiven('No constraint given.'); + } + + try { + foreach ($constraints as $constraint) { + $constraint->assert($token); + } + + return true; + } catch (ConstraintViolation) { + return false; + } + } +} diff --git a/pandora_console/vendor/lcobucci/jwt/src/Validator.php b/pandora_console/vendor/lcobucci/jwt/src/Validator.php new file mode 100644 index 0000000000..d0ce4b8c76 --- /dev/null +++ b/pandora_console/vendor/lcobucci/jwt/src/Validator.php @@ -0,0 +1,20 @@ +clock = $clock; + } + + public function doSomething() + { + /** @var DateTimeImmutable $currentDateAndTime */ + $currentDateAndTime = $this->clock->now(); + // do something useful with that information + } +} +``` + +You can then pick one of the [implementations][implementation-url] of the interface to get a clock. + +If you want to implement the interface, you can require this package and +implement `Psr\Clock\ClockInterface` in your code. + +Don't forget to add `psr/clock-implementation` to your `composer.json`s `provides`-section like this: + +```json +{ + "provides": { + "psr/clock-implementation": "1.0" + } +} +``` + +And please read the [specification text][specification-url] for details on the interface. + +[psr-url]: https://www.php-fig.org/psr/psr-20 +[package-url]: https://packagist.org/packages/psr/clock +[implementation-url]: https://packagist.org/providers/psr/clock-implementation +[specification-url]: https://github.com/php-fig/fig-standards/blob/master/proposed/clock.md diff --git a/pandora_console/vendor/psr/clock/composer.json b/pandora_console/vendor/psr/clock/composer.json new file mode 100644 index 0000000000..77992eda75 --- /dev/null +++ b/pandora_console/vendor/psr/clock/composer.json @@ -0,0 +1,21 @@ +{ + "name": "psr/clock", + "description": "Common interface for reading the clock.", + "keywords": ["psr", "psr-20", "time", "clock", "now"], + "homepage": "https://github.com/php-fig/clock", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": "^7.0 || ^8.0" + }, + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + } +} diff --git a/pandora_console/vendor/psr/clock/src/ClockInterface.php b/pandora_console/vendor/psr/clock/src/ClockInterface.php new file mode 100644 index 0000000000..7b6d8d8aae --- /dev/null +++ b/pandora_console/vendor/psr/clock/src/ClockInterface.php @@ -0,0 +1,13 @@ + Date: Wed, 3 Apr 2024 11:03:13 +0200 Subject: [PATCH 02/61] #13035 added Lcobucci\Clock --- pandora_console/composer.json | 3 +- .../vendor/composer/autoload_psr4.php | 1 + .../vendor/composer/autoload_static.php | 5 ++ .../vendor/composer/installed.json | 67 +++++++++++++++++++ pandora_console/vendor/composer/installed.php | 19 +++++- pandora_console/vendor/lcobucci/clock/LICENSE | 21 ++++++ .../vendor/lcobucci/clock/composer.json | 48 +++++++++++++ .../vendor/lcobucci/clock/src/Clock.php | 12 ++++ .../vendor/lcobucci/clock/src/FrozenClock.php | 29 ++++++++ .../vendor/lcobucci/clock/src/SystemClock.php | 32 +++++++++ 10 files changed, 234 insertions(+), 3 deletions(-) create mode 100644 pandora_console/vendor/lcobucci/clock/LICENSE create mode 100644 pandora_console/vendor/lcobucci/clock/composer.json create mode 100644 pandora_console/vendor/lcobucci/clock/src/Clock.php create mode 100644 pandora_console/vendor/lcobucci/clock/src/FrozenClock.php create mode 100644 pandora_console/vendor/lcobucci/clock/src/SystemClock.php diff --git a/pandora_console/composer.json b/pandora_console/composer.json index 9a224bf733..8514865f2d 100644 --- a/pandora_console/composer.json +++ b/pandora_console/composer.json @@ -29,7 +29,8 @@ "zircote/swagger-php": "^4.8", "doctrine/annotations": "^2.0", "ramsey/uuid": "^4.7", - "lcobucci/jwt": "^5.2" + "lcobucci/jwt": "^5.2", + "lcobucci/clock": "^3.2" }, "repositories": { "phpchartjs": { diff --git a/pandora_console/vendor/composer/autoload_psr4.php b/pandora_console/vendor/composer/autoload_psr4.php index ce98d6d4f1..e841d7bd8d 100644 --- a/pandora_console/vendor/composer/autoload_psr4.php +++ b/pandora_console/vendor/composer/autoload_psr4.php @@ -44,6 +44,7 @@ return array( 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'Models\\' => array($baseDir . '/include/rest-api/models'), 'Lcobucci\\JWT\\' => array($vendorDir . '/lcobucci/jwt/src'), + 'Lcobucci\\Clock\\' => array($vendorDir . '/lcobucci/clock/src'), 'Laravel\\SerializableClosure\\' => array($vendorDir . '/laravel/serializable-closure/src'), 'Laminas\\Json\\' => array($vendorDir . '/laminas/laminas-json/src'), 'Laminas\\Diactoros\\' => array($vendorDir . '/laminas/laminas-diactoros/src'), diff --git a/pandora_console/vendor/composer/autoload_static.php b/pandora_console/vendor/composer/autoload_static.php index f3e9754aec..711deb2b69 100644 --- a/pandora_console/vendor/composer/autoload_static.php +++ b/pandora_console/vendor/composer/autoload_static.php @@ -115,6 +115,7 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 'L' => array ( 'Lcobucci\\JWT\\' => 13, + 'Lcobucci\\Clock\\' => 15, 'Laravel\\SerializableClosure\\' => 28, 'Laminas\\Json\\' => 13, 'Laminas\\Diactoros\\' => 18, @@ -325,6 +326,10 @@ class ComposerStaticInit94a17e624d873685991e8ae888e00eb9 array ( 0 => __DIR__ . '/..' . '/lcobucci/jwt/src', ), + 'Lcobucci\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/lcobucci/clock/src', + ), 'Laravel\\SerializableClosure\\' => array ( 0 => __DIR__ . '/..' . '/laravel/serializable-closure/src', diff --git a/pandora_console/vendor/composer/installed.json b/pandora_console/vendor/composer/installed.json index 91273cf5e4..ae3230b939 100644 --- a/pandora_console/vendor/composer/installed.json +++ b/pandora_console/vendor/composer/installed.json @@ -1616,6 +1616,73 @@ }, "install-path": "../laravel/serializable-closure" }, + { + "name": "lcobucci/clock", + "version": "3.2.0", + "version_normalized": "3.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/clock.git", + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", + "shasum": "" + }, + "require": { + "php": "~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "infection/infection": "^0.27", + "lcobucci/coding-standard": "^11.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.25", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^10.2.3" + }, + "time": "2023-11-17T17:00:27+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Lcobucci\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com" + } + ], + "description": "Yet another clock abstraction", + "support": { + "issues": "https://github.com/lcobucci/clock/issues", + "source": "https://github.com/lcobucci/clock/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "install-path": "../lcobucci/clock" + }, { "name": "lcobucci/jwt", "version": "5.2.0", diff --git a/pandora_console/vendor/composer/installed.php b/pandora_console/vendor/composer/installed.php index 3f9b50d14e..852e3921ad 100644 --- a/pandora_console/vendor/composer/installed.php +++ b/pandora_console/vendor/composer/installed.php @@ -5,7 +5,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'fbec8c0a05f72bfcc2044c0a4857d5e31f534ad5', + 'reference' => '670829fa5833a6f666ebf4c78669ca6fdac476c9', 'name' => 'pandorafms/console', 'dev' => true, ), @@ -217,6 +217,15 @@ 'reference' => '3dbf8a8e914634c48d389c1234552666b3d43754', 'dev_requirement' => false, ), + 'lcobucci/clock' => array( + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../lcobucci/clock', + 'aliases' => array(), + 'reference' => '6f28b826ea01306b07980cb8320ab30b966cd715', + 'dev_requirement' => false, + ), 'lcobucci/jwt' => array( 'pretty_version' => '5.2.0', 'version' => '5.2.0.0', @@ -304,7 +313,7 @@ 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'fbec8c0a05f72bfcc2044c0a4857d5e31f534ad5', + 'reference' => '670829fa5833a6f666ebf4c78669ca6fdac476c9', 'dev_requirement' => false, ), 'paragonie/random_compat' => array( @@ -358,6 +367,12 @@ 'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d', 'dev_requirement' => false, ), + 'psr/clock-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), 'psr/container' => array( 'pretty_version' => '2.0.2', 'version' => '2.0.2.0', diff --git a/pandora_console/vendor/lcobucci/clock/LICENSE b/pandora_console/vendor/lcobucci/clock/LICENSE new file mode 100644 index 0000000000..58ea9440eb --- /dev/null +++ b/pandora_console/vendor/lcobucci/clock/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Luís Cobucci + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/pandora_console/vendor/lcobucci/clock/composer.json b/pandora_console/vendor/lcobucci/clock/composer.json new file mode 100644 index 0000000000..f2cd93b76f --- /dev/null +++ b/pandora_console/vendor/lcobucci/clock/composer.json @@ -0,0 +1,48 @@ +{ + "name": "lcobucci/clock", + "description": "Yet another clock abstraction", + "license": "MIT", + "type": "library", + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com" + } + ], + "require": { + "php": "~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" + }, + "require-dev": { + "infection/infection": "^0.27", + "lcobucci/coding-standard": "^11.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.25", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^10.2.3" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "autoload": { + "psr-4": { + "Lcobucci\\Clock\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Lcobucci\\Clock\\": "test" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "infection/extension-installer": true, + "phpstan/extension-installer": true + }, + "preferred-install": "dist", + "sort-packages": true + } +} diff --git a/pandora_console/vendor/lcobucci/clock/src/Clock.php b/pandora_console/vendor/lcobucci/clock/src/Clock.php new file mode 100644 index 0000000000..45a033b875 --- /dev/null +++ b/pandora_console/vendor/lcobucci/clock/src/Clock.php @@ -0,0 +1,12 @@ +now = $now; + } + + public function now(): DateTimeImmutable + { + return $this->now; + } +} diff --git a/pandora_console/vendor/lcobucci/clock/src/SystemClock.php b/pandora_console/vendor/lcobucci/clock/src/SystemClock.php new file mode 100644 index 0000000000..6b65dfa53e --- /dev/null +++ b/pandora_console/vendor/lcobucci/clock/src/SystemClock.php @@ -0,0 +1,32 @@ +timezone); + } +} From 1299e17ccc4508d54264b6c36ba7ad078f16df5c Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 3 Apr 2024 14:01:40 +0200 Subject: [PATCH 03/61] #13035 added new auth token method --- pandora_console/extras/mr/69.sql | 3 + .../godmode/setup/setup_general.php | 12 --- pandora_console/include/ajax/jwt.ajax.php | 60 ++++++++++++ .../include/class/JWTRepository.class.php | 91 ++++++++++++++----- pandora_console/include/functions_config.php | 12 +-- pandora_console/include/javascript/pandora.js | 29 ++++++ pandora_console/index.php | 61 ++++--------- pandora_console/pandoradb_data.sql | 2 +- 8 files changed, 187 insertions(+), 83 deletions(-) create mode 100644 pandora_console/include/ajax/jwt.ajax.php diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index 19dfe33d6d..16d746f09a 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7708,4 +7708,7 @@ UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id DELETE FROM tconfig WHERE `token` = 'legacy_database_ha'; +INSERT INTO `tconfig` (`token`, `value`) VALUES ('JWT_signature', ''); +DELETE FROM tconfig WHERE `token` = 'loginhash_pwd'; + COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php index b77ffabbee..e6bf3e4a2c 100644 --- a/pandora_console/godmode/setup/setup_general.php +++ b/pandora_console/godmode/setup/setup_general.php @@ -267,18 +267,6 @@ $table->data[$i][] = html_print_label_input_block( ); $table->data[$i++][] = html_print_label_input_block( - __('Auto login (hash) password'), - html_print_input_password( - 'loginhash_pwd', - io_output_password($config['loginhash_pwd']), - '', - 15, - 15, - true - ) -); - -$table->data[$i][] = html_print_label_input_block( __('Time source'), html_print_select( $sources, diff --git a/pandora_console/include/ajax/jwt.ajax.php b/pandora_console/include/ajax/jwt.ajax.php new file mode 100644 index 0000000000..810f6c3268 --- /dev/null +++ b/pandora_console/include/ajax/jwt.ajax.php @@ -0,0 +1,60 @@ +ajaxMethod($method) === true) { + $res = $class->{$method}(); + echo json_encode(['success' => true, 'data' => $res]); + } else { + echo json_encode(['success' => false, 'error' => 'Unavailable method.']); + } +} else { + echo json_encode(['success' => false, 'error' => 'Unavailable method.']); +} + +exit; diff --git a/pandora_console/include/class/JWTRepository.class.php b/pandora_console/include/class/JWTRepository.class.php index 4850fa9e47..367e596eea 100644 --- a/pandora_console/include/class/JWTRepository.class.php +++ b/pandora_console/include/class/JWTRepository.class.php @@ -33,6 +33,8 @@ use Lcobucci\JWT\Signer\Hmac\Sha256; use Lcobucci\JWT\Signer\Key\InMemory; use Lcobucci\JWT\Token\Parser; use Lcobucci\JWT\Validation\Constraint\SignedWith; +use Lcobucci\Clock\SystemClock; +use Lcobucci\JWT\Validation\Constraint\StrictValidAt; /** * JWT Repository. @@ -40,6 +42,13 @@ use Lcobucci\JWT\Validation\Constraint\SignedWith; final class JWTRepository { + /** + * Allowed methods to be called using AJAX request. + * + * @var array + */ + public $AJAXMethods = ['create']; + /** * Signature * @@ -66,6 +75,22 @@ final class JWTRepository } + /** + * Checks if target method is available to be called using AJAX. + * + * @param string $method Target method. + * + * @return boolean True allowed, false not. + */ + public function ajaxMethod($method) + { + // Check access. + check_login(); + + return in_array($method, $this->AJAXMethods); + } + + /** * Create token * @@ -74,16 +99,20 @@ final class JWTRepository public function create(): string { global $config; - $sha = new Sha256(); - $configJWT = Configuration::forSymmetricSigner( - $sha, - InMemory::plainText($this->signature) - ); + try { + $sha = new Sha256(); + $configJWT = Configuration::forSymmetricSigner( + $sha, + InMemory::plainText($this->signature) + ); - $now = new DateTimeImmutable(); - $token = $configJWT->builder()->issuedAt($now)->canOnlyBeUsedAfter($now)->expiresAt($now->modify('+1 minute'))->withClaim('id_user', $config['id_user'])->getToken($configJWT->signer(), $configJWT->signingKey()); + $now = new DateTimeImmutable(); + $token = $configJWT->builder()->issuedAt($now)->canOnlyBeUsedAfter($now)->expiresAt($now->modify('+1 minute'))->withClaim('id_user', $config['id_user'])->getToken($configJWT->signer(), $configJWT->signingKey()); - return $token->toString(); + return $token->toString(); + } catch (Exception $e) { + return ''; + } } @@ -94,15 +123,23 @@ final class JWTRepository */ public function validate():bool { - $sha = new Sha256(); - $configJWT = Configuration::forSymmetricSigner( - $sha, - InMemory::plainText($this->signature) - ); - $signed = new SignedWith($sha, InMemory::plainText($this->signature)); - $constraints = [$signed]; - - return $configJWT->validator()->validate($this->token, ...$constraints); + try { + $sha = new Sha256(); + $configJWT = Configuration::forSymmetricSigner( + $sha, + InMemory::plainText($this->signature) + ); + $signed = new SignedWith($sha, InMemory::plainText($this->signature)); + $now = new DateTimeZone('UTC'); + $strictValid = new StrictValidAt(SystemClock::fromUTC()); + $constraints = [ + $signed, + $strictValid, + ]; + return $configJWT->validator()->validate($this->token, ...$constraints); + } catch (Exception $e) { + return false; + } } @@ -117,11 +154,23 @@ final class JWTRepository } - public function setToken(string $tokenString) + /** + * Setting token. + * + * @param string $tokenString String token to setting. + * + * @return boolean + */ + public function setToken(string $tokenString):bool { - $encoder = new JoseEncoder(); - $parser = new Parser($encoder); - $this->token = $parser->parse($tokenString); + try { + $encoder = new JoseEncoder(); + $parser = new Parser($encoder); + $this->token = $parser->parse($tokenString); + return true; + } catch (Exception $e) { + return false; + } } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index baf09bd9fc..6e9f6aa9a9 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -207,10 +207,6 @@ function config_update_config() $error_update[] = __('Chromium config directory'); } - if (config_update_value('loginhash_pwd', (string) get_parameter('loginhash_pwd'), true, true) === false) { - $error_update[] = __('Auto login (hash) password'); - } - if (config_update_value('timesource', (string) get_parameter('timesource'), true) === false) { $error_update[] = __('Time source'); } @@ -2220,10 +2216,6 @@ function config_process_config() config_update_value('events_per_query', 5000); } - if (!isset($config['loginhash_pwd'])) { - config_update_value('loginhash_pwd', (rand(0, 1000) * rand(0, 1000)).'pandorahash', false, true); - } - if (!isset($config['trap2agent'])) { config_update_value('trap2agent', 0); } @@ -2487,6 +2479,10 @@ function config_process_config() config_update_value('number_modules_queue', 500); } + if (!isset($config['JWT_signature'])) { + config_update_value('JWT_signature', 0); + } + if (!isset($config['eastern_eggs_disabled'])) { config_update_value('eastern_eggs_disabled', 1); } diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 2a2d7205a0..afff4e48ec 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2736,3 +2736,32 @@ function menuTabsShowHide() { } } } + +function redirectNode(url) { + event.preventDefault(); + $.ajax({ + method: "POST", + url: "ajax.php", + dataType: "json", + data: { + page: "include/ajax/jwt.ajax", + method: "create" + }, + success: function(data) { + var $form = $(""); + + $form.attr("method", "post"); + $form.attr("action", url); + + var $input = $("") + .attr("type", "hidden") + .attr("name", "token") + .val(data.data); + $form.append($input); + + $("body").append($form); + + $form.submit(); + } + }); +} diff --git a/pandora_console/index.php b/pandora_console/index.php index 1a70cbcd48..2ac5317691 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -755,24 +755,19 @@ if (isset($config['id_user']) === false) { header('Location: '.ui_get_full_url('index.php'.$redirect_url)); exit; // Always exit after sending location headers. - } else if (isset($_GET['loginhash']) === true || isset($_POST['loginhash']) === true) { - // Hash login process. - $loginhash_data = get_parameter('loginhash_data', ''); - $loginhash_user = str_rot13(get_parameter('loginhash_user', '')); - - if ($config['loginhash_pwd'] != '' - && $loginhash_data == md5( - $loginhash_user.io_output_password($config['loginhash_pwd']) - ) - ) { - db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']); - $_SESSION['id_usuario'] = $loginhash_user; - $config['id_user'] = $loginhash_user; + } else if (isset($_POST['token']) === true && (bool) $config['JWT_signature'] !== false) { + include_once $config['homedir'].'/include/class/JWTRepository.class.php'; + $jwt = new JWTRepository($config['JWT_signature']); + if ($jwt->setToken($_POST['token']) && $jwt->validate()) { + $id_user = $jwt->payload()->get('id_user'); + db_logon($id_user, $_SERVER['REMOTE_ADDR']); + $_SESSION['id_usuario'] = $id_user; + $config['id_user'] = $id_user; } else { include_once 'general/login_page.php'; db_pandora_audit( AUDIT_LOG_USER_REGISTRATION, - 'Loginhash failed', + 'Login token failed', 'system' ); while (ob_get_length() > 0) { @@ -961,33 +956,17 @@ if (isset($config['id_user']) === false) { exit(''); } } else { - if (isset($_GET['loginhash_data'])) { - $loginhash_data = get_parameter('loginhash_data', ''); - $loginhash_user = str_rot13(get_parameter('loginhash_user', '')); - $iduser = $_SESSION['id_usuario']; - unset($_SESSION['id_usuario']); - unset($iduser); - - if ($config['loginhash_pwd'] != '' - && $loginhash_data == md5( - $loginhash_user.io_output_password($config['loginhash_pwd']) - ) - ) { - db_logon($loginhash_user, $_SERVER['REMOTE_ADDR']); - $_SESSION['id_usuario'] = $loginhash_user; - $config['id_user'] = $loginhash_user; - } else { - include_once 'general/login_page.php'; - db_pandora_audit( - AUDIT_LOG_USER_REGISTRATION, - 'Loginhash failed', - 'system' - ); - while (ob_get_length() > 0) { - ob_end_flush(); - } - - exit(''); + if (isset($_POST['token']) === true && (bool) $config['JWT_signature'] !== false) { + include_once $config['homedir'].'/include/class/JWTRepository.class.php'; + $jwt = new JWTRepository($config['JWT_signature']); + if ($jwt->setToken($_POST['token']) && $jwt->validate()) { + $iduser = $_SESSION['id_usuario']; + unset($_SESSION['id_usuario']); + unset($iduser); + $id_user = $jwt->payload()->get('id_user'); + db_logon($id_user, $_SERVER['REMOTE_ADDR']); + $_SESSION['id_usuario'] = $id_user; + $config['id_user'] = $id_user; } } diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 4a9f56d9bb..5f42345380 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -71,7 +71,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('trap2agent', '0'), ('date_format', 'F j, Y, g:i a'), ('event_view_hr', 8), -('loginhash_pwd', ''), +('JWT_signature', ''), ('trap2agent', 0), ('prominent_time', 'comparation'), ('timesource', 'system'), From 06947b04574ac1d8f069605b7781fc1095057453 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 3 Apr 2024 16:24:45 +0200 Subject: [PATCH 04/61] #13035 added sync jwt with nodes --- pandora_console/extras/mr/69.sql | 2 +- .../include/class/JWTRepository.class.php | 26 +++++++++++++++++++ pandora_console/include/config_process.php | 1 + pandora_console/include/functions_config.php | 12 +++++++++ pandora_console/pandoradb_data.sql | 2 +- 5 files changed, 41 insertions(+), 2 deletions(-) diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index 16d746f09a..91ece86c2b 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7708,7 +7708,7 @@ UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id DELETE FROM tconfig WHERE `token` = 'legacy_database_ha'; -INSERT INTO `tconfig` (`token`, `value`) VALUES ('JWT_signature', ''); +INSERT INTO `tconfig` (`token`, `value`) VALUES ('JWT_signature', 1); DELETE FROM tconfig WHERE `token` = 'loginhash_pwd'; COMMIT; \ No newline at end of file diff --git a/pandora_console/include/class/JWTRepository.class.php b/pandora_console/include/class/JWTRepository.class.php index 367e596eea..13a0cc267c 100644 --- a/pandora_console/include/class/JWTRepository.class.php +++ b/pandora_console/include/class/JWTRepository.class.php @@ -185,4 +185,30 @@ final class JWTRepository } + /** + * Sync the signature with nodes for jwt. + * + * @param string|null $signature Signature to send nodes. + * + * @return void + */ + public static function syncSignatureWithNodes(?string $signature):void + { + global $config; + if (function_exists('metaconsole_get_servers') === true) { + $config['JWT_signature'] = -1; + $servers = metaconsole_get_servers(); + foreach ($servers as $server) { + if (metaconsole_connect($server) == NOERR) { + config_update_value('JWT_signature', $signature, true); + } + + metaconsole_restore_db(); + } + + $config['JWT_signature'] = $signature; + } + } + + } diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3180e9dba1..9682ab4858 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -185,6 +185,7 @@ if (session_status() === PHP_SESSION_NONE) { config_process_config(); config_prepare_session(); +config_prepare_jwt_signature(); if ((bool) $config['console_log_enabled'] === true) { error_reporting(E_ALL ^ E_NOTICE); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 6e9f6aa9a9..aea58b373c 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -30,6 +30,7 @@ // Config functions. require_once __DIR__.'/../vendor/autoload.php'; require_once __DIR__.'/functions.php'; +require_once __DIR__.'/class/JWTRepository.class.php'; enterprise_include_once('include/functions_config.php'); use PandoraFMS\Core\DBMaintainer; @@ -4212,3 +4213,14 @@ function config_prepare_session() ini_set('post_max_size', $config['max_file_size']); ini_set('upload_max_filesize', $config['max_file_size']); } + + +function config_prepare_jwt_signature() +{ + global $config; + if (is_metaconsole() === true && is_centralized() === true && $config['JWT_signature'] == 1) { + $signature = JWTRepository::generateSignature(); + config_update_value('JWT_signature', $signature, true); + JWTRepository::syncSignatureWithNodes($signature); + } +} diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql index 5f42345380..b162996e05 100644 --- a/pandora_console/pandoradb_data.sql +++ b/pandora_console/pandoradb_data.sql @@ -71,7 +71,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('trap2agent', '0'), ('date_format', 'F j, Y, g:i a'), ('event_view_hr', 8), -('JWT_signature', ''), +('JWT_signature', 1), ('trap2agent', 0), ('prominent_time', 'comparation'), ('timesource', 'system'), From f75338e0c7a177ce934b60f73470779c146a4baf Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 3 Apr 2024 16:28:23 +0200 Subject: [PATCH 05/61] #13035 changed jwt signature default --- pandora_console/include/functions_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index aea58b373c..ae4700906c 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2481,7 +2481,7 @@ function config_process_config() } if (!isset($config['JWT_signature'])) { - config_update_value('JWT_signature', 0); + config_update_value('JWT_signature', 1); } if (!isset($config['eastern_eggs_disabled'])) { From 8109b417510ae5b48a543d46e2a348bf738a7b2d Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 3 Apr 2024 17:39:23 +0200 Subject: [PATCH 06/61] #13035 fixed bug with multiple nodes --- pandora_console/include/class/JWTRepository.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/class/JWTRepository.class.php b/pandora_console/include/class/JWTRepository.class.php index 13a0cc267c..d45ef9c798 100644 --- a/pandora_console/include/class/JWTRepository.class.php +++ b/pandora_console/include/class/JWTRepository.class.php @@ -196,17 +196,16 @@ final class JWTRepository { global $config; if (function_exists('metaconsole_get_servers') === true) { - $config['JWT_signature'] = -1; $servers = metaconsole_get_servers(); foreach ($servers as $server) { + $config['JWT_signature'] = -1; if (metaconsole_connect($server) == NOERR) { config_update_value('JWT_signature', $signature, true); } metaconsole_restore_db(); + $config['JWT_signature'] = $signature; } - - $config['JWT_signature'] = $signature; } } From 36196e64ba18a0656f2362ae7bec9b04a53f42ea Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 9 Apr 2024 18:14:30 +0200 Subject: [PATCH 07/61] #13035 sync signature always --- pandora_console/include/class/JWTRepository.class.php | 11 +++++++++-- pandora_console/include/functions_config.php | 3 +-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pandora_console/include/class/JWTRepository.class.php b/pandora_console/include/class/JWTRepository.class.php index d45ef9c798..d99c218005 100644 --- a/pandora_console/include/class/JWTRepository.class.php +++ b/pandora_console/include/class/JWTRepository.class.php @@ -35,6 +35,7 @@ use Lcobucci\JWT\Token\Parser; use Lcobucci\JWT\Validation\Constraint\SignedWith; use Lcobucci\Clock\SystemClock; use Lcobucci\JWT\Validation\Constraint\StrictValidAt; +enterprise_include_once('include/functions_metaconsole.php'); /** * JWT Repository. @@ -196,15 +197,21 @@ final class JWTRepository { global $config; if (function_exists('metaconsole_get_servers') === true) { + $sync = false; $servers = metaconsole_get_servers(); foreach ($servers as $server) { - $config['JWT_signature'] = -1; + $config['JWT_signature'] = 1; if (metaconsole_connect($server) == NOERR) { config_update_value('JWT_signature', $signature, true); + $sync = true; } + $config['JWT_signature'] = 1; metaconsole_restore_db(); - $config['JWT_signature'] = $signature; + } + + if ($sync === true) { + config_update_value('JWT_signature', $signature, true); } } } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index ae4700906c..3c1d20c901 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -4218,9 +4218,8 @@ function config_prepare_session() function config_prepare_jwt_signature() { global $config; - if (is_metaconsole() === true && is_centralized() === true && $config['JWT_signature'] == 1) { + if (is_metaconsole() === true && $config['JWT_signature'] == 1) { $signature = JWTRepository::generateSignature(); - config_update_value('JWT_signature', $signature, true); JWTRepository::syncSignatureWithNodes($signature); } } From 47fc3e19776eeb139d639cd56db6b24cab577794 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 10 Apr 2024 10:50:11 +0200 Subject: [PATCH 08/61] #13035 treeview refactored --- pandora_console/include/ajax/jwt.ajax.php | 14 +++- .../include/functions_treeview.php | 75 +++---------------- pandora_console/include/javascript/pandora.js | 22 +++--- 3 files changed, 32 insertions(+), 79 deletions(-) diff --git a/pandora_console/include/ajax/jwt.ajax.php b/pandora_console/include/ajax/jwt.ajax.php index 810f6c3268..62b84ab95e 100644 --- a/pandora_console/include/ajax/jwt.ajax.php +++ b/pandora_console/include/ajax/jwt.ajax.php @@ -45,11 +45,21 @@ try { // Ajax controller. $method = get_parameter('method', ''); +$only_metaconsole = (bool) get_parameter('only_metaconsole', false); if (method_exists($class, $method) === true) { if ($class->ajaxMethod($method) === true) { - $res = $class->{$method}(); - echo json_encode(['success' => true, 'data' => $res]); + if ($only_metaconsole === true) { + if (is_metaconsole() === true) { + $res = $class->{$method}(); + echo json_encode(['success' => true, 'data' => $res]); + } else { + echo json_encode(['success' => false, 'error' => 'Environment is not a metaconsole']); + } + } else { + $res = $class->{$method}(); + echo json_encode(['success' => true, 'data' => $res]); + } } else { echo json_encode(['success' => false, 'error' => 'Unavailable method.']); } diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index ada7841ab7..c240c527e8 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -18,13 +18,11 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals if (empty($server_data)) { $server_name = ''; $server_id = ''; - $url_hash = ''; $console_url = ui_get_full_url('/'); } else { $server_name = $server_data['server_name']; $server_id = $server_data['id']; $console_url = $server_data['server_url'].'/'; - $url_hash = metaconsole_get_servers_url_hash($server_data); } include_once $config['homedir'].'/include/functions_agents.php'; @@ -69,10 +67,11 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals $row['title'] = __('Name'); $row['data'] = html_print_anchor( [ - 'href' => $console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].$url_hash, + 'href' => '#', 'title' => __('Click here for view this module'), 'class' => 'font_11', 'content' => $cellName, + 'onClick' => 'redirectNode(\''.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].'\');', ], true ); @@ -325,45 +324,9 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals echo '
'; if (is_metaconsole() === true) { - echo "
"; - - parse_str($url_hash, $url_hash_array); - - html_print_input_hidden( - 'id_agente', - $module['id_agente'], - false - ); - html_print_input_hidden( - 'edit_module', - 1, - false - ); - html_print_input_hidden( - 'id_agent_module', - $module['id_agente_modulo'], - false - ); - html_print_input_hidden( - 'loginhash', - $url_hash_array['loginhash'], - false - ); - html_print_input_hidden( - 'loginhash_data', - $url_hash_array['loginhash_data'], - false - ); - html_print_input_hidden( - 'loginhash_user', - $url_hash_array['loginhash_user'], - false - ); - - echo '
'; - echo ""; + echo ''; } else { - echo ''; + echo ''; } html_print_submit_button( @@ -399,13 +362,11 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false) if (empty($server_data)) { $server_name = ''; $server_id = ''; - $url_hash = ''; $console_url = ''; } else { $server_name = $server_data['server_name']; $server_id = $server_data['id']; $console_url = $server_data['server_url'].'/'; - $url_hash = metaconsole_get_servers_url_hash($server_data); } $user_access_node = can_user_access_node(); @@ -512,7 +473,7 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false) __('Go to alerts edition'), 'upd_button', false, - 'window.location.assign("'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'")', + 'redirectNode("'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.'")', ['icon' => 'alert'], true ), @@ -533,15 +494,11 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) global $config; if (empty($server_data)) { - $server_name = ''; $server_id = ''; - $url_hash = ''; $console_url = ui_get_full_url('/'); } else { - $server_name = $server_data['server_name']; $server_id = $server_data['id']; $console_url = $server_data['server_url'].'/'; - $url_hash = metaconsole_get_servers_url_hash($server_data); } include_once $config['homedir'].'/include/functions_agents.php'; @@ -623,15 +580,6 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) $cellName = ((bool) $agent['disabled'] === true) ? '' : ''; if (is_metaconsole() === true) { - $pwd = $server_data['auth_token']; - // Create HASH login info. - $user = $config['id_user']; - - // Extract auth token from serialized field. - $pwd_deserialiced = json_decode($pwd, true); - $hashdata = $user.$pwd_deserialiced['auth_token']; - - $hashdata = md5($hashdata); if ((bool) $grants_on_node === true && (bool) $user_access_node !== false) { $urlAgent = $server_data['server_url'].'/index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente']; } else { @@ -657,7 +605,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) 'title' => __('Click here for view this agent'), 'class' => 'font_11', 'content' => $cellName, - 'onClick' => "sendHash('".$urlAgent."')", + 'onClick' => "redirectNode('".$urlAgent."')", ], true ); @@ -998,7 +946,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) $cluster = PandoraFMS\Cluster::loadFromAgentId( $agent['id_agente'] ); - $buttons_act .= ''; + $buttons_act .= ''; $buttons_act .= html_print_submit_button( __('Go to cluster edition'), 'upd_button', @@ -1007,7 +955,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) true ); } else { - $buttons_act .= ''; + $buttons_act .= ''; $buttons_act .= html_print_submit_button( __('Go to module creation'), 'upd_button', @@ -1016,7 +964,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) true ); - $buttons_act .= ''; + $buttons_act .= ''; $buttons_act .= html_print_submit_button( __('Go to agent edition'), 'upd_button', @@ -1038,11 +986,6 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false) echo " '; + } + + return '
'.html_print_input_text_extended($name, $value, 'password-'.$name, $alt, $size, $maxlength, $disabled, '', $attr, $return, true, '', $autocomplete, false, $hide_div_eye).'
'.$extra_output; } diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 1e2df92ba7..b6a3744f53 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -13809,3 +13809,242 @@ button.disabled { margin-top: 10px; padding-top: 15px; } + +.menu-dots-hide { + display: none; +} + +.menu-dots-show { + display: list-item; +} + +.tabs-hide { + display: none; +} + +.tabs-show { + display: list-item; +} + +.white_table_graph > div { + background-color: transparent; + border-radius: 8px; +} + +.link-bold { + color: var(--primary-color); + text-decoration: none; + font-weight: bold; +} + +.link-bold:hover { + opacity: 0.9; + color: var(--primary-color); +} + +.text-nowrap { + text-wrap: nowrap; +} + +#wizard_table span#image_prev img { + height: 48px; + cursor: pointer; +} + +.empty-view { + width: 100%; + max-width: 1000px; + background-color: #95a3bf0d; + border-radius: 8px; + margin: 0 auto; + margin-bottom: 25px; +} + +.empty-view > .empty-view-img-text { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: flex-start; + padding: 30px; +} + +.empty-view-text { + margin-left: 40px; +} + +.empty-view-text > span:nth-child(1) { + display: block; + color: var(--text-color-2); + font-weight: bold; + font-size: 16px; + line-height: 24px; + margin-bottom: 10px; +} + +.empty-view-text > span:nth-child(2), +.empty-view-text > span:nth-child(2) * { + color: var(--text-color-3); + font-size: 15px; + line-height: 24px; +} + +.empty-view-buttons { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-end; + align-items: center; + width: 100%; + border-top: 1px solid; + border-color: #95a3bf33; +} + +.empty-view-buttons > * { + margin: 10px; +} + +.empty-view-buttons > *:not(:last-child) { + margin-right: 0; +} + +form#submit-plugin { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + justify-content: flex-end; + align-items: center; + width: 100%; + gap: 15px; +} + +form#submit-plugin > input[type="file"] { + line-height: 34px; + padding-top: 0; +} + +form#aws-view > span.select2 { + vertical-align: bottom; + margin-right: 15px; +} + +table#snmp_console tbody td:not(.table_action_buttons) * { + height: 100%; + display: flex; + align-items: center; +} + +table#snmp_console tbody .datos_green, +table#snmp_console tbody .datos_green * { + background-color: var(--events-priority-bg-green); + color: var(--events-priority-text-green) !important; +} + +table#snmp_console tbody .datos_red, +table#snmp_console tbody .datos_red * { + background-color: var(--events-priority-bg-red); + color: var(--events-priority-text-red) !important; +} + +table#snmp_console tbody .datos_yellow, +table#snmp_console tbody .datos_yellow * { + background-color: var(--events-priority-bg-yellow); + color: var(--events-priority-text-yellow) !important; +} + +table#snmp_console tbody .datos_blue, +table#snmp_console tbody .datos_blue * { + background-color: var(--events-priority-bg-blue); + color: var(--events-priority-text-blue) !important; +} + +table#snmp_console tbody .datos_grey, +table#snmp_console tbody .datos_grey * { + background-color: var(--events-priority-bg-grey); + color: var(--events-priority-text-grey) !important; +} + +table#snmp_console tbody .datos_pink, +table#snmp_console tbody .datos_pink * { + background-color: var(--events-priority-bg-pink); + color: var(--events-priority-text-pink) !important; +} + +table#snmp_console tbody .datos_brown, +table#snmp_console tbody .datos_brown * { + background-color: var(--events-priority-bg-brown); + color: var(--events-priority-text-brown) !important; +} + +table#snmp_console tbody .datos_orange, +table#snmp_console tbody .datos_orange * { + background-color: var(--events-priority-bg-orange); + color: var(--events-priority-text-orange) !important; +} + +.open_search_status_color { + color: var(--text-color-2); +} + +button.ui-button-text-only.ui-widget.sub:hover, +#button_generate_code input.buttonButton:hover { + box-shadow: 0px 3px 6px #c7c7c7; +} + +#button_generate_code input.buttonButton { + box-shadow: none; +} + +.black-and-white { + filter: saturate(0); +} + +.invert_filter.black-and-white { + filter: invert(1) saturate(0) !important; +} + +div.tox .tox-editor-header { + z-index: 1; +} + +.select2-multiselect-widget-width { + max-width: 230px !important; +} + +.select2-container--default.select2-multiselect-text-wrap + .select2-selection--multiple + .select2-selection__rendered { + box-sizing: border-box !important; + padding-right: 0px !important; +} + +.select2-multiselect-text-wrap .select2-selection__choice { + text-wrap: wrap; + line-break: anywhere; + line-height: normal; +} + +.select2-multiselect-text-wrap .select2-selection__choice__remove { + flex-basis: 0% !important; +} + +table.filter-table-adv td > div.row-flex { + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +table.filter-table-adv td > div.row-flex.flex-end { + justify-content: flex-end; +} + +table.filter-table-adv td > div.row-flex label.custom_checkbox { + margin: 0px; +} + +table.filter-table-adv td > div.row-flex input { + width: 100%; +} + +.bg-image-none { + background-image: none !important; +} From 5a9d3a12a632ea33c08f742953bc8e3c1a91d2a1 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 25 Apr 2024 10:14:43 +0200 Subject: [PATCH 30/61] #13092 fixed performance in view agent --- pandora_console/include/functions_agents.php | 2 +- pandora_console/include/functions_modules.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 12f79aa680..64550b1452 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -4934,7 +4934,7 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent) $module_score = modules_get_agentmodule_id(io_safe_input('Hardening - Score'), $agent['id_agente']); $hardening = ''; if (is_array($module_score) === true && key_exists('id_agente_modulo', $module_score) == true) { - $raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time()); + $raw_data_score = modules_get_raw_data($module_score['id_agente_modulo'], 0, time(), false); $hardening = format_numeric($raw_data_score[0]['datos'], 2); $data = []; $data[0] = ''.__('Hardening').''; diff --git a/pandora_console/include/functions_modules.php b/pandora_console/include/functions_modules.php index 6c9efb999b..3c00cf12b6 100755 --- a/pandora_console/include/functions_modules.php +++ b/pandora_console/include/functions_modules.php @@ -1148,12 +1148,12 @@ function modules_get_table_data(?int $id_agent_module, ?int $id_type) } -function modules_get_raw_data($id_agent_module, $date_init, $date_end) +function modules_get_raw_data($id_agent_module, $date_init, $date_end, $search_in_history_db=true) { $table = modules_get_table_data($id_agent_module, null); $datelimit = ($date_init - $date_end); - $search_in_history_db = db_search_in_history_db($datelimit); + $search_in_history_db = (($search_in_history_db === true) ? db_search_in_history_db($datelimit) : false); $data = db_get_all_rows_sql( ' From e4d2e08b8867a67899a144d713e6e4cb70952a33 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 11:30:18 +0200 Subject: [PATCH 31/61] 13637-Change message no data in Monitor details --- pandora_console/operation/agentes/status_monitor.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 2a5ffd5b7a..7b74051bb8 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -2387,7 +2387,11 @@ if (empty($result) === false) { $tablePagination = ui_pagination($count_modules, false, $offset, 0, true, 'offset', $show_count); } } else { - ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]); + if (get_parameter('ag_group', false) !== false) { + ui_print_info_message(['no_close' => true, 'message' => __('No data to show')]); + } else { + ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]); + } } if (isset($tablePagination) === false) { From 61cd7b86b4ec742d3ee0590b5614b5ca0c0f66e7 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 11:35:17 +0200 Subject: [PATCH 32/61] 13637-Change message no data in Monitor details --- pandora_console/operation/agentes/status_monitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 7b74051bb8..7059423d7e 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -2388,7 +2388,7 @@ if (empty($result) === false) { } } else { if (get_parameter('ag_group', false) !== false) { - ui_print_info_message(['no_close' => true, 'message' => __('No data to show')]); + ui_print_info_message(['no_close' => true, 'message' => __('There are no monitors with these features or status')]); } else { ui_print_info_message(['no_close' => true, 'message' => __('Please apply a filter to display the data')]); } From 0eb80ff8bfdc4a6cacf58759ebe60d1d62c3c65b Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 25 Apr 2024 12:17:36 +0200 Subject: [PATCH 33/61] #13584 Fixed style in Force check button --- pandora_console/include/functions_agents.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 12f79aa680..83b2eef852 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -4755,7 +4755,10 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent) 'force_checks', false, 'window.location.assign("'.$url.'&flag_agent=1")', - [ 'mode' => 'link' ], + [ + 'mode' => 'link', + 'class' => 'mrgn_lft_20px ', + ], true ); } From 14e909f6309154100a2c381496f90cc5609359dd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Thu, 25 Apr 2024 12:44:16 +0200 Subject: [PATCH 34/61] #13652 fix dialog close error --- pandora_console/include/javascript/jquery.pandora.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index f1cffbb125..bc94cf8fbe 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -216,7 +216,7 @@ $(document).ready(function() { }); $("#ok_buttom").click(function() { - $("#license_error_msg_dialog").dialog("close"); + $(".ui-dialog-content").dialog("close"); }); } } From 67e0cad9a0283861f46e09a111ff3383bb138170 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 25 Apr 2024 13:08:13 +0200 Subject: [PATCH 35/61] #13570 Fixed dark theme styles for Collections Edit Files view buttons --- pandora_console/include/functions_filemanager.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 7e3d566cdc..51e2932f31 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -1032,7 +1032,7 @@ function filemanager_file_explorer( false, 'show_form_create_folder()', [ - 'class' => 'margin-right-2 invert_filter secondary', + 'class' => 'margin-right-2 primary buttonButton', 'icon' => 'create_directory', ], true, @@ -1047,7 +1047,7 @@ function filemanager_file_explorer( false, 'show_create_text_file()', [ - 'class' => 'margin-right-2 invert_filter secondary', + 'class' => 'margin-right-2 primary buttonButton', 'icon' => 'create_file', ], true, @@ -1061,7 +1061,7 @@ function filemanager_file_explorer( false, 'show_upload_file()', [ - 'class' => 'margin-right-2 invert_filter secondary', + 'class' => 'margin-right-2 primary buttonButton', 'icon' => 'upload_file', ], true, From a5d4eac0194aee7dd6eea31396dab02c0ec69174 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Thu, 25 Apr 2024 14:35:19 +0200 Subject: [PATCH 36/61] 13579-Fix background graph widgets dark theme --- pandora_console/include/styles/pandora_black.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 1383a3c8b5..f3396be8ae 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -2102,3 +2102,8 @@ select option:checked { #result_order .show_result_interpreter #result_items li.active { background-color: var(--secondary-color); } + +.content-widget .legend_background, +.content-widget .flot-base { + background-color: unset; +} From 499fc6bbe24340832b7b7450703bb65baf4569a5 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 25 Apr 2024 14:50:46 +0200 Subject: [PATCH 37/61] #13586 fixed button styling and spacing to create a visual console in both themes --- .../godmode/reporting/visual_console_builder.data.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php index a1e49d7206..58e20f2874 100644 --- a/pandora_console/godmode/reporting/visual_console_builder.data.php +++ b/pandora_console/godmode/reporting/visual_console_builder.data.php @@ -260,9 +260,8 @@ $layoutSizeElements[] = html_print_button( false, '', [ - 'icon' => 'cog', - 'mode' => 'link', 'value' => 'modsize', + 'class' => 'buttonButton mini', ], true ); @@ -275,9 +274,8 @@ $layoutSizeElements[] = html_print_button( false, '', [ - 'icon' => 'cog', - 'mode' => 'link', 'value' => 'modsize', + 'class' => 'buttonButton mini', ], true ); @@ -287,7 +285,7 @@ $table->data[4][] = html_print_label_input_block( __('Layout size'), html_print_div( [ - 'class' => 'flex flex-items-center', + 'class' => 'flex flex-space-around w600px', 'content' => implode('', $layoutSizeElements), ], true From 9a78752e873975ef3e89f5a6566c1c4e9bdce5e5 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Thu, 25 Apr 2024 15:33:10 +0200 Subject: [PATCH 38/61] #13464 fixed errata --- .../godmode/reporting/reporting_builder.item_editor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 5af45c53c4..02d57a5bf4 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -1459,7 +1459,7 @@ $class = 'databox filters'; From 18d41b038911a527b901b49c90b4a1cb2c539cc3 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 25 Apr 2024 17:05:42 +0200 Subject: [PATCH 39/61] #13534 fixed js injection --- pandora_server/util/pandora_manage.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 31b977cf51..5b721bd0fc 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -6191,7 +6191,7 @@ sub cli_create_group() { eval { $group_id_nodo = db_insert ($dbh_metaconsole, 'id_grupo', 'INSERT INTO tgrupo (id_grupo, nombre, icon, parent, propagate, disabled, custom_id, id_skin, description) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)', $group_name, safe_input($group_name), $icon, - $parent_group_id, 0, 0, '', 0, $description); + $parent_group_id, 0, 0, '', 0, safe_input($description)); }; if ($@) { print_log "[ERROR] Problems with IDS and doesn't created group\n\n"; @@ -6293,15 +6293,15 @@ sub cli_update_group() { if(defined($icon)){ if(defined($description)){ - db_do ($dbh,'UPDATE tgrupo SET nombre=? , parent=? , icon=? , description=? WHERE id_grupo=?',$group_name,$parent_group_id,$icon,$description,$group_id); + db_do ($dbh,'UPDATE tgrupo SET nombre=? , parent=? , icon=? , description=? WHERE id_grupo=?',safe_input($group_name),$parent_group_id,$icon, safe_input($description) ,$group_id); }else{ - db_do ($dbh,'UPDATE tgrupo SET nombre=? , parent=? , icon=? WHERE id_grupo=?',$group_name,$parent_group_id,$icon,$group_id); + db_do ($dbh,'UPDATE tgrupo SET nombre=? , parent=? , icon=? WHERE id_grupo=?',safe_input($group_name),$parent_group_id,$icon,$group_id); } }else{ - db_do ($dbh,'UPDATE tgrupo SET nombre=? , parent=? WHERE id_grupo=?',$group_name,$parent_group_id,$group_id); + db_do ($dbh,'UPDATE tgrupo SET nombre=? , parent=? WHERE id_grupo=?',safe_input($group_name),$parent_group_id,$group_id); } }else{ - db_do ($dbh,'UPDATE tgrupo SET nombre=? WHERE id_grupo=?',$group_name,$group_id); + db_do ($dbh,'UPDATE tgrupo SET nombre=? WHERE id_grupo=?',safe_input($group_name),$group_id); } print_log "[INFO] Updated group '$group_id'\n\n"; } From 5d4b5f96272e14c315e476f8ecf279dd9d8eaa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Thu, 25 Apr 2024 09:39:16 -0600 Subject: [PATCH 40/61] Remove xprobe from conf.new --- pandora_server/conf/pandora_server.conf.new | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index eded19d4db..c40746ff70 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -308,10 +308,8 @@ dataserver_threads 1 # Set 0 if want eMail deliver shared mail by all destination. mail_in_separate 1 -# nmap: If provided, is used to detect OS type with recon server using -# advanded OS fingerprint technique. Xprobe2 gives more accurate results -# Nmap is also used to do TCP port scanning in detected host. - +# nmap: used to detect OS type with recon server using advanced OS fingerprint technique. +# Nmap is also used to do TCP port scanning for host detection. nmap /usr/bin/nmap # Default path is /usr/sbin/fping for installation default in distro Centos , if you are installing in other distribution, From 006b41377980c2267397a3b263b1ba827b5325cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Su=C3=A1rez?= Date: Thu, 25 Apr 2024 09:42:14 -0600 Subject: [PATCH 41/61] Remove other Xprobe2 references --- pandora_server/FreeBSD/pandora_server.conf.new | 6 ++---- pandora_server/NetBSD/pandora_server.conf.new | 6 ++---- pandora_server/conf/pandora_server_sec.conf.template | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/pandora_server/FreeBSD/pandora_server.conf.new b/pandora_server/FreeBSD/pandora_server.conf.new index 90bd666b2b..f3e5276359 100644 --- a/pandora_server/FreeBSD/pandora_server.conf.new +++ b/pandora_server/FreeBSD/pandora_server.conf.new @@ -242,10 +242,8 @@ mta_address localhost # Set 0 if want eMail deliver shared mail by all destination. mail_in_separate 1 -# nmap: If provided, is used to detect OS type with recon server using -# advanded OS fingerprint technique. Xprobe2 gives more accurate results -# Nmap is also used to do TCP port scanning in detected host. - +# nmap: used to detect OS type with recon server using advanced OS fingerprint technique. +# Nmap is also used to do TCP port scanning for host detection. nmap /usr/local/bin/nmap # Default path is /usr/sbin/fping for installation default in distro Centos , if you are installing in other distribution, diff --git a/pandora_server/NetBSD/pandora_server.conf.new b/pandora_server/NetBSD/pandora_server.conf.new index 1adb9027f4..c9da05cddf 100644 --- a/pandora_server/NetBSD/pandora_server.conf.new +++ b/pandora_server/NetBSD/pandora_server.conf.new @@ -238,10 +238,8 @@ mta_address localhost # Set 0 if want eMail deliver shared mail by all destination. mail_in_separate 1 -# nmap: If provided, is used to detect OS type with recon server using -# advanded OS fingerprint technique. Xprobe2 gives more accurate results -# Nmap is also used to do TCP port scanning in detected host. - +# nmap: used to detect OS type with recon server using advanced OS fingerprint technique. +# Nmap is also used to do TCP port scanning for host detection. nmap /usr/pkg/bin/nmap # Path to the fping binary. Used by the Enterprise ICMP Server. diff --git a/pandora_server/conf/pandora_server_sec.conf.template b/pandora_server/conf/pandora_server_sec.conf.template index b070938187..088e2adf6e 100644 --- a/pandora_server/conf/pandora_server_sec.conf.template +++ b/pandora_server/conf/pandora_server_sec.conf.template @@ -302,10 +302,8 @@ dataserver_threads 1 # Set 0 if want eMail deliver shared mail by all destination. mail_in_separate 1 -# nmap: If provided, is used to detect OS type with recon server using -# advanded OS fingerprint technique. Xprobe2 gives more accurate results -# Nmap is also used to do TCP port scanning in detected host. - +# nmap: used to detect OS type with recon server using advanced OS fingerprint technique. +# Nmap is also used to do TCP port scanning for host detection. nmap /usr/bin/nmap # Default path is /usr/sbin/fping for installation default in distro Centos , if you are installing in other distribution, From 706ecec9d895ad1b6156dd8bb98b0b79f0ebccd2 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Fri, 26 Apr 2024 13:30:14 +0200 Subject: [PATCH 42/61] #13507 Fixed dark theme styles for Netflow Explorer filter and view icons --- .../operation/network/network_report.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/operation/network/network_report.php b/pandora_console/operation/network/network_report.php index bc72602fd0..069b8f99f3 100644 --- a/pandora_console/operation/network/network_report.php +++ b/pandora_console/operation/network/network_report.php @@ -483,6 +483,9 @@ $table->data = []; $chart_data = []; $labels = []; $hide_filter = !empty($main_value) && ($action === 'udp' || $action === 'tcp'); +$row_icon_color_filters = ($config['style'] === 'pandora') ? '' : 'filter: invert(100%) !important;'; +$row_icon_color_eye = ($config['style'] === 'pandora') ? '' : 'filter: invert(100%) !important; background-color: transparent !important;'; + foreach ($data as $item) { $row = []; $row['main'] = '
'; @@ -491,9 +494,17 @@ foreach ($data as $item) { $row['main'] .= html_print_link_with_params( 'images/filters@svg.svg', array_merge($hidden_main_link, ['main_value' => $item['host']]), - 'image' + 'image', + $row_icon_color_filters, + ); + $row['main'] .= html_print_input_image( + 'whois', + 'images/eye.png', + 'whois', + $row_icon_color_eye, + true, + ['onclick' => 'whois(\''.$item['host'].'\')'], ); - $row['main'] .= html_print_input_image('whois', 'images/eye.png', 'whois', '', true, ['onclick' => 'whois(\''.$item['host'].'\')']); } $row['main'] .= '
'; From 86db699cd315b83e97aaef0ef979c415407f7faa Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 29 Apr 2024 09:20:15 +0200 Subject: [PATCH 43/61] #13534 fixed sql injection in cli --- pandora_server/util/pandora_manage.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 5b721bd0fc..6ef84cbc43 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -6166,7 +6166,7 @@ sub cli_create_group() { $icon = '' unless defined($icon); $description = '' unless defined($description); - $group_id = pandora_create_group ($group_name, $icon, $parent_group_id, 0, 0, '', 0, $description, $dbh); + $group_id = pandora_create_group ($group_name, $icon, $parent_group_id, 0, 0, '', 0, safe_input($description), $dbh); if($group_id == -1) { print_log "[ERROR] A problem has been ocurred creating group '$group_name'\n\n"; From 1b812155e779002bf0481926fb9bf5e4421a4b38 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 29 Apr 2024 10:15:02 +0200 Subject: [PATCH 44/61] #13527 Fixed dark theme styles sound console --- pandora_console/include/ajax/events.php | 2 +- .../include/javascript/pandora_events.js | 22 +++---------------- .../include/styles/pandora_black.css | 7 +++++- .../operation/events/sound_events.php | 4 ++-- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/pandora_console/include/ajax/events.php b/pandora_console/include/ajax/events.php index a063ef5c8b..b053d304b6 100644 --- a/pandora_console/include/ajax/events.php +++ b/pandora_console/include/ajax/events.php @@ -2541,7 +2541,7 @@ if ($drawConsoleSound === true) { true, [ 'title' => __('No alerts discovered'), - 'class' => 'invert_filter', + 'class' => '', ] ); $output .= ''; diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 09ddee825c..2d7f5b0fca 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -1066,7 +1066,7 @@ function openSoundEventsDialog(settings, dialog_parameters) { resizable: false, modal: false, width: 600, - height: 600, + height: 700, dialogClass: "modal-sound", open: function() { $.ajax({ @@ -1102,24 +1102,8 @@ function openSoundEventsDialog(settings, dialog_parameters) { if (mode == 0) { action = true; } - if ($("#button-start-search").hasClass("play")) { - $("#modal-sound").css({ - height: "500px" - }); - $("#modal-sound") - .parent() - .css({ - height: "550px" - }); - } else { - $("#modal-sound").css({ - height: "450px" - }); - $("#modal-sound") - .parent() - .css({ - height: "500px" - }); + if (!$("#button-start-search").hasClass("play")) { + $("#progressbar_time").empty(); } action_events_sound(action, settings); diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index aa27e0fbf8..fae2a929b1 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -556,6 +556,11 @@ table#diagnostic_info tbody td div { color: var(--text-color) !important; } +.ui-widget-dialog-border, +.ui-dialog { + border: 1px solid #333 !important; +} + #cancel_btn_dialog { background-color: red; } @@ -1443,7 +1448,7 @@ button.submitButton { button.buttonButton.secondary, button.submitButton.secondary { background-color: #999; - color: var(--text-color); + color: var(--text-color) !important; border-color: #fff; } diff --git a/pandora_console/operation/events/sound_events.php b/pandora_console/operation/events/sound_events.php index 42ff6af0cb..50dae7b9af 100644 --- a/pandora_console/operation/events/sound_events.php +++ b/pandora_console/operation/events/sound_events.php @@ -96,7 +96,7 @@ if ($config['style'] === 'pandora_black' && !is_metaconsole()) { echo ''; echo ''; -$output = '
'; +$output = '
'; // Header tabs. $output .= '
    '; $output .= '
  • '; @@ -264,7 +264,7 @@ $output = '
    '; true, [ 'title' => __('No alerts discovered'), - 'class' => 'invert_filter', + 'class' => '', ] ); $output .= ''; From dbc20faeb2f2b0052ffd9ad5c5974d071bd14507 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 29 Apr 2024 12:10:08 +0200 Subject: [PATCH 45/61] #13659 pagination snmp view agent --- pandora_console/include/ajax/module.php | 128 ++++++++++++++ pandora_console/include/functions_agents.php | 29 +++- .../agentes/estado_generalagente.php | 158 ++++++------------ 3 files changed, 203 insertions(+), 112 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 37fac4ccac..18500c4d8d 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -55,6 +55,7 @@ if (check_login()) { $get_id_tag = (bool) get_parameter('get_id_tag', 0); $get_type = (bool) get_parameter('get_type', 0); $list_modules = (bool) get_parameter('list_modules', 0); + $list_snmp_modules = (bool) get_parameter('list_snmp_modules', 0); $get_agent_modules_json_by_name = (bool) get_parameter( 'get_agent_modules_json_by_name', 0 @@ -1538,6 +1539,133 @@ if (check_login()) { unset($table_data); } + if ($list_snmp_modules) { + include_once $config['homedir'].'/include/functions_graph.php'; + $agent = get_parameter('agent'); + $id_agente = $agent; + $network_interfaces_by_agents = agents_get_network_interfaces([$agent], false, true, get_parameter('offset', 0)); + $count_network_incerfaces = agents_get_network_interfaces([$agent], false, false, 0, true); + $network_interfaces = []; + if (empty($network_interfaces_by_agents) === false && empty($network_interfaces_by_agents[$id_agente]) === false) { + $network_interfaces = $network_interfaces_by_agents[$id_agente]['interfaces']; + } + + if (empty($network_interfaces) === false) { + $table_interface = new stdClass(); + $table_interface->id = 'agent_interface_info'; + $table_interface->class = 'info_table'; + $table_interface->width = '100%'; + $table_interface->style = []; + $table_interface->style['interface_event_graph'] = 'width: 35%;'; + + $table_interface->head = []; + $options = [ + 'class' => 'closed', + 'style' => 'cursor:pointer;', + ]; + $table_interface->data = []; + $event_text_cont = 0; + + $paginate_module = false; + if (isset($config['paginate_module']) === true) { + $paginate_module = (bool) $config['paginate_module']; + } + + foreach ($network_interfaces as $interface_name => $interface) { + if (empty($interface['traffic']) === false) { + $permission = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR'); + + if ($permission) { + $params = [ + 'interface_name' => $interface_name, + 'agent_id' => $id_agente, + 'traffic_module_in' => $interface['traffic']['in'], + 'traffic_module_out' => $interface['traffic']['out'], + ]; + $params_json = json_encode($params); + $params_encoded = base64_encode($params_json); + $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); + $graph_link = ""; + $graph_link .= html_print_image( + 'images/chart.png', + true, + [ + 'title' => __('Interface traffic'), + 'class' => 'invert_filter', + ] + ).''; + } else { + $graph_link = ''; + } + } else { + $graph_link = ''; + } + + $content = [ + 'id_agent_module' => $interface['status_module_id'], + 'id_group' => $id_group, + 'period' => SECONDS_1DAY, + 'time_from' => '00:00:00', + 'time_to' => '00:00:00', + 'sizeForTicks' => 250, + 'height_graph' => 40, + [ + ['id_agent_module' => $interface['status_module_id']], + ] + ]; + + $e_graph = \reporting_module_histogram_graph( + ['datetime' => time()], + $content + ); + + $sqlLast_contact = sprintf( + ' + SELECT timestamp + FROM tagente_estado + WHERE id_agente_modulo = '.$interface['status_module_id'] + ); + + $last_contact = db_get_all_rows_sql($sqlLast_contact); + $last_contact = array_shift($last_contact); + $last_contact = array_shift($last_contact); + + $data = []; + $data['interface_name'] = ''.$interface_name.''; + $data['interface_status'] = $interface['status_image']; + $data['interface_graph'] = $graph_link; + $data['interface_ip'] = $interface['ip']; + $data['interface_mac'] = $interface['mac']; + $data['last_contact'] = __('Last contact: ').$last_contact; + $data['interface_event_graph'] = $e_graph['chart']; + + $table_interface->data[] = $data; + } + + if ($paginate_module === true) { + ui_pagination( + $count_network_incerfaces, + false, + 0, + 0, + false, + 'offset', + true, + '', + 'change_page_snmp(offset_param)', + [ + 'count' => '', + 'offset' => 'offset_param', + ] + ); + } + + html_print_table($table_interface); + } + } + if ($get_type === true) { $id_module = (int) get_parameter('id_module'); $module = modules_get_agentmodule($id_module); diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 12f79aa680..28a98e46b4 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1544,7 +1544,9 @@ function agents_get_modules( $indexed=true, $get_not_init_modules=true, $force_tags=false, - $filter_include_sql=true + $filter_include_sql=true, + $pagination=false, + $offset=0, ) { global $config; @@ -1717,7 +1719,17 @@ function agents_get_modules( $sql_tags_join, $where ); - $result = db_get_all_rows_sql($sql); + + $limit = ''; + if ($pagination === true) { + if ($offset === 0) { + $limit = ' LIMIT '.$config['block_size'].' OFFSET 0'; + } else { + $limit = ' LIMIT '.$config['block_size'].' OFFSET '.$offset; + } + } + + $result = db_get_all_rows_sql($sql.$limit); if (empty($result)) { return []; @@ -3333,7 +3345,7 @@ function agents_update_gis( * * @return array A list of network interfaces information by agents. */ -function agents_get_network_interfaces($agents=false, $agents_filter=false) +function agents_get_network_interfaces($agents=false, $agents_filter=false, $pagination=false, $offset=0, $count=false) { global $config; @@ -3432,8 +3444,17 @@ function agents_get_network_interfaces($agents=false, $agents_filter=false) $columns, $filter, true, - false + false, + false, + true, + $pagination, + $offset ); + + if ($count === true) { + return (count($modules) ?? 0); + } + if (!empty($modules)) { $interfaces = []; diff --git a/pandora_console/operation/agentes/estado_generalagente.php b/pandora_console/operation/agentes/estado_generalagente.php index 82aa8376d1..e50a5b174f 100755 --- a/pandora_console/operation/agentes/estado_generalagente.php +++ b/pandora_console/operation/agentes/estado_generalagente.php @@ -374,111 +374,6 @@ for ($i = 0; $i < $custom_fields_count; $i++) { /* * END: TABLE DATA BUILD - */ - -/* - * START: TABLE INTERFACES - */ - -$network_interfaces_by_agents = agents_get_network_interfaces([$agent]); - -$network_interfaces = []; -if (empty($network_interfaces_by_agents) === false && empty($network_interfaces_by_agents[$id_agente]) === false) { - $network_interfaces = $network_interfaces_by_agents[$id_agente]['interfaces']; -} - -if (empty($network_interfaces) === false) { - $table_interface = new stdClass(); - $table_interface->id = 'agent_interface_info'; - $table_interface->class = 'info_table'; - $table_interface->width = '100%'; - $table_interface->style = []; - $table_interface->style['interface_event_graph'] = 'width: 35%;'; - - $table_interface->head = []; - $options = [ - 'class' => 'closed', - 'style' => 'cursor:pointer;', - ]; - $table_interface->data = []; - $event_text_cont = 0; - - foreach ($network_interfaces as $interface_name => $interface) { - if (empty($interface['traffic']) === false) { - $permission = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR'); - - if ($permission) { - $params = [ - 'interface_name' => $interface_name, - 'agent_id' => $id_agente, - 'traffic_module_in' => $interface['traffic']['in'], - 'traffic_module_out' => $interface['traffic']['out'], - ]; - $params_json = json_encode($params); - $params_encoded = base64_encode($params_json); - $win_handle = dechex(crc32($interface['status_module_id'].$interface_name)); - $graph_link = ""; - $graph_link .= html_print_image( - 'images/chart.png', - true, - [ - 'title' => __('Interface traffic'), - 'class' => 'invert_filter', - ] - ).''; - } else { - $graph_link = ''; - } - } else { - $graph_link = ''; - } - - $content = [ - 'id_agent_module' => $interface['status_module_id'], - 'id_group' => $id_group, - 'period' => SECONDS_1DAY, - 'time_from' => '00:00:00', - 'time_to' => '00:00:00', - 'sizeForTicks' => 250, - 'height_graph' => 40, - [ - ['id_agent_module' => $interface['status_module_id']], - ] - ]; - - $e_graph = \reporting_module_histogram_graph( - ['datetime' => time()], - $content - ); - - $sqlLast_contact = sprintf( - ' - SELECT timestamp - FROM tagente_estado - WHERE id_agente_modulo = '.$interface['status_module_id'] - ); - - $last_contact = db_get_all_rows_sql($sqlLast_contact); - $last_contact = array_shift($last_contact); - $last_contact = array_shift($last_contact); - - $data = []; - $data['interface_name'] = ''.$interface_name.''; - $data['interface_status'] = $interface['status_image']; - $data['interface_graph'] = $graph_link; - $data['interface_ip'] = $interface['ip']; - $data['interface_mac'] = $interface['mac']; - $data['last_contact'] = __('Last contact: ').$last_contact; - $data['interface_event_graph'] = $e_graph['chart']; - - $table_interface->data[] = $data; - } -} - -/* - * END: TABLE INTERFACES */ // This javascript piece of code is used to make expandible @@ -651,16 +546,23 @@ if (empty($agentIncidents) === false) { ); } -if (isset($table_interface) === true) { +$count_network_incerfaces = agents_get_network_interfaces([$agent], false, false, 0, true); +if ($count_network_incerfaces > 0) { ui_toggle( - html_print_table($table_interface, true), + html_print_div( + [ + 'id' => 'agent_interface_info', + 'content' => '', + 'class' => 'w100p', + ], + true + ), ''.__('Interface information (SNMP)').'', '', 'interface-table-status-agent', true ); } - ?> From a2ab92f90b4187c476116864cd3eebe1137cc971 Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 29 Apr 2024 13:04:01 +0200 Subject: [PATCH 46/61] #13507 Fixed dark theme style in the Netflow explorer chart label. --- pandora_console/include/functions_netflow.php | 8 ++++++-- .../artica/phpchartjs/src/Renderer/JavaScript.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index 9f016ac88a..247b81a816 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -1570,8 +1570,12 @@ function netflow_draw_item( ); // Theme. - $theme = $config['style']; - $text_color = ($theme !== 'pandora_black') ? '#333' : '#fff'; + $user_info = get_user_info($config['id_user']); + if (isset($user_info['id_skin']) === true && (int) $user_info['id_skin'] === 2) { + $text_color = '#ffffff'; + } else { + $text_color = '#333333'; + } $graph_output = pie_graph( $pie_data, diff --git a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php index 6b4848cb00..9462f5c803 100644 --- a/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php +++ b/pandora_console/vendor/artica/phpchartjs/src/Renderer/JavaScript.php @@ -128,6 +128,13 @@ class JavaScript extends Renderer } } };'; + + if ($this->chart->options()->getTheme() !== null) { + if ((int) $this->chart->options()->getTheme() === 2) { + $script[] = 'Chart.defaults.color = "#ffffff";'; + } + } + $script[] = 'Chart.register(chart_watermark_'.$this->chart->getId().');'; } @@ -163,6 +170,10 @@ class JavaScript extends Renderer if (chart.config.options.title !== undefined ) { chart.config.options.title.fontColor = "#ffffff"; } + + if (chart.config.options.plugins.legend.labels.font !== undefined ) { + chart.config.options.plugins.legend.labels.font.color = "#ffffff"; + } '; } } From d0ebee12ffd197cbea5b797018d0e09eb9b842bd Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 29 Apr 2024 13:12:47 +0200 Subject: [PATCH 47/61] #17267 pagination token --- pandora_console/include/ajax/module.php | 12 ++++++------ pandora_console/include/functions_agents.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 18500c4d8d..86ea0cb301 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -1543,7 +1543,12 @@ if (check_login()) { include_once $config['homedir'].'/include/functions_graph.php'; $agent = get_parameter('agent'); $id_agente = $agent; - $network_interfaces_by_agents = agents_get_network_interfaces([$agent], false, true, get_parameter('offset', 0)); + $paginate_module = false; + if (isset($config['paginate_module']) === true) { + $paginate_module = (bool) $config['paginate_module']; + } + + $network_interfaces_by_agents = agents_get_network_interfaces([$agent], false, $paginate_module, get_parameter('offset', 0)); $count_network_incerfaces = agents_get_network_interfaces([$agent], false, false, 0, true); $network_interfaces = []; if (empty($network_interfaces_by_agents) === false && empty($network_interfaces_by_agents[$id_agente]) === false) { @@ -1566,11 +1571,6 @@ if (check_login()) { $table_interface->data = []; $event_text_cont = 0; - $paginate_module = false; - if (isset($config['paginate_module']) === true) { - $paginate_module = (bool) $config['paginate_module']; - } - foreach ($network_interfaces as $interface_name => $interface) { if (empty($interface['traffic']) === false) { $permission = check_acl_one_of_groups($config['id_user'], $all_groups, 'RR'); diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 28a98e46b4..da51e102e0 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1721,7 +1721,7 @@ function agents_get_modules( ); $limit = ''; - if ($pagination === true) { + if ($pagination === true && isset($config['paginate_module']) === true) { if ($offset === 0) { $limit = ' LIMIT '.$config['block_size'].' OFFSET 0'; } else { From 243793786e0e4e088fd7a129e7802faa5cac2c5c Mon Sep 17 00:00:00 2001 From: Jorge Rincon Date: Mon, 29 Apr 2024 15:15:29 +0200 Subject: [PATCH 48/61] #13653 fixed the message when removing the OS. --- pandora_console/godmode/setup/os.list.php | 4 +++- pandora_console/include/ajax/os.php | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/setup/os.list.php b/pandora_console/godmode/setup/os.list.php index 2c722aade0..5ec791baca 100644 --- a/pandora_console/godmode/setup/os.list.php +++ b/pandora_console/godmode/setup/os.list.php @@ -219,7 +219,9 @@ echo ''; $('#aux').text(''); } else { $('#aux').dialog('close'); - location.reload(); + let url = new URL(window.location.href); + url.searchParams.set('message', r.url_message) + window.location.href = url.href; } }, error: function(e) { diff --git a/pandora_console/include/ajax/os.php b/pandora_console/include/ajax/os.php index 058fe75578..5879a00158 100644 --- a/pandora_console/include/ajax/os.php +++ b/pandora_console/include/ajax/os.php @@ -60,7 +60,12 @@ if ($method === 'deleteOS') { ) { echo json_encode(['deleted' => false]); } else { - echo json_encode(['deleted' => true]); + echo json_encode( + [ + 'deleted' => true, + 'url_message' => 6, + ] + ); } } From d2174194c964a4639b6cfde517d37f2128ff2685 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 29 Apr 2024 15:40:11 +0200 Subject: [PATCH 49/61] #13625 fix traps hints and url --- .../include/class/SnmpConsole.class.php | 8 +-- pandora_console/include/functions_ui.php | 6 +-- pandora_console/include/javascript/pandora.js | 50 +++++++++---------- pandora_console/include/styles/pandora.css | 4 ++ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index f564b6599d..fefce2e54f 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -521,7 +521,7 @@ class SnmpConsole extends HTML $legend .= '
    '; $legend .= html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).' - '.__('Delete'); $legend .= '
    '; - $legend .= '
'; + $legend .= '
'; echo '
'; @@ -778,11 +778,11 @@ class SnmpConsole extends HTML // SNMP Agent. $agent = agents_get_agent_with_ip($tmp->source); if ($agent === false) { - $tmp->snmp_agent .= 'source.'" title="'.__('Create agent').'">'.$tmp->source.''; + $tmp->snmp_agent .= ''.$tmp->source.''; } else { $tmp->snmp_agent .= ''; + $tmp->snmp_agent .= ''.$agent['alias'].''.ui_print_help_tip($tmp->source, true); + ''; } // Enterprise string. diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 89e8c2d01b..ccd4659a63 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -2948,14 +2948,14 @@ function ui_print_help_tip( $text_title = (strlen($text) >= 60) ? substr($text, 0, 60).'...' : $text; $id = random_int(1, 99999); - $output = '
'; + $output = '
'; $output .= ''; $output .= html_print_image( $img, true, [ - 'title' => $text_title, - 'class' => $blink === true ? 'blink' : '', + 'title' => io_safe_output($text_title), + 'class' => ($blink === true) ? 'blink' : '', 'style' => 'width: 16px; height: 16px;', ], false, diff --git a/pandora_console/include/javascript/pandora.js b/pandora_console/include/javascript/pandora.js index 83fbf57d54..180fb592d5 100644 --- a/pandora_console/include/javascript/pandora.js +++ b/pandora_console/include/javascript/pandora.js @@ -2364,6 +2364,29 @@ var formatterDataVerticalBar = function(value, ctx) { } }; +function open_tip(id) { + $("#tip_dialog_" + id).dialog({ + title: $("#tip_dialog_" + id).data("title"), + modal: true, + maxWidth: 600, + minWidth: 400, + show: { + effect: "fade", + duration: 200 + }, + hide: { + effect: "fade", + duration: 200 + }, + closeOnEscape: true, + buttons: { + Close: function() { + $(this).dialog("close"); + } + } + }); +} + // Show about section $(document).ready(function() { $("[id^='icon_about']").click(function() { @@ -2457,33 +2480,6 @@ $(document).ready(function() { }); } } - - $("[id^='div_tip_']").click(function() { - var id = $(this) - .attr("id") - .split("_")[2]; - - $("#tip_dialog_" + id).dialog({ - title: $("#tip_dialog_" + id).data("title"), - modal: true, - maxWidth: 600, - minWidth: 400, - show: { - effect: "fade", - duration: 200 - }, - hide: { - effect: "fade", - duration: 200 - }, - closeOnEscape: true, - buttons: { - Close: function() { - $(this).dialog("close"); - } - } - }); - }); }); function close_info_box(id) { diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 0e9d68cd5c..8e340928f7 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -3653,6 +3653,10 @@ div.tip > img { margin-left: 10px; } +div.tip > div.invisible { + display: none !important; +} + /* * --------------------------------------------------------------------- * - SEARCH BOX in header - From b60b96239fd3f8c2f0dcc3c7c5a3aac89677d393 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 29 Apr 2024 15:45:57 +0200 Subject: [PATCH 50/61] #13520 fixed message error when create snmp policy --- pandora_console/include/functions_snmp_browser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_snmp_browser.php b/pandora_console/include/functions_snmp_browser.php index d545ff102b..8328307d24 100644 --- a/pandora_console/include/functions_snmp_browser.php +++ b/pandora_console/include/functions_snmp_browser.php @@ -1588,7 +1588,12 @@ function snmp_browser_create_modules_snmp( enterprise_include_once('include/functions_policies.php'); foreach ($id_target as $policy) { - $ids[] = policies_create_module($oid['oid'], $policy, 2, $values); + $exist = db_get_row_filter('tpolicy_modules', ['name' => $oid['oid'], 'id_policy' => $policy], '*'); + if ($exist !== false) { + $ids[] = false; + } else { + $ids[] = policies_create_module($oid['oid'], $policy, 2, $values); + } } } } From 4c3ab95e3f082dd57be605cc334c73375cb1c228 Mon Sep 17 00:00:00 2001 From: Pablo Aragon Date: Mon, 29 Apr 2024 15:55:06 +0200 Subject: [PATCH 51/61] 13634-Fix endpoint api planned_downtimes_deleted --- pandora_console/include/functions_planned_downtimes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/include/functions_planned_downtimes.php b/pandora_console/include/functions_planned_downtimes.php index 772611fa29..a7d5015aba 100644 --- a/pandora_console/include/functions_planned_downtimes.php +++ b/pandora_console/include/functions_planned_downtimes.php @@ -961,7 +961,7 @@ function planned_downtimes_items($filter) function delete_planned_downtimes($filter) { - $downtime_execute = db_get_row_filter('tplanned_downtime', ['id' => $filter['id_downtime']], 'execute'); + $downtime_execute = db_get_row_filter('tplanned_downtime', ['id' => $filter['id_downtime']], 'executed'); if ($downtime_execute) { $return = __("This scheduled downtime are executed now. Can't delete in this moment."); From 4f098cc51493f4a35ac17359dfae01c6ac018de0 Mon Sep 17 00:00:00 2001 From: alejandro Date: Mon, 29 Apr 2024 16:22:16 +0200 Subject: [PATCH 52/61] update hash --- .../extras/discovery/DiscoveryApplicationsMigrateCodes.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini index 8791d535ff..5cbd75d0de 100644 --- a/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini +++ b/pandora_console/extras/discovery/DiscoveryApplicationsMigrateCodes.ini @@ -1,4 +1,4 @@ -pandorafms.vmware=09733bb0fa17a186fb62050c2d8fe0b6 +pandorafms.vmware=999bbda7bbcc313aee81d6816f8a5c0e pandorafms.mysql=33d470c7492214d4b384ed307e81adf4 pandorafms.vmware=1deafce1d55d3574645d8b136104e9ad pandorafms.mysql=ca7dd8b80a1a03a25eb0fb077818ad63 From 239bbbb117e9974d4da84f18de68c58b58558dd5 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 29 Apr 2024 16:31:42 +0200 Subject: [PATCH 53/61] #13521 fixed status color widget --- .../lib/Dashboard/Widgets/module_value.php | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/pandora_console/include/lib/Dashboard/Widgets/module_value.php b/pandora_console/include/lib/Dashboard/Widgets/module_value.php index 87992ab3ba..dde1d93508 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/module_value.php +++ b/pandora_console/include/lib/Dashboard/Widgets/module_value.php @@ -447,25 +447,18 @@ class ModuleValueWidget extends Widget $sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40; $sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40; - $sql = 'SELECT min_warning, - max_warning, - min_critical, - max_critical, - str_warning, - str_critical - FROM tagente_modulo - WHERE id_agente_modulo = '.(int) $this->values['moduleId']; - $sql_data = db_get_row_sql($sql); - - $last = modules_get_last_value($this->values['moduleId']); - - if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) { - $color = COL_WARNING; - } - - if ($last >= $sql_data['max_warning']) { - $color = COL_CRITICAL; - } + $db_status = modules_get_agentmodule_status($this->values['moduleId']); + $module_value = modules_get_last_value($this->values['moduleId']); + $status = 0; + $title = ''; + modules_get_status($this->values['moduleId'], $db_status, $module_value, $status, $title); + $color = match ($status) { + STATUS_MODULE_NO_DATA => COL_NOTINIT, + STATUS_MODULE_CRITICAL => COL_CRITICAL, + STATUS_MODULE_WARNING => COL_WARNING, + STATUS_MODULE_OK => COL_NORMAL, + STATUS_MODULE_UNKNOWN => COL_UNKNOWN, + }; $uuid = uniqid(); $output .= '
'; From a544cb06094dda95c10f3ab5618491bca86e1f56 Mon Sep 17 00:00:00 2001 From: artica Date: Tue, 30 Apr 2024 01:00:06 +0200 Subject: [PATCH 54/61] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index e6c89e7280..be9d9841ec 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240429 +Version: 7.0NG.776-240430 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index 1231a61256..c425fcd5bc 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240429" +pandora_version="7.0NG.776-240430" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 63a453d09c..95bbe6691a 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.776'; -use constant AGENT_BUILD => '240429'; +use constant AGENT_BUILD => '240430'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 19c9b23cf6..091790c5ff 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240429 +%define release 240430 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index bc1eb2a014..3c101c0720 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240429 +%define release 240430 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 3061c38b65..6fe85a1b90 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240429 +%define release 240430 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 747512944c..e0609e9635 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240429 +%define release 240430 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 85a2f2ef51..e84c66b80e 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240429 +%define release 240430 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 4275066d29..4c896413d3 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240429" +PI_BUILD="240430" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 317b22feb6..8ad9d367dc 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240429} +{240430} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index b24daf8831..865d72840d 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.776 Build 240429") +#define PANDORA_VERSION ("7.0NG.776 Build 240430") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index dfc1f21d6d..547ed73abc 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.776(Build 240429))" + VALUE "ProductVersion", "(7.0NG.776(Build 240430))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 238ebd0bc6..5e94808891 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240429 +Version: 7.0NG.776-240430 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index c22c59c057..245da14514 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240429" +pandora_version="7.0NG.776-240430" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 096b2027bb..3452e6cfe4 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240429'; +$build_version = 'PC240430'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index ee32e4d9a8..44f0cc78b0 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 9e11b76b08..a46ceff1a8 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240429 +%define release 240430 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 7cc504dd39..df84792bf7 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240429 +%define release 240430 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index d8a84c8ab0..abbd349635 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240429" +PI_BUILD="240430" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 8da9a3c529..3f717fe28e 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.776 Build 240429"; +my $version = "7.0NG.776 Build 240430"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 57383205b9..f9e50b7043 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.776 Build 240429"; +my $version = "7.0NG.776 Build 240430"; # save program name for logging my $progname = basename($0); From 7763e8fa39468ac324faa3bc7207f4818685e36e Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Apr 2024 08:23:51 +0200 Subject: [PATCH 55/61] #13517 autocomplete param size --- .../reporting/reporting_builder.item_editor.php | 2 ++ pandora_console/include/functions_ui.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pandora_console/godmode/reporting/reporting_builder.item_editor.php b/pandora_console/godmode/reporting/reporting_builder.item_editor.php index 945739bc74..cd53da1f95 100755 --- a/pandora_console/godmode/reporting/reporting_builder.item_editor.php +++ b/pandora_console/godmode/reporting/reporting_builder.item_editor.php @@ -2318,7 +2318,9 @@ if (is_metaconsole() === true) { $params['add_none_module'] = true; $params['use_hidden_input_idagent'] = true; $params['hidden_input_idagent_id'] = 'hidden-id_agent'; + $params['size'] = 40; if ($meta) { + $params['size'] = 44; $params['use_input_id_server'] = true; $params['input_id_server_id'] = 'hidden-server_id'; $params['metaconsole_enabled'] = true; diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 89e8c2d01b..7b08ae2bbf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -5867,7 +5867,7 @@ function ui_print_agent_autocomplete_input($parameters) $hidden_input_idagent_value = $parameters['hidden_input_idagent_value']; } - $size = 30; + $size = 100; // Default value. if (isset($parameters['size'])) { $size = $parameters['size']; @@ -6293,14 +6293,14 @@ function ui_print_agent_autocomplete_input($parameters) $javascript_function_change .= ' function setInputBackground(inputId, image) { $("#"+inputId) - .attr("style", "background-image: url(\'"+image+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + .attr("style", "background-image: url(\'"+image+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); } $(document).ready(function () { $("#'.$input_id.'").focusout(function (e) { setTimeout(() => { let iconImage = "'.$icon_image.'"; - $("#'.$input_id.'").attr("style", "background-image: url(\'"+iconImage+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + $("#'.$input_id.'").attr("style", "background-image: url(\'"+iconImage+"\'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); }, 100); }); }); @@ -6574,7 +6574,7 @@ function ui_print_agent_autocomplete_input($parameters) if (select_item_click) { select_item_click = 0; $("#'.$input_id.'") - .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); return; } else { // Clear selectbox if item is not selected. @@ -6589,7 +6589,7 @@ function ui_print_agent_autocomplete_input($parameters) //Set loading $("#'.$input_id.'") - .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + .attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); var term = input_value; //Word to search '.$javascript_change_ajax_params_text.' @@ -6606,7 +6606,7 @@ function ui_print_agent_autocomplete_input($parameters) success: function (data) { if (data.length < 2) { //Set icon - $("#'.$input_id.'").attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$inputStyles.'"); + $("#'.$input_id.'").attr("style", "background-image: url(\"'.$spinner_image.'\"); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$inputStyles.'"); return; } @@ -6656,7 +6656,7 @@ function ui_print_agent_autocomplete_input($parameters) //Set icon $("#'.$input_id.'") - .attr("style", "background: url(\"'.$icon_image.'\") 97% center no-repeat; background-size: 20px; width:100%; '.$inputStyles.'") + .attr("style", "background: url(\"'.$icon_image.'\") 97% center no-repeat; background-size: 20px; width:'.$size.'%; '.$inputStyles.'") return; } }); @@ -6675,7 +6675,7 @@ function ui_print_agent_autocomplete_input($parameters) } $attrs = []; - $attrs['style'] = 'background-image: url('.$icon_image.'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:100%; '.$text_color.' '.$inputStyles.''; + $attrs['style'] = 'background-image: url('.$icon_image.'); background-repeat: no-repeat; background-position: 97% center; background-size: 20px; width:'.$size.'%; '.$text_color.' '.$inputStyles.''; if (!$disabled_javascript_on_blur_function) { $attrs['onblur'] = $javascript_on_blur_function_name.'()'; From 6d8b3f7441a71d2116dbe906d40814f19b55d13a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Apr 2024 08:55:51 +0200 Subject: [PATCH 56/61] #13503 fix hover add cell dashboard --- .../include/javascript/pandora_dashboards.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandora_console/include/javascript/pandora_dashboards.js b/pandora_console/include/javascript/pandora_dashboards.js index 853379a2aa..b6e20aa4ba 100644 --- a/pandora_console/include/javascript/pandora_dashboards.js +++ b/pandora_console/include/javascript/pandora_dashboards.js @@ -232,6 +232,9 @@ function initialiceLayout(data) { }); if (!$("#checkbox-edit-mode").is(":checked")) { + $("#add-widget") + .parent() + .addClass("invisible_important"); $(".add-widget").hide(); } else { $(".new-widget-message").hide(); @@ -549,6 +552,9 @@ function initialiceLayout(data) { grid.resizable(".grid-stack-item", true); grid.float(false); $(".header-options").show(); + $("#add-widget") + .parent() + .removeClass("invisible_important"); $(".add-widget").show(); $(".new-widget-message").hide(); $("#container-layout").addClass("container-layout"); @@ -558,6 +564,9 @@ function initialiceLayout(data) { grid.resizable(".grid-stack-item", false); grid.float(true); $(".header-options").hide(); + $("#add-widget") + .parent() + .addClass("invisible_important"); $(".add-widget").hide(); $(".new-widget-message").show(); $("#container-layout").removeClass("container-layout"); @@ -776,6 +785,9 @@ function initialiceLayout(data) { }); if (!$("#checkbox-edit-mode").is(":checked")) { + $("#add-widget") + .parent() + .addClass("invisible_important"); $(".add-widget").hide(); } else { $(".new-widget-message").hide(); From 46c1890a2b081e71037616d6bff2f806349af748 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Apr 2024 11:36:45 +0200 Subject: [PATCH 57/61] #13459 add svg files --- pandora_console/godmode/setup/file_manager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php index 8ccddde606..93b83200c9 100644 --- a/pandora_console/godmode/setup/file_manager.php +++ b/pandora_console/godmode/setup/file_manager.php @@ -121,6 +121,7 @@ if ($upload_file === true) { MIME_TYPES['jpg'], MIME_TYPES['png'], MIME_TYPES['gif'], + MIME_TYPES['svg'], ] ); } From b3a212251e36f810345d9b0d54e3dd359ac2f830 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Tue, 30 Apr 2024 13:29:07 +0200 Subject: [PATCH 58/61] #13501 no show error when update without change anything --- .../godmode/agentes/configurar_agente.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pandora_console/godmode/agentes/configurar_agente.php b/pandora_console/godmode/agentes/configurar_agente.php index cdbe26d89d..01688effaa 100644 --- a/pandora_console/godmode/agentes/configurar_agente.php +++ b/pandora_console/godmode/agentes/configurar_agente.php @@ -1065,6 +1065,7 @@ if ($update_agent) { } $field_values = []; + $update_custom_result = false; foreach ($fields as $field) { $field_value = get_parameter_post('customvalue_'.$field['id_field'], ''); @@ -1115,7 +1116,7 @@ if ($update_agent) { ); if ($update_custom == 1) { - $update_custom_result = 1; + $update_custom_result = true; } } } @@ -1157,6 +1158,7 @@ if ($update_agent) { } } + $agent_data = agents_get_agent($id_agente); $values = [ 'disabled' => $disabled, 'id_parent' => $id_parent, @@ -1184,6 +1186,14 @@ if ($update_agent) { 'vul_scan_enabled' => $vul_scan_enabled, 'ignore_unknown' => $ignore_unknown, ]; + // Update change fix on ticket 13501 to no show errors when press button update with out change anything. + $update_change = false; + foreach ($values as $key => $value) { + if (isset($agent_data[$key]) === true && $agent_data[$key] !== $value) { + $update_agent = true; + break; + } + } if (empty($repeated_name) === true) { $values['nombre'] = $nombre_agente; @@ -1195,7 +1205,7 @@ if ($update_agent) { } $result = (bool) db_process_sql_update('tagente', $values, ['id_agente' => $id_agente]); - if ($result === false && $update_custom_result == false) { + if ($result === false && $update_custom_result === false && $update_change === true) { ui_print_error_message( __('There was a problem updating the agent') ); From a0ab22efb52e5651b36a5bdd6cab7e3381946bf6 Mon Sep 17 00:00:00 2001 From: artica Date: Wed, 1 May 2024 01:00:05 +0200 Subject: [PATCH 59/61] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index be9d9841ec..a0c0e60f1c 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240430 +Version: 7.0NG.776-240501 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index c425fcd5bc..c0262f0ab7 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240430" +pandora_version="7.0NG.776-240501" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 95bbe6691a..568ea9443a 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.776'; -use constant AGENT_BUILD => '240430'; +use constant AGENT_BUILD => '240501'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index 091790c5ff..ffb06ae898 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240430 +%define release 240501 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index 3c101c0720..b04a870459 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240430 +%define release 240501 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index 6fe85a1b90..b0d7e79cdd 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240430 +%define release 240501 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index e0609e9635..ae46aa062f 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240430 +%define release 240501 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index e84c66b80e..7ca5c86a57 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240430 +%define release 240501 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index 4c896413d3..afe9863b18 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240430" +PI_BUILD="240501" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8ad9d367dc..ab88f0ef17 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240430} +{240501} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 865d72840d..ea4f490037 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.776 Build 240430") +#define PANDORA_VERSION ("7.0NG.776 Build 240501") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 547ed73abc..a0a8ca3918 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.776(Build 240430))" + VALUE "ProductVersion", "(7.0NG.776(Build 240501))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 5e94808891..2ff5c1d332 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240430 +Version: 7.0NG.776-240501 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 245da14514..e6b41236e1 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240430" +pandora_version="7.0NG.776-240501" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 3452e6cfe4..927b4b1719 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240430'; +$build_version = 'PC240501'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 44f0cc78b0..2425ddc97f 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index a46ceff1a8..1cf0979fdb 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240430 +%define release 240501 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index df84792bf7..db7a998bc8 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240430 +%define release 240501 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index abbd349635..70a3f98ec0 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240430" +PI_BUILD="240501" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3f717fe28e..b5c16e6778 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.776 Build 240430"; +my $version = "7.0NG.776 Build 240501"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index f9e50b7043..d978fd40dc 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.776 Build 240430"; +my $version = "7.0NG.776 Build 240501"; # save program name for logging my $progname = basename($0); From bb0c9e5437bf4f955e86bddc7ab36fba94f21128 Mon Sep 17 00:00:00 2001 From: artica Date: Thu, 2 May 2024 01:00:04 +0200 Subject: [PATCH 60/61] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index a0c0e60f1c..fb1d843bee 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240501 +Version: 7.0NG.776-240502 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index c0262f0ab7..de5b578511 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240501" +pandora_version="7.0NG.776-240502" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 568ea9443a..a8f81071cd 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.776'; -use constant AGENT_BUILD => '240501'; +use constant AGENT_BUILD => '240502'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index ffb06ae898..e54d57fb39 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240501 +%define release 240502 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index b04a870459..0bcb7dcecf 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240501 +%define release 240502 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index b0d7e79cdd..d0d65cdc81 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240501 +%define release 240502 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index ae46aa062f..600396accd 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240501 +%define release 240502 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 7ca5c86a57..24cf291b0b 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240501 +%define release 240502 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index afe9863b18..f37e0ce254 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240501" +PI_BUILD="240502" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index ab88f0ef17..8b7204e865 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240501} +{240502} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ea4f490037..ca8476f844 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.776 Build 240501") +#define PANDORA_VERSION ("7.0NG.776 Build 240502") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index a0a8ca3918..52eafb9764 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.776(Build 240501))" + VALUE "ProductVersion", "(7.0NG.776(Build 240502))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index 2ff5c1d332..b9160ddf43 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240501 +Version: 7.0NG.776-240502 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index e6b41236e1..7a8a0187a7 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240501" +pandora_version="7.0NG.776-240502" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 927b4b1719..437e919290 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240501'; +$build_version = 'PC240502'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index 2425ddc97f..b4ce5ebdc1 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 1cf0979fdb..69624cb6b0 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240501 +%define release 240502 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index db7a998bc8..0833991089 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240501 +%define release 240502 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 70a3f98ec0..6971579dbf 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240501" +PI_BUILD="240502" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index b5c16e6778..85d19c4c4e 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.776 Build 240501"; +my $version = "7.0NG.776 Build 240502"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index d978fd40dc..a8b4ab7bea 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.776 Build 240501"; +my $version = "7.0NG.776 Build 240502"; # save program name for logging my $progname = basename($0); From 70fe2c8e8ae972d134c84af59e43fc3f9998bdfe Mon Sep 17 00:00:00 2001 From: artica Date: Fri, 3 May 2024 01:00:05 +0200 Subject: [PATCH 61/61] Auto-updated build strings. --- pandora_agents/unix/DEBIAN/control | 2 +- pandora_agents/unix/DEBIAN/make_deb_package.sh | 2 +- pandora_agents/unix/pandora_agent | 2 +- pandora_agents/unix/pandora_agent.redhat.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el8.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.el9.spec | 2 +- pandora_agents/unix/pandora_agent.redhat_bin.spec | 2 +- pandora_agents/unix/pandora_agent.spec | 2 +- pandora_agents/unix/pandora_agent_installer | 2 +- pandora_agents/win32/installer/pandora.mpi | 2 +- pandora_agents/win32/pandora.cc | 2 +- pandora_agents/win32/versioninfo.rc | 2 +- pandora_console/DEBIAN/control | 2 +- pandora_console/DEBIAN/make_deb_package.sh | 2 +- pandora_console/include/config_process.php | 2 +- pandora_console/install.php | 2 +- pandora_console/pandora_console.redhat.spec | 2 +- pandora_console/pandora_console.rhel7.spec | 2 +- pandora_console/pandora_console.spec | 2 +- pandora_server/DEBIAN/control | 2 +- pandora_server/DEBIAN/make_deb_package.sh | 2 +- pandora_server/lib/PandoraFMS/Config.pm | 2 +- pandora_server/lib/PandoraFMS/PluginTools.pm | 2 +- pandora_server/pandora_server.redhat.spec | 2 +- pandora_server/pandora_server.spec | 2 +- pandora_server/pandora_server_installer | 2 +- pandora_server/util/pandora_db.pl | 2 +- pandora_server/util/pandora_manage.pl | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/pandora_agents/unix/DEBIAN/control b/pandora_agents/unix/DEBIAN/control index fb1d843bee..122d43ed05 100644 --- a/pandora_agents/unix/DEBIAN/control +++ b/pandora_agents/unix/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-agent-unix -Version: 7.0NG.776-240502 +Version: 7.0NG.776-240503 Architecture: all Priority: optional Section: admin diff --git a/pandora_agents/unix/DEBIAN/make_deb_package.sh b/pandora_agents/unix/DEBIAN/make_deb_package.sh index de5b578511..03461beb0f 100644 --- a/pandora_agents/unix/DEBIAN/make_deb_package.sh +++ b/pandora_agents/unix/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240502" +pandora_version="7.0NG.776-240503" echo "Test if you has the tools for to make the packages." whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index a8f81071cd..05d49335cb 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1039,7 +1039,7 @@ my $Sem = undef; my $ThreadSem = undef; use constant AGENT_VERSION => '7.0NG.776'; -use constant AGENT_BUILD => '240502'; +use constant AGENT_BUILD => '240503'; # Agent log default file size maximum and instances use constant DEFAULT_MAX_LOG_SIZE => 600000; diff --git a/pandora_agents/unix/pandora_agent.redhat.spec b/pandora_agents/unix/pandora_agent.redhat.spec index e54d57fb39..037ebbe6bb 100644 --- a/pandora_agents/unix/pandora_agent.redhat.spec +++ b/pandora_agents/unix/pandora_agent.redhat.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240502 +%define release 240503 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec index 0bcb7dcecf..d3558b0026 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240502 +%define release 240503 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec index d0d65cdc81..a7d6c6a620 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240502 +%define release 240503 %define debug_package %{nil} Summary: Pandora FMS Linux agent, binary version diff --git a/pandora_agents/unix/pandora_agent.redhat_bin.spec b/pandora_agents/unix/pandora_agent.redhat_bin.spec index 600396accd..db99b6fbf2 100644 --- a/pandora_agents/unix/pandora_agent.redhat_bin.spec +++ b/pandora_agents/unix/pandora_agent.redhat_bin.spec @@ -5,7 +5,7 @@ %define name pandorafms_agent_linux_bin %define source_name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240502 +%define release 240503 Summary: Pandora FMS Linux agent, binary version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent.spec b/pandora_agents/unix/pandora_agent.spec index 24cf291b0b..250f327421 100644 --- a/pandora_agents/unix/pandora_agent.spec +++ b/pandora_agents/unix/pandora_agent.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_agent_linux %define version 7.0NG.776 -%define release 240502 +%define release 240503 Summary: Pandora FMS Linux agent, PERL version Name: %{name} diff --git a/pandora_agents/unix/pandora_agent_installer b/pandora_agents/unix/pandora_agent_installer index f37e0ce254..aae9e94d1a 100755 --- a/pandora_agents/unix/pandora_agent_installer +++ b/pandora_agents/unix/pandora_agent_installer @@ -10,7 +10,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240502" +PI_BUILD="240503" OS_NAME=`uname -s` FORCE=0 diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index 8b7204e865..37d4289b18 100644 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{240502} +{240503} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index ca8476f844..85da7bbecd 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("7.0NG.776 Build 240502") +#define PANDORA_VERSION ("7.0NG.776 Build 240503") string pandora_path; string pandora_dir; diff --git a/pandora_agents/win32/versioninfo.rc b/pandora_agents/win32/versioninfo.rc index 52eafb9764..44c1b8d6a1 100644 --- a/pandora_agents/win32/versioninfo.rc +++ b/pandora_agents/win32/versioninfo.rc @@ -11,7 +11,7 @@ BEGIN VALUE "LegalCopyright", "Pandora FMS" VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "ProductName", "Pandora FMS Windows Agent" - VALUE "ProductVersion", "(7.0NG.776(Build 240502))" + VALUE "ProductVersion", "(7.0NG.776(Build 240503))" VALUE "FileVersion", "1.0.0.0" END END diff --git a/pandora_console/DEBIAN/control b/pandora_console/DEBIAN/control index b9160ddf43..e947bc0573 100644 --- a/pandora_console/DEBIAN/control +++ b/pandora_console/DEBIAN/control @@ -1,5 +1,5 @@ package: pandorafms-console -Version: 7.0NG.776-240502 +Version: 7.0NG.776-240503 Architecture: all Priority: optional Section: admin diff --git a/pandora_console/DEBIAN/make_deb_package.sh b/pandora_console/DEBIAN/make_deb_package.sh index 7a8a0187a7..c6b8402407 100644 --- a/pandora_console/DEBIAN/make_deb_package.sh +++ b/pandora_console/DEBIAN/make_deb_package.sh @@ -14,7 +14,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -pandora_version="7.0NG.776-240502" +pandora_version="7.0NG.776-240503" package_pear=0 package_pandora=1 diff --git a/pandora_console/include/config_process.php b/pandora_console/include/config_process.php index 437e919290..9af4949d06 100644 --- a/pandora_console/include/config_process.php +++ b/pandora_console/include/config_process.php @@ -22,7 +22,7 @@ use DI\ContainerBuilder; /* * Pandora build version and version */ -$build_version = 'PC240502'; +$build_version = 'PC240503'; $pandora_version = 'v7.0NG.776'; // Do not overwrite default timezone set if defined. diff --git a/pandora_console/install.php b/pandora_console/install.php index b4ce5ebdc1..d97bd64d26 100644 --- a/pandora_console/install.php +++ b/pandora_console/install.php @@ -131,7 +131,7 @@
[ qw() ] ); diff --git a/pandora_server/pandora_server.redhat.spec b/pandora_server/pandora_server.redhat.spec index 69624cb6b0..7cc4e63064 100644 --- a/pandora_server/pandora_server.redhat.spec +++ b/pandora_server/pandora_server.redhat.spec @@ -7,7 +7,7 @@ %define debug_package %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240502 +%define release 240503 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server.spec b/pandora_server/pandora_server.spec index 0833991089..16ad3ac618 100644 --- a/pandora_server/pandora_server.spec +++ b/pandora_server/pandora_server.spec @@ -4,7 +4,7 @@ %global __os_install_post %{nil} %define name pandorafms_server %define version 7.0NG.776 -%define release 240502 +%define release 240503 Summary: Pandora FMS Server Name: %{name} diff --git a/pandora_server/pandora_server_installer b/pandora_server/pandora_server_installer index 6971579dbf..5a42f571c6 100755 --- a/pandora_server/pandora_server_installer +++ b/pandora_server/pandora_server_installer @@ -9,7 +9,7 @@ # ********************************************************************** PI_VERSION="7.0NG.776" -PI_BUILD="240502" +PI_BUILD="240503" MODE=$1 if [ $# -gt 1 ]; then diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 85d19c4c4e..511a173cf1 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -38,7 +38,7 @@ use PandoraFMS::Config; use PandoraFMS::DB; # version: define current version -my $version = "7.0NG.776 Build 240502"; +my $version = "7.0NG.776 Build 240503"; # Pandora server configuration my %conf; diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index a8b4ab7bea..a74b93661d 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -36,7 +36,7 @@ use Encode::Locale; Encode::Locale::decode_argv; # version: define current version -my $version = "7.0NG.776 Build 240502"; +my $version = "7.0NG.776 Build 240503"; # save program name for logging my $progname = basename($0);